Search in sources :

Example 1 with StoredProcedureInvocation

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;
    }
}
Also used : StoredProcedureInvocation(org.voltdb.StoredProcedureInvocation)

Example 2 with StoredProcedureInvocation

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;
}
Also used : ParameterSet(org.voltdb.ParameterSet) StoredProcedureInvocation(org.voltdb.StoredProcedureInvocation) Iv2InitiateTaskMessage(org.voltdb.messaging.Iv2InitiateTaskMessage)

Example 3 with StoredProcedureInvocation

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;
}
Also used : StoredProcedureInvocation(org.voltdb.StoredProcedureInvocation) Iv2InitiateTaskMessage(org.voltdb.messaging.Iv2InitiateTaskMessage)

Example 4 with StoredProcedureInvocation

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());
    }
}
Also used : StoredProcedureInvocation(org.voltdb.StoredProcedureInvocation) FragmentTaskMessage(org.voltdb.messaging.FragmentTaskMessage) Iv2InitiateTaskMessage(org.voltdb.messaging.Iv2InitiateTaskMessage)

Example 5 with StoredProcedureInvocation

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;
    }
}
Also used : StoredProcedureInvocation(org.voltdb.StoredProcedureInvocation)

Aggregations

StoredProcedureInvocation (org.voltdb.StoredProcedureInvocation)28 Iv2InitiateTaskMessage (org.voltdb.messaging.Iv2InitiateTaskMessage)13 Test (org.junit.Test)8 Mailbox (org.voltcore.messaging.Mailbox)7 SiteProcedureConnection (org.voltdb.SiteProcedureConnection)6 FragmentResponseMessage (org.voltdb.messaging.FragmentResponseMessage)6 ArrayList (java.util.ArrayList)4 List (java.util.List)4 ClientResponseImpl (org.voltdb.ClientResponseImpl)4 VoltTable (org.voltdb.VoltTable)4 ByteBuffer (java.nio.ByteBuffer)3 IOException (java.io.IOException)2 ParameterSet (org.voltdb.ParameterSet)2 EEException (org.voltdb.exceptions.EEException)2 FragmentTaskMessage (org.voltdb.messaging.FragmentTaskMessage)2 BorrowTaskMessage (org.voltdb.messaging.BorrowTaskMessage)1 InitiateResponseMessage (org.voltdb.messaging.InitiateResponseMessage)1