Package org.voltdb.messaging

Examples of org.voltdb.messaging.CompleteTransactionMessage


        return msg;
    }

    VoltMessage truncCompleteMsg(long truncPt, long mpTxnId)
    {
        CompleteTransactionMessage msg = mock(CompleteTransactionMessage.class);
        when(msg.getTxnId()).thenReturn(mpTxnId);
        when(msg.getTruncationHandle()).thenReturn(truncPt);
        return msg;
    }
View Full Code Here


        return m;
    }

    TransactionInfoBaseMessage makeCompleteTxn(long unused)
    {
        CompleteTransactionMessage m = mock(CompleteTransactionMessage.class);
        when(m.isForReplay()).thenReturn(true);
        return m;
    }
View Full Code Here

    private CompleteTransactionTask createComplete(TransactionState txn,
                                                   long mpTxnId,
                                                   TransactionTaskQueue queue)
    {
        CompleteTransactionMessage msg = mock(CompleteTransactionMessage.class);
        when(msg.getTxnId()).thenReturn(mpTxnId);
        CompleteTransactionTask task =
            new CompleteTransactionTask(txn, queue, msg, null);
        return task;
    }
View Full Code Here

    }

    private CompleteTransactionMessage makeCompleteTxnMsg(boolean readOnly, boolean isRollback,
            boolean isRestart)
    {
        CompleteTransactionMessage msg =
            new CompleteTransactionMessage(0l, 0l, m_mpiTxnEgo.getTxnId(), readOnly, 0, isRollback,
                    false, isRestart, false);
        return msg;
    }
View Full Code Here

        }
        else {
            // generate MP complete
            // fake restarts
            boolean restart = (!m_currentMpReadOnly && m_rand.nextDouble() < MPRESTARTCHANCE);
            CompleteTransactionMessage msg = makeCompleteTxnMsg(m_currentMpReadOnly, restart, restart);
            if (!restart) {
                m_mpInProgress = false;
                m_mpiTxnEgo = m_mpiTxnEgo.makeNext();
            }
            return msg;
View Full Code Here

    }


    Iv2RepairLogResponseMessage makeCompleteResponse(long handle)
    {
        CompleteTransactionMessage complete = mock(CompleteTransactionMessage.class);
        Iv2RepairLogResponseMessage m = mock(Iv2RepairLogResponseMessage.class);
        when(m.getPayload()).thenReturn(complete);
        when(m.getHandle()).thenReturn(-1L);
        when(m.getTxnId()).thenReturn(handle);
        return m;
View Full Code Here

    }

    Iv2RepairLogResponseMessage makeRealCompleteResponse(long requestId,
            long sourceHSId, int sequence, int ofTotal, long handle)
    {
        CompleteTransactionMessage complete = mock(CompleteTransactionMessage.class);
        Iv2RepairLogResponseMessage m = new Iv2RepairLogResponseMessage(requestId, sequence,
            ofTotal, handle, handle, complete);
        m.m_sourceHSId = sourceHSId;
        return m;
    }
View Full Code Here

        m_mailbox.send(message.getDestinationSiteId(), message);
    }

    public void handleCompleteTransactionMessage(CompleteTransactionMessage message)
    {
        CompleteTransactionMessage msg = message;
        if (m_isLeader) {
            msg = new CompleteTransactionMessage(message);
            // Set the spHandle so that on repair the new master will set the max seen spHandle
            // correctly
            if (!msg.isForReplay()) advanceTxnEgo();
            msg.setSpHandle(getCurrentTxnId());
            if (m_sendToHSIds.length > 0) {
                m_mailbox.send(m_sendToHSIds, msg);
            }
        } else {
            setMaxSeenTxnId(msg.getSpHandle());
        }
        TransactionState txn = m_outstandingTxns.get(msg.getTxnId());
        // We can currently receive CompleteTransactionMessages for multipart procedures
        // which only use the buddy site (replicated table read).  Ignore them for
        // now, fix that later.
        if (txn != null)
        {
            Iv2Trace.logCompleteTransactionMessage(msg, m_mailbox.getHSId());
            final CompleteTransactionTask task =
                new CompleteTransactionTask(txn, m_pendingTasks, msg, m_drGateway);
            queueOrOfferMPTask(task);
            // If this is a restart, then we need to leave the transaction state around
            if (!msg.isRestart()) {
                m_outstandingTxns.remove(msg.getTxnId());
            }
        }
    }
View Full Code Here

            else {
                found.addFragmentMessage(ftm);
            }
        }
        else if (in instanceof CompleteTransactionMessage) {
            CompleteTransactionMessage ctm = (CompleteTransactionMessage)in;
            // already sequenced
            if (inTxnId <= m_lastPolledFragmentTxnId) {
                if (found != null && found.m_firstFragment != null) {
                    found.markLastFragment(ctm);
                }
View Full Code Here

        }

        // Let's ensure that we flush any previous attempts of this transaction
        // at the masters we're going to try to use this time around.
        if (m_isRestart) {
            CompleteTransactionMessage restart = new CompleteTransactionMessage(
                    m_initiator.getHSId(), // who is the "initiator" now??
                    m_initiator.getHSId(),
                    m_txnState.txnId,
                    m_txnState.isReadOnly(),
                    0,
                    true,
                    false,  // really don't want to have ack the ack.
                    !m_txnState.isReadOnly(),
                    m_msg.isForReplay());

            restart.setTruncationHandle(m_msg.getTruncationHandle());
            restart.setOriginalTxnId(m_msg.getOriginalTxnId());
            m_initiator.send(com.google_voltpatches.common.primitives.Longs.toArray(m_initiatorHSIds), restart);
        }
        final InitiateResponseMessage response = processInitiateTask(txn.m_initiationMsg, siteConnection);
        // We currently don't want to restart read-only MP transactions because:
        // 1) We're not writing the Iv2InitiateTaskMessage to the first
View Full Code Here

TOP

Related Classes of org.voltdb.messaging.CompleteTransactionMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.