assertEquals(AbstractTransaction.RoundState.STARTED, this.ts.getCurrentRoundState(LOCAL_PARTITION));
// We want to add results for just one of the duplicated statements and make sure that
// we only unblock one of them. First we need to find an internal dependency that has blocked tasks
Integer internal_d_id = null;
DependencyInfo internal_dinfo = null;
for (Integer d_id : this.internal_dependency_ids) {
internal_d_id = d_id;
internal_dinfo = this.depTrackerDbg.getDependencyInfo(this.ts, d_id);
if (internal_dinfo != null) break;
} // FOR
assertNotNull(internal_d_id);
assertNotNull(internal_dinfo);
// Now shove a fake result for each partition at the TransactionState object. This should
// cause the blocked FragmentTaskMessage to get moved into the "ready" queue
for (int partition = 0; partition < NUM_PARTITIONS; partition++) {
assertFalse(internal_dinfo.hasTasksReady());
// If this is the first partition, then add one for each of the duplicate Statements
// We want to make sure that they don't unblock
for (int stmt_index = 0; stmt_index < NUM_DUPLICATE_STATEMENTS; stmt_index++) {
if (partition != LOCAL_PARTITION && stmt_index > 0) break;
int dependency_id = this.internal_dependency_ids.get(stmt_index);
LOG.debug("Adding result for [partition=" + partition + ", dependency_id=" + dependency_id + ", stmt_index=" + stmt_index + "]");
this.depTracker.addResult(this.ts, partition, dependency_id, FAKE_RESULT);
} // FOR
} // FOR
if (NUM_PARTITIONS != internal_dinfo.getResults().size()) {
LOG.info(this.ts);
LOG.info("----------------------------------");
LOG.info(internal_dinfo);
}
assertEquals(internal_dinfo.getResults().toString(), NUM_PARTITIONS, internal_dinfo.getResults().size());
assert(internal_dinfo.hasTasksReleased());
// Make sure that all other Statements didn't accidently unblock their FragmentTaskMessages...
for (int stmt_index = 1; stmt_index < NUM_DUPLICATE_STATEMENTS; stmt_index++) {
int dep_id = this.internal_dependency_ids.get(stmt_index);
DependencyInfo other = this.depTrackerDbg.getDependencyInfo(this.ts, dep_id);
assertNotNull(other);
assertFalse(other.hasTasksReady());
assertFalse(other.hasTasksReleased());
assertEquals(1, other.getResults().size());
} // FOR
// System.err.println(this.ts);
}