gc.confirmDeletes(candidates);
Assert.assertEquals(expected, candidates.size());
}
private void load(Instance instance, String[] metadata, String[] deletes) throws Exception {
TCredentials credential = CredentialHelper.create("root", new PasswordToken(new byte[0]), "instance");
Scanner scanner = instance.getConnector(credential.getPrincipal(), CredentialHelper.extractToken(credential)).createScanner(Constants.METADATA_TABLE_NAME,
Constants.NO_AUTHS);
int count = 0;
for (@SuppressWarnings("unused")
Entry<Key,Value> entry : scanner) {
count++;
}
// ensure there is no data from previous test
Assert.assertEquals(0, count);
Connector conn = instance.getConnector(credential.getPrincipal(), CredentialHelper.extractToken(credential));
BatchWriter bw = conn.createBatchWriter(Constants.METADATA_TABLE_NAME, new BatchWriterConfig());
for (String line : metadata) {
String[] parts = line.split(" ");
String[] columnParts = parts[1].split(":");
Mutation m = new Mutation(parts[0]);