kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [1/2] incubator-kudu git commit: [java-client] Add AsyncKuduClient#syncClient
Date Wed, 04 May 2016 23:39:16 GMT
Repository: incubator-kudu
Updated Branches:
  refs/heads/master 1536f2fd7 -> e9fa79f46


[java-client] Add AsyncKuduClient#syncClient

This adds a method of creating a sync client from an async client. Another
alternative would have been making the KuduClient(AsyncKuduClient) constructor
public, but that would expose the unstable AsyncKuduClient type in the evolving
KuduClient API.

Change-Id: I947ce53257454eb3a355f50127e796c6625ee3f2
Reviewed-on: http://gerrit.cloudera.org:8080/2950
Reviewed-by: Jean-Daniel Cryans
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/ce18b47e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/ce18b47e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/ce18b47e

Branch: refs/heads/master
Commit: ce18b47ecc4bb89946a9bd66cc05b92ef492b182
Parents: 1536f2f
Author: Dan Burkert <dan@cloudera.com>
Authored: Wed May 4 09:37:04 2016 -0700
Committer: Dan Burkert <dan@cloudera.com>
Committed: Wed May 4 20:21:22 2016 +0000

----------------------------------------------------------------------
 .../src/main/java/org/kududb/client/AsyncKuduClient.java | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/ce18b47e/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduClient.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduClient.java b/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduClient.java
index 304c4cd..3e7fe69 100644
--- a/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduClient.java
+++ b/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduClient.java
@@ -269,6 +269,17 @@ public class AsyncKuduClient implements AutoCloseable {
   }
 
   /**
+   * Returns a synchronous {@link KuduClient} which wraps this asynchronous client.
+   * Calling {@link KuduClient#close} on the returned client will close this client.
+   * If this asynchronous client should outlive the returned synchronous client,
+   * then do not close the synchronous client.
+   * @return a new synchronous {@code KuduClient}
+   */
+  public KuduClient syncClient() {
+    return new KuduClient(this);
+  }
+
+  /**
    * Create a table on the cluster with the specified name and schema. Default table
    * configurations are used, mainly the table will have one tablet.
    * @param name the table's name


Mime
View raw message