Package org.voltcore.messaging

Examples of org.voltcore.messaging.HeartbeatResponseMessage


        assertEquals(mn.isReadOnly(), mn2.isReadOnly());
        assertEquals(mn.getLastSafeTxnId(), mn2.getLastSafeTxnId());
    }

    public void testHeartbeatResponse() throws IOException {
        HeartbeatResponseMessage mn = new HeartbeatResponseMessage(55, 100222, true);

        HeartbeatResponseMessage mn2 = (HeartbeatResponseMessage) checkVoltMessage(mn);

        assertEquals(mn.getExecHSId(), mn2.getExecHSId());
        assertEquals(mn.getLastReceivedTxnId(), mn2.getLastReceivedTxnId());
        assertEquals(mn.isBlocked(), mn2.isBlocked());
    }
View Full Code Here


    private void sendHearbeatResponse(OrderableTransaction ts, LastInitiatorData lid) {
        // mailbox might be null in testing
        if (m_mailbox == null) return;

        HeartbeatResponseMessage hbr =
            new HeartbeatResponseMessage(m_hsId, lid.m_lastSeenTxnId, true);
        m_mailbox.send(ts.initiatorHSId, hbr);
    }
View Full Code Here

                long lastSeenTxnFromInitiator = m_txnQueue.noteTransactionRecievedAndReturnLastSeen(
                        info.getInitiatorHSId(), info.getTxnId(),
                        ((HeartbeatMessage) info).getLastSafeTxnId());

                // respond to the initiator with the last seen transaction
                HeartbeatResponseMessage response = new HeartbeatResponseMessage(
                        m_hsId, lastSeenTxnFromInitiator,
                        m_txnQueue.getQueueState() == RestrictedPriorityQueue.QueueState.BLOCKED_SAFETY);
                m_mailbox.send(info.getInitiatorHSId(), response);
                // we're done here (in the case of heartbeats)
                return;
            }
            assert(false);
        } else if (message instanceof HeartbeatResponseMessage) {
            HeartbeatResponseMessage hrm = (HeartbeatResponseMessage)message;
            m_safetyState.updateLastSeenTxnIdFromExecutorBySiteId(
                    hrm.getExecHSId(),
                    hrm.getLastReceivedTxnId());
        } else if (message instanceof LocalObjectMessage) {
            LocalObjectMessage lom = (LocalObjectMessage)message;
            if (lom.payload instanceof Runnable) {
                ((Runnable)lom.payload).run();
            } else if (lom.payload instanceof Request) {
View Full Code Here

TOP

Related Classes of org.voltcore.messaging.HeartbeatResponseMessage

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.