dbg.setConflictChecker(remoteChecker);
} // FOR
// Fire off a distributed a txn that will block.
Object dtxnParams[] = new Object[]{ BASE_PARTITION, BASE_PARTITION+1, 1.0 };
StoredProcedureInvocationHints dtxnHints = new StoredProcedureInvocationHints();
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();
// Let the dtxn execute some queries that modify the remote partition
dtxnVoltProc.LOCK_BEFORE.release();
result = dtxnVoltProc.NOTIFY_AFTER.tryAcquire(HStoreSiteTestUtil.NOTIFY_TIMEOUT, TimeUnit.MILLISECONDS);
assertTrue(result);
// Fire off a single-partition txn that will get executed right away but
// have its ClientResponse held until it learns whether the dtxn
// will commit successfully
Procedure spProc = this.getProcedure(DepositChecking.class);
Object spParams[] = new Object[]{ remotePartition, 1.0 };
StoredProcedureInvocationHints spHints = new StoredProcedureInvocationHints();
spHints.basePartition = remotePartition;
LatchableProcedureCallback spCallback0 = new LatchableProcedureCallback(1);
this.client.callProcedure(spCallback0, spProc.getName(), spHints, spParams);
HStoreSiteTestUtil.checkBlockedSpeculativeTxns(remoteExecutor, 1);