@Override public void addRSGroup(String groupName) throws IOException { wrapped.addRSGroup(groupName); verify(); }
@Test public void testValidGroupNames() throws IOException { String[] badNames = { "foo*", "foo@", "-" }; String[] goodNames = { "foo_123" }; for (String entry : badNames) { try { rsGroupAdmin.addRSGroup(entry); fail("Expected a constraint exception for: " + entry); } catch (ConstraintException ex) { // expected } } for (String entry : goodNames) { rsGroupAdmin.addRSGroup(entry); } }
public RSGroupInfo addGroup(String groupName, int serverCount) throws IOException, InterruptedException { RSGroupInfo defaultInfo = rsGroupAdmin.getRSGroupInfo(RSGroupInfo.DEFAULT_GROUP); rsGroupAdmin.addRSGroup(groupName); Set<Address> set = new HashSet<>(); for(Address server: defaultInfo.getServers()) { if(set.size() == serverCount) { break; } set.add(server); } rsGroupAdmin.moveServers(set, groupName); RSGroupInfo result = rsGroupAdmin.getRSGroupInfo(groupName); return result; }
rsGroupAdmin.addRSGroup("master"); ServerName masterServerName = ((MiniHBaseCluster)cluster).getMaster().getServerName();
@Test public void testMoveServersFromDefaultGroup() throws Exception { rsGroupAdmin.addRSGroup("foo");
rsGroupAdmin.addRSGroup("foo");
String groupName = tablePrefix + "_foo"; LOG.info("testNamespaceConstraint"); rsGroupAdmin.addRSGroup(groupName); assertTrue(observer.preAddRSGroupCalled); assertTrue(observer.postAddRSGroupCalled); .addConfiguration(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP, groupName).build()); String anotherGroup = tablePrefix + "_anotherGroup"; rsGroupAdmin.addRSGroup(anotherGroup);
String newGroup = "my_group"; RSGroupAdmin groupAdmin = new RSGroupAdminClient(TEST_UTIL.getConnection()); groupAdmin.addRSGroup(newGroup); if (master.getAssignmentManager().getRegionStates().getRegionAssignments() .containsValue(failoverRS.getServerName())) {
@Override public void addRSGroup(String groupName) throws IOException { wrapped.addRSGroup(groupName); verify(); }
@Test public void testValidGroupNames() throws IOException { String[] badNames = {"foo*","foo@","-"}; String[] goodNames = {"foo_123"}; for(String entry: badNames) { try { rsGroupAdmin.addRSGroup(entry); fail("Expected a constraint exception for: "+entry); } catch(ConstraintException ex) { //expected } } for(String entry: goodNames) { rsGroupAdmin.addRSGroup(entry); } }
protected RSGroupInfo addGroup(String groupName, int serverCount) throws IOException, InterruptedException { RSGroupInfo defaultInfo = rsGroupAdmin.getRSGroupInfo(RSGroupInfo.DEFAULT_GROUP); assertTrue(defaultInfo != null); assertTrue(defaultInfo.getServers().size() >= serverCount); rsGroupAdmin.addRSGroup(groupName); Set<Address> set = new HashSet<>(); for(Address server: defaultInfo.getServers()) { if(set.size() == serverCount) { break; } set.add(server); } rsGroupAdmin.moveServers(set, groupName); RSGroupInfo result = rsGroupAdmin.getRSGroupInfo(groupName); assertTrue(result.getServers().size() >= serverCount); return result; }
@Test public void testMoveServersFromDefaultGroup() throws Exception { rsGroupAdmin.addRSGroup("foo");
rsGroupAdmin.addRSGroup("master"); ServerName masterServerName = ((MiniHBaseCluster)cluster).getMaster().getServerName();
rsGroupAdmin.addRSGroup("foo");
String groupName = tablePrefix+"_foo"; LOG.info("testNamespaceConstraint"); rsGroupAdmin.addRSGroup(groupName); assertTrue(observer.preAddRSGroupCalled); assertTrue(observer.postAddRSGroupCalled); .build()); String anotherGroup = tablePrefix+"_anotherGroup"; rsGroupAdmin.addRSGroup(anotherGroup);
String newGroup = "my_group"; RSGroupAdmin groupAdmin = new RSGroupAdminClient(TEST_UTIL.getConnection()); groupAdmin.addRSGroup(newGroup); if(master.getAssignmentManager().getRegionStates().getRegionAssignments() .containsValue(failoverRS.getServerName())) {