HBASE-24755 [LOG][RSGroup]Error message is confusing while adding a offline RS to rsgroup (#2847) (#2846)
Signed-off-by: Viraj Jasani <vjasani@apache.org> Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
This commit is contained in:
parent
3f2b9b37a7
commit
0a4685b085
|
@ -159,9 +159,9 @@ public class RSGroupAdminServer implements RSGroupAdmin {
|
||||||
Address firstServer = servers.iterator().next();
|
Address firstServer = servers.iterator().next();
|
||||||
RSGroupInfo tmpSrcGrp = rsGroupInfoManager.getRSGroupOfServer(firstServer);
|
RSGroupInfo tmpSrcGrp = rsGroupInfoManager.getRSGroupOfServer(firstServer);
|
||||||
if (tmpSrcGrp == null) {
|
if (tmpSrcGrp == null) {
|
||||||
// Be careful. This exception message is tested for in TestRSGroupsBase...
|
// Be careful. This exception message is tested for in TestRSGroupsAdmin2...
|
||||||
throw new ConstraintException("Source RSGroup for server " + firstServer
|
throw new ConstraintException("Server " + firstServer
|
||||||
+ " does not exist.");
|
+ " is either offline or it does not exist.");
|
||||||
}
|
}
|
||||||
RSGroupInfo srcGrp = new RSGroupInfo(tmpSrcGrp);
|
RSGroupInfo srcGrp = new RSGroupInfo(tmpSrcGrp);
|
||||||
|
|
||||||
|
@ -397,9 +397,9 @@ public class RSGroupAdminServer implements RSGroupAdmin {
|
||||||
Address firstServer = servers.iterator().next();
|
Address firstServer = servers.iterator().next();
|
||||||
RSGroupInfo srcGrp = rsGroupInfoManager.getRSGroupOfServer(firstServer);
|
RSGroupInfo srcGrp = rsGroupInfoManager.getRSGroupOfServer(firstServer);
|
||||||
if (srcGrp == null) {
|
if (srcGrp == null) {
|
||||||
// Be careful. This exception message is tested for in TestRSGroupsBase...
|
// Be careful. This exception message is tested for in TestRSGroupsAdmin2...
|
||||||
throw new ConstraintException("Source RSGroup for server " + firstServer
|
throw new ConstraintException("Server " + firstServer
|
||||||
+ " does not exist.");
|
+ " is either offline or it does not exist.");
|
||||||
}
|
}
|
||||||
// Only move online servers (when moving from 'default') or servers from other
|
// Only move online servers (when moving from 'default') or servers from other
|
||||||
// groups. This prevents bogus servers from entering groups
|
// groups. This prevents bogus servers from entering groups
|
||||||
|
|
|
@ -185,7 +185,7 @@ public class TestRSGroupsAdmin2 extends TestRSGroupsBase {
|
||||||
rsGroupAdmin.moveServers(Sets.newHashSet(Address.fromString("foo:9999")), "foo");
|
rsGroupAdmin.moveServers(Sets.newHashSet(Address.fromString("foo:9999")), "foo");
|
||||||
fail("Bogus servers shouldn't have been successfully moved.");
|
fail("Bogus servers shouldn't have been successfully moved.");
|
||||||
} catch (IOException ex) {
|
} 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: ";
|
String msg = "Expected '" + exp + "' in exception message: ";
|
||||||
assertTrue(msg + " " + ex.getMessage(), ex.getMessage().contains(exp));
|
assertTrue(msg + " " + ex.getMessage(), ex.getMessage().contains(exp));
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@ public class TestRSGroupsAdmin2 extends TestRSGroupsBase {
|
||||||
Sets.newHashSet(tableName), newGroup.getName());
|
Sets.newHashSet(tableName), newGroup.getName());
|
||||||
fail("Bogus servers shouldn't have been successfully moved.");
|
fail("Bogus servers shouldn't have been successfully moved.");
|
||||||
} catch (IOException ex) {
|
} 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: ";
|
String msg = "Expected '" + exp + "' in exception message: ";
|
||||||
assertTrue(msg + " " + ex.getMessage(), ex.getMessage().contains(exp));
|
assertTrue(msg + " " + ex.getMessage(), ex.getMessage().contains(exp));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue