Reidddddd commented on a change in pull request #411: HBASE-22739 check bound 
where removeRegion
URL: https://github.com/apache/hbase/pull/411#discussion_r309038210
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
 ##########
 @@ -870,6 +870,9 @@ void regionMoved(int region, int oldServer, int newServer) 
{
         if (regions[i] == regionIndex) {
           break;
         }
+        if (i == regions.length - 1) {
+            return Arrays.copyOf(regions, regions.length);
 
 Review comment:
   Here i think we can just return regions. No need to copy the entire array, 
unless you have a strong reason.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to