From a414361ed969dabece4aa0367362500e5e46352b Mon Sep 17 00:00:00 2001 From: mokai Date: Wed, 6 Jan 2021 22:27:58 +0800 Subject: [PATCH] HBASE-24755 [LOG][RSGroup]Error message is confusing while adding a offline RS to rsgroup (#2846) Signed-off-by: Viraj Jasani Signed-off-by: Wellington Chevreuil --- .../apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java | 6 +++--- .../org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin2.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java index 9850917e795..3ef9365456f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java @@ -1233,9 +1233,9 @@ final class RSGroupInfoManagerImpl implements RSGroupInfoManager { Address firstServer = servers.iterator().next(); RSGroupInfo srcGrp = 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 TestRSGroupAdmin2... + 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 diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin2.java index 983414236c3..f31e80fa7ee 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin2.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin2.java @@ -189,7 +189,7 @@ public class TestRSGroupsAdmin2 extends TestRSGroupsBase { ADMIN.moveServersToRSGroup(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)); } @@ -337,7 +337,7 @@ public class TestRSGroupsAdmin2 extends TestRSGroupsBase { ADMIN.setRSGroup(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)); }