@Test
public void localityGroupChange() throws Exception {
// Make changes to locality groups and ensure nothing is lostssh
final Connector connector = getConnector();
TableOperations to = connector.tableOperations();
to.create("test_ingest");
String[] config = new String[] {"lg1:colf", null, "lg1:colf,xyz", "lg1:colf,xyz;lg2:c1,c2"};
int i = 0;
for (String cfg : config) {
to.setLocalityGroups("test_ingest", getGroups(cfg));
ingest(connector, ROWS * (i + 1), 1, 50, ROWS * i);
to.flush("test_ingest", null, null, true);
verify(connector, 0, 1, 50, ROWS * (i + 1));
i++;
}
to.delete("test_ingest");
to.create("test_ingest");
config = new String[] {"lg1:colf", null, "lg1:colf,xyz", "lg1:colf;lg2:colf",};
i = 1;
for (String cfg : config) {
ingest(connector, ROWS * i, 1, 50, 0);
ingest(connector, ROWS * i, 1, 50, 0, "xyz");
to.setLocalityGroups("test_ingest", getGroups(cfg));
to.flush("test_ingest", null, null, true);
verify(connector, ROWS * i, 1, 50, 0);
verify(connector, ROWS * i, 1, 50, 0, "xyz");
i++;
}
}