diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java index 549265f0ba7..8bb2b1104c7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java @@ -159,22 +159,12 @@ public class RegionStates { Map> map = new HashMap>(); for (HRegionInfo region : regions) { HRegionInfo defaultReplica = RegionReplicaUtil.getRegionInfoForDefaultReplica(region); - ServerName server = regionAssignments.get(defaultReplica); - List regionsOnServer; - if (server != null) { - regionsOnServer = map.get(server); - if (regionsOnServer == null) { - regionsOnServer = new ArrayList(1); - map.put(server, regionsOnServer); - } - regionsOnServer.add(defaultReplica); - } Set allReplicas = defaultReplicaToOtherReplicas.get(defaultReplica); if (allReplicas != null) { for (HRegionInfo hri : allReplicas) { - server = regionAssignments.get(hri); + ServerName server = regionAssignments.get(hri); if (server != null) { - regionsOnServer = map.get(server); + List regionsOnServer = map.get(server); if (regionsOnServer == null) { regionsOnServer = new ArrayList(1); map.put(server, regionsOnServer);