clarax commented on a change in pull request #3575: URL: https://github.com/apache/hbase/pull/3575#discussion_r686549081
########## File path: hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/BalancerClusterState.java ########## @@ -699,102 +684,57 @@ void regionMoved(int region, int oldServer, int newServer) { // update for servers int primary = regionIndexToPrimaryIndex[region]; if (oldServer >= 0) { - primariesOfRegionsPerServer[oldServer] = - removeRegion(primariesOfRegionsPerServer[oldServer], primary); + removeElement(primariesOfRegionsPerServer.get(oldServer), primary, region); Review comment: O(n)->O(1) for removing an element by its value. Please notice in the hash map the key is the value of the element of the old int[]. -- 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