[ https://issues.apache.org/jira/browse/HBASE-13376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14549554#comment-14549554 ]
Ted Yu commented on HBASE-13376: -------------------------------- {code} 771 private Comparator<Integer> localityComparator = new Comparator<Integer>() { 772 @Override 773 public int compare(Integer integer, Integer integer2) { {code} Can the parameters for compare() have better names, such as server1, server2 ? {code} 794 while (localityPerServer[lowestLocalServerIndex] == 0 795 && (regionsPerServer[lowestLocalServerIndex].length == 0)) { {code} The above assumes 0 is the lowest locality. What if locality for serverIndicesSortedByLocality[0] is greater than 0 but the region count on the server is 0 ? {code} 796 i++; 797 lowestLocalServerIndex = serverIndicesSortedByLocality[i]; {code} Better check for boundary before assigning lowestLocalServerIndex. Test failure in TestRegionRebalancing might be related to patch, however https://builds.apache.org/job/PreCommit-HBASE-Build/13602//testReport/ is no longer accessible. > Improvements to Stochastic load balancer > ---------------------------------------- > > Key: HBASE-13376 > URL: https://issues.apache.org/jira/browse/HBASE-13376 > Project: HBase > Issue Type: Improvement > Components: Balancer > Affects Versions: 1.0.0, 0.98.12 > Reporter: Vandana Ayyalasomayajula > Assignee: Vandana Ayyalasomayajula > Priority: Minor > Attachments: HBASE-13376_0.98.txt, HBASE-13376_0.txt, > HBASE-13376_98.patch > > > There are two things this jira tries to address: > 1. The locality picker in the stochastic balancer does not pick regions with > least locality as candidates for swap/move. So when any user configures > locality cost in the configs, the balancer does not always seems to move > regions with bad locality. > 2. When a cluster has equal number of loaded regions, it always picks the > first one. It should pick a random region on one of the equally loaded > servers. This improves a chance of finding a good candidate, when load picker > is invoked several times. -- This message was sent by Atlassian JIRA (v6.3.4#6332)