LOG.debug(String.format("Got %s for txn #%d",
request.getClass().getSimpleName(), txn_id));
// The mr_ts handle will be null if this HStoreSite is not where the
// base partition for the original MRTransaction
MapReduceTransaction mr_ts = hstore_site.getTransaction(txn_id);
if (mr_ts == null) {
mr_ts = hstore_site.getTransactionInitializer()
.createMapReduceTransaction(txn_id,
EstTime.currentTimeMillis(),
request.getClientHandle(),
request.getBasePartition(),
request.getProcedureId(),
request.getParams().asReadOnlyByteBuffer());
}
assert(mr_ts.isMapPhase());
mr_ts.initTransactionMapWrapperCallback(callback);
/*
* Here we would like to start MapReduce Transaction on the remote partition except the base partition of it.
* This is to avoid the double invoke for remote task.
* */
for (int partition : hstore_site.getLocalPartitionIds()) {
if (partition != mr_ts.getBasePartition()) {
LocalTransaction ts = mr_ts.getLocalTransaction(partition);
hstore_site.transactionStart(ts);
}
} // FOR
}