Alexey Serbin has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/12158 )

Change subject: KUDU-2348: Pick a random replica in RemoteTablet.java
......................................................................

KUDU-2348: Pick a random replica in RemoteTablet.java

In RemoteTablet.java, 'getClosestServerInfo' always returns
whichever server ends up last in the map iteration order, if
all servers in the cluster is fully remote. This behavior
would cause heavy load on a particular server if there are
few servers in the cluster.

This patch fixes the issue by generating a random non-negative
integer(randomInt) in RemoteTablet initializer and choose server
based on randomInt. The randomInt variable is static so the
choice is same across multiple RemoteTablet instances.

Change-Id: I3d70e45d4c9532bb32223c1dddd0936b4ff8fd99
Reviewed-on: http://gerrit.cloudera.org:8080/12158
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <[email protected]>
---
M java/kudu-client/src/main/java/org/apache/kudu/client/RemoteTablet.java
1 file changed, 25 insertions(+), 18 deletions(-)

Approvals:
  Kudu Jenkins: Verified
  Alexey Serbin: Looks good to me, approved

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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3d70e45d4c9532bb32223c1dddd0936b4ff8fd99
Gerrit-Change-Number: 12158
Gerrit-PatchSet: 12
Gerrit-Owner: Yifan Zhang <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Will Berkeley <[email protected]>
Gerrit-Reviewer: Yifan Zhang <[email protected]>

Reply via email to