pankaj72981 commented on a change in pull request #2883: URL: https://github.com/apache/hbase/pull/2883#discussion_r575984981
########## File path: hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java ########## @@ -718,4 +729,49 @@ private void checkForDeadOrOnlineServers(Set<Address> servers) throws Constraint } } } + + private void moveOrModifyTables(Set<TableName> tables, RSGroupInfo targetGroup) + throws IOException { + Set<TableName> tablesToBeMoved = new HashSet<>(tables.size()); + Set<TableDescriptor> tablesToBeModified = new HashSet<>(tables.size()); + for (TableName tableName : tables) { + TableDescriptor descriptor = master.getTableDescriptors().get(tableName); + if (descriptor == null) { + LOG.error("TableDescriptor of table {} not found. " + + "Skipping the region movement of this table."); + continue; + } + if (descriptor.getRegionServerGroup().isPresent()) { + tablesToBeModified.add(descriptor); + } else { + tablesToBeMoved.add(tableName); + } + } + if (!tablesToBeMoved.isEmpty()) { + moveTableRegionsToGroup(tablesToBeMoved, targetGroup); Review comment: moveTableRegionsToGroup is SYNC, modifyTables has to wait until all regions are moved to desired group successfully in moveTableRegionsToGroup. So it will impact the overall performance of move table/server rsgroup operation. https://github.com/apache/hbase/blob/2e31d1d46efa9f04b5d6e8b359bbe7abd9deacc8/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java#L359 ---------------------------------------------------------------- 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: us...@infra.apache.org