infraio commented on a change in pull request #1279: HBASE-23949 refactor 
loadBalancer implements for rsgroup balance by t…
URL: https://github.com/apache/hbase/pull/1279#discussion_r392781215
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupBasedLoadBalancer.java
 ##########
 @@ -427,4 +421,19 @@ public void postMasterStartupInitialize() {
   public void updateBalancerStatus(boolean status) {
     internalBalancer.updateBalancerStatus(status);
   }
+
+  /**
+   * can achieve table balanced rather than overall balanced
+   */
+  @Override
+  public List<RegionPlan> balanceTable(TableName tableName,
+      Map<ServerName, List<RegionInfo>> clusterLoad) {
+    Map<TableName, Map<ServerName, List<RegionInfo>>> clusterLoadThisTable = 
new HashMap<>();
+    clusterLoadThisTable.put(tableName, clusterLoad);
+    try {
+      return balanceCluster(clusterLoadThisTable);
 
 Review comment:
   It is wired to call balanceClsuter here. Maybe abstract a new method 
balanceTableInRSGroup. And balanceTable and balanceClsuter both call the new 
method.

----------------------------------------------------------------
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