You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/04/06 03:24:08 UTC
[GitHub] [hbase] Reidddddd commented on a change in pull request #1435:
HBASE-24112 [RSGroup] Support renaming rsgroup
Reidddddd commented on a change in pull request #1435: HBASE-24112 [RSGroup] Support renaming rsgroup
URL: https://github.com/apache/hbase/pull/1435#discussion_r403810931
##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java
##########
@@ -1221,4 +1221,33 @@ public String determineRSGroupInfoForTable(TableName tableName) {
return script.getRSGroup(tableName.getNamespaceAsString(), tableName.getQualifierAsString());
}
+ @Override
+ public synchronized void renameRSGroup(String oldName, String newName) throws IOException {
+ if (oldName.equals(RSGroupInfo.DEFAULT_GROUP)) {
+ throw new ConstraintException(RSGroupInfo.DEFAULT_GROUP + " can't be rename");
+ }
+ checkGroupName(newName);
+
+ RSGroupInfo oldRSG = getRSGroupInfo(oldName);
+ Map<String, RSGroupInfo> rsGroupMap = holder.groupName2Group;
+ Map<String, RSGroupInfo> newGroupMap = Maps.newHashMap(rsGroupMap);
+ newGroupMap.remove(oldRSG.getName());
+ RSGroupInfo newRSG = new RSGroupInfo(newName, oldRSG.getServers());
+ newGroupMap.put(newRSG.getName(), newRSG);
Review comment:
fixed
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services