System.out.printf("Multiple thread scan time %6.2f %n", time2 / 1000.0);
}
private long batchScan(List<Range> ranges, int threads) throws Exception {
BatchScanner bs = getConnector().createBatchScanner("test_ingest", TestIngest.AUTHS, threads);
bs.setRanges(ranges);
int count = 0;
long t1 = System.currentTimeMillis();
byte rval[] = new byte[50];
Random random = new Random();
for (Entry<Key,Value> entry : bs) {
count++;
int row = VerifyIngest.getRow(entry.getKey());
int col = VerifyIngest.getCol(entry.getKey());
if (row < 0 || row >= NUM_TO_INGEST) {
throw new Exception("unexcepted row " + row);
}
rval = TestIngest.genRandomValue(random, rval, 2, row, col);
if (entry.getValue().compareTo(rval) != 0) {
throw new Exception("unexcepted value row=" + row + " col=" + col);
}
}
long t2 = System.currentTimeMillis();
bs.close();
if (count != NUM_TO_INGEST) {
throw new Exception("Batch Scan did not return expected number of values " + count);
}