clarax commented on a change in pull request #3575:
URL: https://github.com/apache/hbase/pull/3575#discussion_r686547635
##########
File path:
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/BalancerClusterState.java
##########
@@ -572,26 +550,22 @@ public void doAction(BalanceAction action) {
// FindBugs: Having the assert quietens FB BC_UNCONFIRMED_CAST warnings
assert action instanceof AssignRegionAction : action.getClass();
AssignRegionAction ar = (AssignRegionAction) action;
- regionsPerServer[ar.getServer()] =
- addRegion(regionsPerServer[ar.getServer()], ar.getRegion());
+ regionsPerServer.get(ar.getServer()).add(ar.getRegion());
Review comment:
O(n)->O(1) for adding an element. The old method needs an array copy.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]