You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by vj...@apache.org on 2021/01/06 14:32:24 UTC

[hbase] branch branch-2.3 updated: HBASE-24755 [LOG][RSGroup]Error message is confusing while adding a offline RS to rsgroup (#2847) (#2846)

This is an automated email from the ASF dual-hosted git repository.

vjasani pushed a commit to branch branch-2.3
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.3 by this push:
     new 52f9245  HBASE-24755 [LOG][RSGroup]Error message is confusing while adding a offline RS to rsgroup (#2847) (#2846)
52f9245 is described below

commit 52f9245c07698a035e867db7b68b60e2f37410de
Author: mokai <mo...@126.com>
AuthorDate: Wed Jan 6 22:28:47 2021 +0800

    HBASE-24755 [LOG][RSGroup]Error message is confusing while adding a offline RS to rsgroup (#2847) (#2846)
    
    Signed-off-by: Viraj Jasani <vj...@apache.org>
    Signed-off-by: Wellington Chevreuil <wc...@apache.org>
---
 .../org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java  | 12 ++++++------
 .../org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin2.java  |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java
index a6ee3ae..dba17cc 100644
--- a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java
+++ b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java
@@ -160,9 +160,9 @@ public class RSGroupAdminServer implements RSGroupAdmin {
     Address firstServer = servers.iterator().next();
     RSGroupInfo tmpSrcGrp = rsGroupInfoManager.getRSGroupOfServer(firstServer);
     if (tmpSrcGrp == null) {
-      // Be careful. This exception message is tested for in TestRSGroupsBase...
-      throw new ConstraintException("Source RSGroup for server " + firstServer
-              + " does not exist.");
+      // Be careful. This exception message is tested for in TestRSGroupsAdmin2...
+      throw new ConstraintException("Server " + firstServer
+        + " is either offline or it does not exist.");
     }
     RSGroupInfo srcGrp = new RSGroupInfo(tmpSrcGrp);
 
@@ -324,9 +324,9 @@ public class RSGroupAdminServer implements RSGroupAdmin {
       Address firstServer = servers.iterator().next();
       RSGroupInfo srcGrp = rsGroupInfoManager.getRSGroupOfServer(firstServer);
       if (srcGrp == null) {
-        // Be careful. This exception message is tested for in TestRSGroupsBase...
-        throw new ConstraintException("Source RSGroup for server " + firstServer
-            + " does not exist.");
+        // Be careful. This exception message is tested for in TestRSGroupsAdmin2...
+        throw new ConstraintException("Server " + firstServer
+          + " is either offline or it does not exist.");
       }
       // Only move online servers (when moving from 'default') or servers from other
       // groups. This prevents bogus servers from entering groups
diff --git a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin2.java b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin2.java
index 1ddb36f..7151363 100644
--- a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin2.java
+++ b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin2.java
@@ -185,7 +185,7 @@ public class TestRSGroupsAdmin2 extends TestRSGroupsBase {
       rsGroupAdmin.moveServers(Sets.newHashSet(Address.fromString("foo:9999")), "foo");
       fail("Bogus servers shouldn't have been successfully moved.");
     } catch (IOException ex) {
-      String exp = "Source RSGroup for server foo:9999 does not exist.";
+      String exp = "Server foo:9999 is either offline or it does not exist.";
       String msg = "Expected '" + exp + "' in exception message: ";
       assertTrue(msg + " " + ex.getMessage(), ex.getMessage().contains(exp));
     }
@@ -333,7 +333,7 @@ public class TestRSGroupsAdmin2 extends TestRSGroupsBase {
         Sets.newHashSet(tableName), newGroup.getName());
       fail("Bogus servers shouldn't have been successfully moved.");
     } catch (IOException ex) {
-      String exp = "Source RSGroup for server foo:9999 does not exist.";
+      String exp = "Server foo:9999 is either offline or it does not exist.";
       String msg = "Expected '" + exp + "' in exception message: ";
       assertTrue(msg + " " + ex.getMessage(), ex.getMessage().contains(exp));
     }