dtxnHints.basePartition = BASE_PARTITION;
LatchableProcedureCallback dtxnCallback = new LatchableProcedureCallback(1);
this.client.callProcedure(dtxnCallback, this.blockingProc.getName(), dtxnHints, dtxnParams);
// Block until we know that the txn has started running
BlockingSendPayment dtxnVoltProc = HStoreSiteTestUtil.getCurrentVoltProcedure(this.baseExecutor, BlockingSendPayment.class);
assertNotNull(dtxnVoltProc);
boolean result = dtxnVoltProc.NOTIFY_BEFORE.tryAcquire(HStoreSiteTestUtil.NOTIFY_TIMEOUT, TimeUnit.MILLISECONDS);
assertTrue(result);
this.checkCurrentDtxn();
// Fire off a single-partition txn that will not get executed right away
// We have to use the blocking version because there needs to be data in tables first
Object spParams[] = new Object[]{ BASE_PARTITION+1, BASE_PARTITION+1, 1.0 };
StoredProcedureInvocationHints spHints = new StoredProcedureInvocationHints();
spHints.basePartition = BASE_PARTITION+1;
LatchableProcedureCallback spCallback0 = new LatchableProcedureCallback(1);
this.client.callProcedure(spCallback0, this.nonblockingProc.getName(), spHints, spParams);
HStoreSiteTestUtil.checkQueuedTxns(this.remoteExecutor, 1);
// Ok now we're going to release our txn. It will execute a bunch of stuff.
// It should be able to identify that it is finished with the remote partition without
// having to be explicitly told in the code.
dtxnVoltProc.LOCK_BEFORE.release();
result = dtxnVoltProc.NOTIFY_AFTER.tryAcquire(HStoreSiteTestUtil.NOTIFY_TIMEOUT, TimeUnit.MILLISECONDS);
assertTrue(result);
LocalTransaction dtxn = (LocalTransaction)this.baseExecutor.getDebugContext().getCurrentDtxn();
assertEquals(dtxnVoltProc.getTransactionId(), dtxn.getTransactionId());
// EstimatorState t_state = dtxn.getEstimatorState();
// if (t_state instanceof MarkovEstimatorState) {
// LOG.warn("WROTE MARKOVGRAPH: " + ((MarkovEstimatorState)t_state).dumpMarkovGraph());
// }
PartitionSet donePartitions = dtxn.getDonePartitions();