status.ensureInitial();
// loop so we can start over again if we find a new batch was created.
while (true) {
JoinOutcome outcome = status.getOutcome();
// if the previous outcome was a change in schema or we sent a batch, we have to set up a new batch.
if (outcome == JoinOutcome.SCHEMA_CHANGED) {
allocateBatch(true);
} else if (outcome == JoinOutcome.BATCH_RETURNED) {
allocateBatch(false);