HBASE-16133 RSGroupBasedLoadBalancer.retainAssignment() might miss a region

This commit is contained in:
Enis Soztutar 2016-07-01 09:28:41 -07:00
parent cc73c03118
commit bc70dc00bb
1 changed files with 4 additions and 3 deletions

View File

@ -216,9 +216,10 @@ public class RSGroupBasedLoadBalancer implements RSGroupableBalancer, LoadBalanc
List<ServerName> candidateList = filterOfflineServers(info, servers); List<ServerName> candidateList = filterOfflineServers(info, servers);
ServerName server = this.internalBalancer.randomAssignment(region, ServerName server = this.internalBalancer.randomAssignment(region,
candidateList); candidateList);
if (server != null && !assignments.containsKey(server)) { if (server != null) {
assignments.put(server, new ArrayList<HRegionInfo>()); if (!assignments.containsKey(server)) {
} else if (server != null) { assignments.put(server, new ArrayList<HRegionInfo>());
}
assignments.get(server).add(region); assignments.get(server).add(region);
} else { } else {
//if not server is available assign to bogus so it ends up in RIT //if not server is available assign to bogus so it ends up in RIT