virajjasani commented on a change in pull request #1523: HBASE-24195 : 
Admin.getRegionServers() should return live servers exc…
URL: https://github.com/apache/hbase/pull/1523#discussion_r409414517
 
 

 ##########
 File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java
 ##########
 @@ -864,4 +865,42 @@ public void testSlowLogResponses() throws Exception {
     Assert.assertEquals(onlineLogRecords.size(), 0);
   }
 
+  @Test
+  public void testGetRegionServers() throws Exception {
+    // get all live server names
+    List<ServerName> serverNames = new 
ArrayList<>(ADMIN.getRegionServers(true));
+    Assert.assertEquals(3, serverNames.size());
+
+    List<ServerName> serversToDecom = new ArrayList<>();
+    ServerName serverToDecommission = serverNames.get(0);
+
+    serversToDecom.add(serverToDecommission);
+    ADMIN.decommissionRegionServers(serversToDecom, false);
+    waitForServerDecom(serverToDecommission, true);
+
+    Assert.assertEquals(2, ADMIN.getRegionServers(true).size());
+
+    ADMIN.recommissionRegionServer(serverToDecommission, 
Collections.emptyList());
+
+    Assert.assertEquals(3, ADMIN.getRegionServers(true).size());
+    waitForServerDecom(serverToDecommission, false);
 
 Review comment:
   > Why wait for decommission this server in the end?
   
   Actually, we are waiting for server to be recommissioned (maybe method name 
not correct, last arg determines). Let me change the order. 

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