use of org.voltdb.StoredProcedureInvocation in project voltdb by VoltDB.
the class MpReplayMessage method initFromBuffer.
@Override
protected void initFromBuffer(ByteBuffer buf) throws IOException {
m_txnId = buf.getLong();
m_uniqueId = buf.getLong();
m_partitionId = buf.getInt();
int partitionCount = buf.getInt();
m_involvedPartitions = Sets.newHashSet();
for (int i = 0; i < partitionCount; i++) {
m_involvedPartitions.add(buf.getInt());
}
if (buf.remaining() > 0) {
m_invocation = new StoredProcedureInvocation();
m_invocation.initFromBuffer(buf);
} else {
m_invocation = null;
}
}
use of org.voltdb.StoredProcedureInvocation in project voltdb by VoltDB.
the class TestSpSchedulerDedupe method createMsg.
private Iv2InitiateTaskMessage createMsg(long txnId, boolean readOnly, boolean singlePart, long destHSId) {
// Mock an invocation for MockSPName.
StoredProcedureInvocation spi = mock(StoredProcedureInvocation.class);
when(spi.getProcName()).thenReturn(MockSPName);
ParameterSet bleh = mock(ParameterSet.class);
when(spi.getParams()).thenReturn(bleh);
Iv2InitiateTaskMessage task = new // initHSID
Iv2InitiateTaskMessage(// initHSID
destHSId, // coordHSID
Long.MIN_VALUE, // truncationHandle
txnId - 1, // txnId
txnId, // uniqueID
UniqueIdGenerator.makeIdFromComponents(System.currentTimeMillis(), 0, 0), // readonly
readOnly, // single-part
singlePart, // invocation
spi, // client interface handle
Long.MAX_VALUE, // connectionId
Long.MAX_VALUE, // isForReplay
false);
// sp: sphandle == txnid
task.setTxnId(txnId);
task.setSpHandle(txnId);
return task;
}
use of org.voltdb.StoredProcedureInvocation in project voltdb by VoltDB.
the class TestReplaySequencer method makeIv2InitTask.
TransactionInfoBaseMessage makeIv2InitTask(long unused, String procName) {
Iv2InitiateTaskMessage m = mock(Iv2InitiateTaskMessage.class);
StoredProcedureInvocation invocation = mock(StoredProcedureInvocation.class);
when(invocation.getProcName()).thenReturn(procName);
when(m.getStoredProcedureInvocation()).thenReturn(invocation);
when(m.isForReplay()).thenReturn(true);
return m;
}
use of org.voltdb.StoredProcedureInvocation in project voltdb by VoltDB.
the class CompleteTransactionTask method logToDR.
private void logToDR(PartitionDRGateway drGateway) {
// Log invocation to DR
if (drGateway != null && !m_txnState.isForReplay() && !m_txnState.isReadOnly() && !m_completeMsg.isRollback()) {
FragmentTaskMessage fragment = (FragmentTaskMessage) m_txnState.getNotice();
Iv2InitiateTaskMessage initiateTask = fragment.getInitiateTask();
assert (initiateTask != null);
if (initiateTask == null) {
hostLog.error("Unable to log MP transaction to DR because of missing InitiateTaskMessage, " + "fragment: " + fragment.toString());
}
StoredProcedureInvocation invocation = initiateTask.getStoredProcedureInvocation().getShallowCopy();
drGateway.onSuccessfulMPCall(m_txnState.m_spHandle, m_txnState.txnId, m_txnState.uniqueId, m_completeMsg.getHash(), invocation, m_txnState.getResults());
}
}
use of org.voltdb.StoredProcedureInvocation in project voltdb by VoltDB.
the class Dr2MultipartTaskMessage method initFromBuffer.
@Override
protected void initFromBuffer(ByteBuffer buf) throws IOException {
m_producerPID = buf.getInt();
m_drain = buf.get() == 1;
m_producerClusterId = buf.get();
m_producerPartitionCnt = buf.getShort();
m_lastExecutedMPUniqueID = buf.getLong();
if (buf.remaining() > 0) {
m_invocation = new StoredProcedureInvocation();
m_invocation.initFromBuffer(buf);
} else {
m_invocation = null;
}
}
Aggregations