clarax commented on a change in pull request #3575:
URL: https://github.com/apache/hbase/pull/3575#discussion_r689754575



##########
File path: 
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/BalancerClusterState.java
##########
@@ -207,15 +212,20 @@ public String getRack(ServerName server) {
 
     serverIndexToHostIndex = new int[numServers];
     serverIndexToRackIndex = new int[numServers];
-    regionsPerServer = new int[numServers][];
-    serverIndexToRegionsOffset = new int[numServers];
-    regionsPerHost = new int[numHosts][];
-    regionsPerRack = new int[numRacks][];
-    primariesOfRegionsPerServer = new int[numServers][];
-    primariesOfRegionsPerHost = new int[numHosts][];
-    primariesOfRegionsPerRack = new int[numRacks][];
+    regionsPerServer = new ArrayList<ArrayList<Integer>>(numServers);

Review comment:
       This is a two dimensional collection. The same as regionsPerHost and 
regionPerRack which are changed from int[][] to ArrayList<HashSet<Integer>> for 
lookup/insert and delete by value. There are methods that take all three as 
input. The best I can do is to make all three as array of collections(HashSet 
or int[]). The biggest concerns I have is to mix generic and primitives and 
arrays which is generally not recommended. Let me test the perf difference and 
report back if it is worth it. Thank you.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to