@Override public void moveServersAndTables(Set<Address> servers, Set<TableName> tables, String targetGroup) throws IOException { wrapped.moveServersAndTables(servers, tables, targetGroup); verify(); }
rsGroupAdmin.moveServersAndTables(Sets.newHashSet(Address.fromString("foo:9999")), Sets.newHashSet(tableName), newGroup.getName()); fail("Bogus servers shouldn't have been successfully moved."); rsGroupAdmin.moveServersAndTables(Sets.newHashSet(targetServer.getAddress()), Sets.newHashSet(tableName), RSGroupInfo.DEFAULT_GROUP); fail("servers shouldn't have been successfully moved."); rsGroupAdmin.moveServersAndTables(Sets.newHashSet(targetServer.getAddress()), Sets.newHashSet(tableName), newGroup.getName());
@Test public void testNonExistentTableMove() throws Exception { TableName tableName = TableName.valueOf(tablePrefix + name.getMethodName()); RSGroupInfo tableGrp = rsGroupAdmin.getRSGroupInfoOfTable(tableName); assertNull(tableGrp); // test if table exists already. boolean exist = admin.tableExists(tableName); assertFalse(exist); LOG.info("Moving table " + tableName + " to " + RSGroupInfo.DEFAULT_GROUP); try { rsGroupAdmin.moveTables(Sets.newHashSet(tableName), RSGroupInfo.DEFAULT_GROUP); fail("Table " + tableName + " shouldn't have been successfully moved."); } catch (IOException ex) { assertTrue(ex instanceof TableNotFoundException); } try { rsGroupAdmin.moveServersAndTables(Sets.newHashSet(Address.fromParts("bogus", 123)), Sets.newHashSet(tableName), RSGroupInfo.DEFAULT_GROUP); fail("Table " + tableName + " shouldn't have been successfully moved."); } catch (IOException ex) { assertTrue(ex instanceof TableNotFoundException); } // verify group change assertNull(rsGroupAdmin.getRSGroupInfoOfTable(tableName)); }
@Override public void moveServersAndTables(Set<Address> servers, Set<TableName> tables, String targetGroup) throws IOException { wrapped.moveServersAndTables(servers, tables, targetGroup); verify(); }
rsGroupAdmin.moveServersAndTables(Sets.newHashSet(Address.fromString("foo:9999")), Sets.newHashSet(tableName), newGroup.getName()); fail("Bogus servers shouldn't have been successfully moved."); rsGroupAdmin.moveServersAndTables(Sets.newHashSet(targetServer.getAddress()), Sets.newHashSet(tableName), RSGroupInfo.DEFAULT_GROUP); fail("servers shouldn't have been successfully moved."); rsGroupAdmin.moveServersAndTables(Sets.newHashSet(targetServer.getAddress()), Sets.newHashSet(tableName), newGroup.getName());