You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pegasus.apache.org by wa...@apache.org on 2022/09/13 03:17:55 UTC
[incubator-pegasus] branch master updated: feat: make java client interface closable (#1152)
This is an automated email from the ASF dual-hosted git repository.
wangdan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git
The following commit(s) were added to refs/heads/master by this push:
new 67063247a feat: make java client interface closable (#1152)
67063247a is described below
commit 67063247ac1c20829eb60d40f8795013769261a4
Author: shalk(xiao kun) <xs...@163.com>
AuthorDate: Tue Sep 13 11:17:49 2022 +0800
feat: make java client interface closable (#1152)
---
.../java/org/apache/pegasus/client/PegasusAdminClientInterface.java | 4 +++-
.../main/java/org/apache/pegasus/client/PegasusClientInterface.java | 4 +++-
.../main/java/org/apache/pegasus/client/PegasusScannerInterface.java | 4 +++-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/java-client/src/main/java/org/apache/pegasus/client/PegasusAdminClientInterface.java b/java-client/src/main/java/org/apache/pegasus/client/PegasusAdminClientInterface.java
index 103a1cbca..ac76af1d0 100644
--- a/java-client/src/main/java/org/apache/pegasus/client/PegasusAdminClientInterface.java
+++ b/java-client/src/main/java/org/apache/pegasus/client/PegasusAdminClientInterface.java
@@ -19,9 +19,10 @@
package org.apache.pegasus.client;
+import java.io.Closeable;
import java.util.Map;
-public interface PegasusAdminClientInterface {
+public interface PegasusAdminClientInterface extends Closeable {
/**
* Create A new pegasus app which is not stateless However the successful execution of the
* interface does not guarantee the fully healthy of every partition of the newly created app You
@@ -61,5 +62,6 @@ public interface PegasusAdminClientInterface {
public void dropApp(String appName, int reserveSeconds) throws PException;
/** close the client */
+ @Override
public void close();
}
diff --git a/java-client/src/main/java/org/apache/pegasus/client/PegasusClientInterface.java b/java-client/src/main/java/org/apache/pegasus/client/PegasusClientInterface.java
index 19d5ea2bc..17e8348f5 100644
--- a/java-client/src/main/java/org/apache/pegasus/client/PegasusClientInterface.java
+++ b/java-client/src/main/java/org/apache/pegasus/client/PegasusClientInterface.java
@@ -18,6 +18,7 @@
*/
package org.apache.pegasus.client;
+import java.io.Closeable;
import java.util.*;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.pegasus.client.request.Batch;
@@ -27,7 +28,7 @@ import org.apache.pegasus.client.request.BatchWithResponse;
* @author qinzuoyan
* <p>This class provides interfaces to access data of a specified cluster.
*/
-public interface PegasusClientInterface {
+public interface PegasusClientInterface extends Closeable {
/**
* Get pegasus configuration for client.
*
@@ -36,6 +37,7 @@ public interface PegasusClientInterface {
public ClientOptions getConfiguration();
/** Close the client. The client can not be used again after closed. */
+ @Override
public void close();
/**
diff --git a/java-client/src/main/java/org/apache/pegasus/client/PegasusScannerInterface.java b/java-client/src/main/java/org/apache/pegasus/client/PegasusScannerInterface.java
index f655e9c41..125fbee54 100644
--- a/java-client/src/main/java/org/apache/pegasus/client/PegasusScannerInterface.java
+++ b/java-client/src/main/java/org/apache/pegasus/client/PegasusScannerInterface.java
@@ -19,13 +19,14 @@
package org.apache.pegasus.client;
import io.netty.util.concurrent.Future;
+import java.io.Closeable;
import org.apache.commons.lang3.tuple.Pair;
/**
* @author shenyuannan
* <p>This class provides interfaces to scan data of a specified table.
*/
-public interface PegasusScannerInterface {
+public interface PegasusScannerInterface extends Closeable {
/**
* Get the next item.
*
@@ -52,5 +53,6 @@ public interface PegasusScannerInterface {
Future<Pair<Pair<byte[], byte[]>, byte[]>> asyncNext();
/** Close the scanner. Should be called when scan completed. */
+ @Override
void close();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pegasus.apache.org
For additional commands, e-mail: commits-help@pegasus.apache.org