Skip to content

Commit

Permalink
HBASE-24755 [LOG][RSGroup]Error message is confusing while adding a o…
Browse files Browse the repository at this point in the history
…ffline RS to rsgroup (apache#2847) (apache#2846)

Signed-off-by: Viraj Jasani <vjasani@apache.org>
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
  • Loading branch information
mokai87 authored and virajjasani committed Jan 6, 2021
1 parent 20a9bad commit 821f422
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ private void checkServersAndTables(Set<Address> servers, Set<TableName> tables,
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);
if (srcGrp.getName().equals(targetGroupName)) {
Expand Down Expand Up @@ -292,9 +292,9 @@ public void moveServers(Set<Address> servers, String targetGroupName) throws IOE
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.");
}
if (srcGrp.getName().equals(targetGroupName)) {
throw new ConstraintException("Target RSGroup " + targetGroupName +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void testMoveServers() throws Exception {
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));
}
Expand Down Expand Up @@ -329,7 +329,7 @@ public boolean evaluate() throws Exception {
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));
}
Expand Down

0 comments on commit 821f422

Please sign in to comment.