in src/main/java/org/apache/accumulo/testing/randomwalk/concurrent/IsolatedScan.java [43:70]
public void visit(State state, RandWalkEnv env, Properties props) throws Exception {
AccumuloClient client = env.getAccumuloClient();
String tableName = state.getRandomTableName();
try {
RowIterator iter = new RowIterator(
new IsolatedScanner(client.createScanner(tableName, Authorizations.EMPTY)));
while (iter.hasNext()) {
PeekingIterator<Entry<Key,Value>> row = Iterators.peekingIterator(iter.next());
Entry<Key,Value> kv = null;
if (row.hasNext())
kv = row.peek();
while (row.hasNext()) {
Entry<Key,Value> currentKV = row.next();
if (!kv.getValue().equals(currentKV.getValue()))
throw new Exception("values not equal " + kv + " " + currentKV);
}
}
log.debug("Isolated scan " + tableName);
} catch (TableDeletedException e) {
log.debug("Isolated scan " + tableName + " failed, table deleted");
} catch (TableNotFoundException e) {
log.debug("Isolated scan " + tableName + " failed, doesnt exist");
} catch (TableOfflineException e) {
log.debug("Isolated scan " + tableName + " failed, offline");
}
}