Jean-Daniel Cryans has posted comments on this change.

Change subject: [java-client] use tablet cache for locateTablet calls
......................................................................


Patch Set 2:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/3386/2/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduClient.java
File java/kudu-client/src/main/java/org/kududb/client/AsyncKuduClient.java:

Line 1876:     private final List<LocatedTablet.Replica> replicas = new 
ArrayList<>();
> Would it be safe to use a CopyOnWriteArrayList here, and in doing so avoid 
I don't think the tradeoff is worth it. Maybe we should document this, but 
replicas here would only be used when getting a list of locations. It's not a 
common thing to do, and it's not typically done in conjunction with normal 
inserts/scans.

Using CopyOnWriteArrayList means taking a hit under the lock while refreshing 
the tablet clients, which happens a lot more often than getting the replicas.


Line 2047:     List<LocatedTablet.Replica> getReplicas() {
> Nit: may want to name it "getImmutableReplicas" so that callers know they c
Quickly looking through the code, looks like we don't do it, and I'm not sure 
we even have occasions to do it. I like it too.


-- 
To view, visit http://gerrit.cloudera.org:8080/3386
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I78b5d400778547a9ee090111663677901dbadd98
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Dan Burkert <d...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Dan Burkert <d...@cloudera.com>
Gerrit-Reviewer: Jean-Daniel Cryans
Gerrit-Reviewer: Kudu Jenkins
Gerrit-HasComments: Yes

Reply via email to