sunhelly commented on a change in pull request #323: HBASE-22414 Interruption 
of moving regions in RSGroup will cause regi…
URL: https://github.com/apache/hbase/pull/323#discussion_r297953890
 
 

 ##########
 File path: 
hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java
 ##########
 @@ -193,76 +198,104 @@ private void checkServersAndTables(Set<Address> 
servers, Set<TableName> tables,
     }
   }
 
+  private enum MoveType {
+    TO, FROM
+  }
+
   /**
-   * Move every region from servers which are currently located on these 
servers,
-   * but should not be located there.
+   * When move a table to a group, all regions of it must be moved to group 
servers (to the group).
+   * When move a server to a group, some regions on it which are of tables 
that do not belong to
+   * the target group must be moved (from the group).
+   * So MoveType.TO means TableName set, and MoveType.FROM means server 
Address set.
    *
-   * @param servers the servers that will move to new group
-   * @param targetGroupName the target group name
-   * @throws IOException if moving the server and tables fail
+   * @param set it's a table set or a server set
+   * @param targetGroupName target group name
+   * @param type type of move regions
+   * @param <T> the type of elements in Set
+   * @throws IOException if move haven't succeed even after max number of 
retries
    */
-  private void moveServerRegionsFromGroup(Set<Address> servers, String 
targetGroupName)
+  private <T> void moveRegionsToOrFromGroup(Set<T> set, String 
targetGroupName, MoveType type)
       throws IOException {
 
 Review comment:
   I think added To/From to method name makes codes more easy to be understood. 
   And just like writing in the docs, TO means move tables regions, FROM means 
move server regions.

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