assertEquals(Arrays.asList("test"), tableList);
}
@Test
public void testLoadTable() throws BlurException, TException, InterruptedException {
Iface client = getClient();
int length = 100;
List<RowMutation> mutations = new ArrayList<RowMutation>();
for (int i = 0; i < length; i++) {
String rowId = UUID.randomUUID().toString();
RecordMutation mutation = BlurThriftHelper.newRecordMutation("test", rowId,
BlurThriftHelper.newColumn("test", "value"));
RowMutation rowMutation = BlurThriftHelper.newRowMutation("test", rowId, mutation);
rowMutation.setWaitToBeVisible(true);
mutations.add(rowMutation);
}
long s = System.nanoTime();
client.mutateBatch(mutations);
long e = System.nanoTime();
System.out.println("mutateBatch took [" + (e - s) / 1000000.0 + "]");
BlurQuery blurQueryRow = new BlurQuery();
Query queryRow = new Query();
queryRow.setQuery("test.test:value");
blurQueryRow.setQuery(queryRow);
blurQueryRow.setUseCacheIfPresent(false);
blurQueryRow.setCacheResult(false);
BlurResults resultsRow = client.query("test", blurQueryRow);
assertRowResults(resultsRow);
assertEquals(length, resultsRow.getTotalResults());
BlurQuery blurQueryRecord = new BlurQuery();
Query queryRecord = new Query();
queryRecord.rowQuery = false;
queryRecord.setQuery("test.test:value");
blurQueryRecord.setQuery(queryRecord);
BlurResults resultsRecord = client.query("test", blurQueryRecord);
assertRecordResults(resultsRecord);
assertEquals(length, resultsRecord.getTotalResults());
Schema schema = client.schema("test");
assertFalse(schema.getFamilies().isEmpty());
}