liuml07 commented on a change in pull request #1435: HBASE-24112 [RSGroup]
Support renaming rsgroup
URL: https://github.com/apache/hbase/pull/1435#discussion_r405278080
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin1.java
##########
@@ -468,4 +468,31 @@ public boolean evaluate() throws Exception {
// Cleanup
TEST_UTIL.deleteTable(tn1);
}
+
+ @Test
+ public void testRenameRSGroup() throws Exception {
+ // Add rsgroup, and assign 2 servers and a table to it.
+ RSGroupInfo oldgroup = addGroup("oldgroup", 2);
+ TableName tb = TableName.valueOf("testRename");
+ TEST_UTIL.createTable(tb, "tr");
+ ADMIN.setRSGroup(Sets.newHashSet(tb), oldgroup.getName());
+ Thread.sleep(500);
+ oldgroup = ADMIN.getRSGroup(oldgroup.getName());
+ assertEquals(2, oldgroup.getServers().size());
+ assertEquals(oldgroup.getName(), ADMIN.getRSGroup(tb).getName());
+
+ // Rename rsgroup
+ ADMIN.renameRSGroup(oldgroup.getName(), "newgroup");
+ Set<Address> servers = oldgroup.getServers();
+ RSGroupInfo newgroup = ADMIN.getRSGroup("newgroup");
+ assertEquals(servers.size(), newgroup.getServers().size());
+ int match = 0;
+ for (Address addr : newgroup.getServers()) {
+ if (servers.contains(addr)) {
+ match++;
+ }
+ }
+ assertEquals(servers.size(), match);
Review comment:
Yes the test now is very comprehensive. Thanks,
----------------------------------------------------------------
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