Jean-Daniel Cryans has uploaded a new change for review.

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

Change subject: [java client] Decouple TabletClient from RemoteTablet
......................................................................

[java client] Decouple TabletClient from RemoteTablet

RemoteTablet was caching TabletClients which was making it hard to test it
in isolation, since it required having real connections to servers.

This patch makes it so that only UUIDs are passed around, the client now
queries a RemoteTablet to know which UUID to get from ConnectionCache. A
lot of new unit tests were written that weren't possible before without
a lot of mocking.

Doing this brings subtle behavior changes. ConnectionCache is now the only
component responsible for handling TabletClients. The whole concept of 
"reconnection"
could be brought into ConnectionCache, simplifying sendRpcToTablet. It also
means that using an object monitor likely creates a bottleneck in 
ConnectionCache,
so a RWL was deployed instead.

Since I was in that code, I also changed the tablet ID from Slice to String in
RemoteTablet. It was an old mistake I made years ago, we didn't need the Slice.

This still needs to be benchmarked against the 1.0.x client jar.

Change-Id: If3ad2190c7e2c7f51cb9ffe6ed3348b62488e675
---
M java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java
M java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduScanner.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Batch.java
M java/kudu-client/src/main/java/org/apache/kudu/client/ConnectionCache.java
M java/kudu-client/src/main/java/org/apache/kudu/client/KuduRpc.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
A java/kudu-client/src/main/java/org/apache/kudu/client/PingRequest.java
A java/kudu-client/src/main/java/org/apache/kudu/client/PingResponse.java
M java/kudu-client/src/main/java/org/apache/kudu/client/RemoteTablet.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Statistics.java
M java/kudu-client/src/main/java/org/apache/kudu/client/TableLocationsCache.java
M java/kudu-client/src/main/java/org/apache/kudu/client/TabletClient.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestAsyncKuduClient.java
M 
java/kudu-client/src/test/java/org/apache/kudu/client/TestAsyncKuduSession.java
A java/kudu-client/src/test/java/org/apache/kudu/client/TestConnectionCache.java
A java/kudu-client/src/test/java/org/apache/kudu/client/TestRemoteTablet.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestUtils.java
17 files changed, 612 insertions(+), 469 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/57/4757/1
-- 
To view, visit http://gerrit.cloudera.org:8080/4757
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3ad2190c7e2c7f51cb9ffe6ed3348b62488e675
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Jean-Daniel Cryans <[email protected]>

Reply via email to