Search in sources :

Example 16 with InitiateResponseMessage

use of org.voltdb.messaging.InitiateResponseMessage in project voltdb by VoltDB.

the class ProcedureRunnerNT method completeCall.

/**
     * Send a response back to the proc caller. Refactored out of coreCall for both
     * regular and exceptional paths.
     */
private void completeCall(ClientResponseImpl response) {
    // if we're keeping track, calculate result size
    if (m_perCallStats.samplingProcedure()) {
        m_perCallStats.setResultSize(response.getResults());
    }
    m_statsCollector.endProcedure(response.getStatus() == ClientResponse.USER_ABORT, (response.getStatus() != ClientResponse.USER_ABORT) && (response.getStatus() != ClientResponse.SUCCESS), m_perCallStats);
    // send the response to the caller
    // must be done as IRM to CI mailbox for backpressure accounting
    response.setClientHandle(m_clientHandle);
    InitiateResponseMessage irm = InitiateResponseMessage.messageForNTProcResponse(m_ciHandle, m_ccxn.connectionId(), response);
    m_mailbox.deliver(irm);
    m_ntProcService.handleNTProcEnd(ProcedureRunnerNT.this);
}
Also used : InitiateResponseMessage(org.voltdb.messaging.InitiateResponseMessage)

Example 17 with InitiateResponseMessage

use of org.voltdb.messaging.InitiateResponseMessage in project voltdb by VoltDB.

the class Iv2Trace method logInitiatorRxMsg.

public static void logInitiatorRxMsg(VoltMessage msg, long localHSId) {
    if (IV2_TRACE_ENABLED) {
        if (msg instanceof InitiateResponseMessage) {
            InitiateResponseMessage iresp = (InitiateResponseMessage) msg;
            String logmsg = "rxInitRsp %s from %s ciHandle %s txnId %s spHandle %s status %s";
            iv2log.trace(String.format(logmsg, CoreUtils.hsIdToString(localHSId), CoreUtils.hsIdToString(iresp.m_sourceHSId), ClientInterfaceHandleManager.handleToString(iresp.getClientInterfaceHandle()), txnIdToString(iresp.getTxnId()), txnIdToString(iresp.getSpHandle()), respStatusToString(iresp.getClientResponseData().getStatus())));
        } else if (msg instanceof FragmentResponseMessage) {
            FragmentResponseMessage fresp = (FragmentResponseMessage) msg;
            String logmsg = "rxFragRsp %s from %s txnId %s spHandle %s status %s";
            iv2log.trace(String.format(logmsg, CoreUtils.hsIdToString(localHSId), CoreUtils.hsIdToString(fresp.m_sourceHSId), txnIdToString(fresp.getTxnId()), txnIdToString(fresp.getSpHandle()), fragStatusToString(fresp.getStatusCode())));
        } else if (msg instanceof CompleteTransactionResponseMessage) {
            CompleteTransactionResponseMessage cresp = (CompleteTransactionResponseMessage) msg;
            String logmsg = "rxCompRsp %s from %s txnId %s spHandle %s SPI %s restart %s recovering %s";
            iv2log.trace(String.format(logmsg, CoreUtils.hsIdToString(localHSId), CoreUtils.hsIdToString(cresp.m_sourceHSId), txnIdToString(cresp.getTxnId()), txnIdToString(cresp.getSpHandle()), txnIdToString(cresp.getSPIHSId()), cresp.isRestart(), cresp.isRecovering()));
        } else if (msg instanceof DummyTransactionResponseMessage) {
            DummyTransactionResponseMessage dresp = (DummyTransactionResponseMessage) msg;
            String logmsg = "rxDummyRsp %s from %s to %s for txnId %s";
            iv2log.trace(String.format(logmsg, CoreUtils.hsIdToString(localHSId), CoreUtils.hsIdToString(dresp.m_sourceHSId), txnIdToString(dresp.getSPIHSId()), txnIdToString(dresp.getTxnId())));
        }
    }
}
Also used : CompleteTransactionResponseMessage(org.voltdb.messaging.CompleteTransactionResponseMessage) DummyTransactionResponseMessage(org.voltdb.messaging.DummyTransactionResponseMessage) InitiateResponseMessage(org.voltdb.messaging.InitiateResponseMessage) FragmentResponseMessage(org.voltdb.messaging.FragmentResponseMessage)

Aggregations

InitiateResponseMessage (org.voltdb.messaging.InitiateResponseMessage)17 ClientResponseImpl (org.voltdb.ClientResponseImpl)7 Iv2InitiateTaskMessage (org.voltdb.messaging.Iv2InitiateTaskMessage)7 VoltTable (org.voltdb.VoltTable)5 Test (org.junit.Test)4 Matchers.anyLong (org.mockito.Matchers.anyLong)3 VoltMessage (org.voltcore.messaging.VoltMessage)3 VoltTrace (org.voltdb.utils.VoltTrace)2 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 Writer (java.io.Writer)1 ByteBuffer (java.nio.ByteBuffer)1 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1 TransactionInfoBaseMessage (org.voltcore.messaging.TransactionInfoBaseMessage)1 DeferredSerialization (org.voltcore.utils.DeferredSerialization)1 ExpectedProcedureException (org.voltdb.ExpectedProcedureException)1 ProcedureRunner (org.voltdb.ProcedureRunner)1 StoredProcedureInvocation (org.voltdb.StoredProcedureInvocation)1 CompleteTransactionMessage (org.voltdb.messaging.CompleteTransactionMessage)1