in modules/command/src/main/java/org/apache/fluo/command/FluoWait.java [93:121]
private static void waitUntilFinished(FluoConfiguration config) {
try (Environment env = new Environment(config)) {
List<TableRange> ranges = getRanges(env);
outer: while (true) {
long ts1 = env.getSharedResources().getOracleClient().getStamp().getTxTimestamp();
for (TableRange range : ranges) {
boolean sawNotifications = waitTillNoNotifications(env, range);
if (sawNotifications) {
ranges = getRanges(env);
// This range had notifications. Processing those notifications may have created
// notifications in previously scanned ranges, so start over.
continue outer;
}
}
long ts2 = env.getSharedResources().getOracleClient().getStamp().getTxTimestamp();
// Check to ensure the Oracle issued no timestamps during the scan for notifications.
if (ts2 - ts1 == 1) {
break;
}
}
} catch (AccumuloSecurityException | AccumuloException e) {
throw new FluoCommandException(String.format("Error getting table ranges: ", e.getMessage()),
e);
} catch (TableNotFoundException e) {
throw new FluoCommandException(String.format("Table %s not found", e.getTableName()), e);
}
}