You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Adar Dembo (Code Review)" <ge...@cloudera.org> on 2017/09/12 22:33:08 UTC

[kudu-CR] KUDU-1807 (part 2): ban GetTableSchema for table createdness in clients

Hello Dan Burkert, Todd Lipcon, Kudu Jenkins,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/8026

to look at the new patch set (#2).

Change subject: KUDU-1807 (part 2): ban GetTableSchema for table createdness in clients
......................................................................

KUDU-1807 (part 2): ban GetTableSchema for table createdness in clients

This patch modifies new Java clients to no longer use the create_table_done
field in GetTableSchema RPCs. After the CreateTable RPC returns, the client
will enter an IsCreateTableDone loop, and when that's done, it'll issue a
GetTableSchema to fetch the schema and build a KuduTable.

There are a couple other changes worth noting:
- openTable no longer waits for table creation before returning. Doing that
  now would require at least one IsCreateTableDone RPC, which basically
  defeats the purpose of these changes. Moreover, the C++ client doesn't do
  this, so I don't see why the Java client should.
- I removed the 'tablesNotServed' logic which had no useful effect because,
  as I recently learned, there's retry logic to deal with TABLET_NOT_RUNNING
  master errors embedded more deeply in the Java client.
- I removed the master permit acquisition from the "is create table done"
  loop, since these loops should no longer produce a thundering herds (as I
  suppose they could have due to 'tablesNotServed').
- Even though createTable waits for table creation to finish, I added an
  isCreateTableDone method to help synchronize the use case where multiple
  clients or threads all try to create and then open a table concurrently.

Change-Id: I54fa07dc34a97f1c9da06ec9129d6d4590b7aac6
---
M java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java
M java/kudu-client/src/main/java/org/apache/kudu/client/CreateTableRequest.java
M java/kudu-client/src/main/java/org/apache/kudu/client/CreateTableResponse.java
M java/kudu-client/src/main/java/org/apache/kudu/client/DeadlineTracker.java
M java/kudu-client/src/main/java/org/apache/kudu/client/GetTableSchemaRequest.java
M java/kudu-client/src/main/java/org/apache/kudu/client/GetTableSchemaResponse.java
M java/kudu-client/src/main/java/org/apache/kudu/client/IsCreateTableDoneRequest.java
A java/kudu-client/src/main/java/org/apache/kudu/client/IsCreateTableDoneResponse.java
M java/kudu-client/src/main/java/org/apache/kudu/client/KuduClient.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestDeadlineTracker.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestFlexiblePartitioning.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduClient.java
12 files changed, 398 insertions(+), 253 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/26/8026/2
-- 
To view, visit http://gerrit.cloudera.org:8080/8026
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I54fa07dc34a97f1c9da06ec9129d6d4590b7aac6
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Dan Burkert <da...@apache.org>
Gerrit-Reviewer: Jean-Daniel Cryans <jd...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>