Package org.voltcore.messaging

Examples of org.voltcore.messaging.FaultMessage


        when(aide.getNewestSafeTransactionForInitiator(2L)).thenReturn(22L);

        when(mbox.recvBlocking(any(Subject[].class), eq(5L)))
            .thenReturn(make(s2f.but(with(sfmSource,1L))))
            .thenReturn(make(s03f.but(with(sfmSource,3L),with(sfmFailures,sfmFailed(1)))))
            .thenReturn(new FaultMessage(1,2, ImmutableSet.of(0L,1L,3L)))
        ;

        Map<Long,Long> decision = arbiter.reconfigureOnFault(hsids, new FaultMessage(2,1,ImmutableSet.of(0L,2L,3L)));

        verify(mbox,times(1)).deliverFront(any(VoltMessage.class));
        verify(mbox,times(1)).send(any(long[].class), any(VoltMessage.class));
        verify(mbox).send(any(long[].class), argThat(siteFailureIs(sfmFailed(1), sfmSurvived(0,1,2,3))));

        assertEquals(decision,ImmutableMap.<Long,Long>of());

        reset(mbox);
        when(mbox.recvBlocking(any(Subject[].class), eq(5L)))
            .thenReturn(make(s1f.but(with(sfmSource,2L))))
            .thenReturn(make(s03f.but(with(sfmSource,0L))))
            .thenReturn(make(s03f.but(with(sfmSource,3L))))
        ;

        decision = arbiter.reconfigureOnFault(hsids, new FaultMessage(1,2,ImmutableSet.of(0L,1L,3L)));

        // promotion from un to witnessed
        verify(mbox,atLeast(2)).send(any(long[].class), any(VoltMessage.class));
        verify(mbox).send(any(long[].class), argThat(siteFailureIs(sfmFailed(1,2), sfmSurvived(0,1,2,3))));
        verify(mbox).send(eq(new long[]{1}), argThat(failureForwardMsgIs(2,sfmFailed(1), sfmSurvived(0,2,3))));
View Full Code Here


    public void reportFault(long faultingSite) {
        if (m_siteLog.isDebugEnabled()) {
            m_siteLog.debug("Reported fault: " + faultingSite + ", witnessed?: true" );
        }
        FaultMessage fm = new FaultMessage(m_mailbox.getHSId(), faultingSite);
        fm.m_sourceHSId = m_mailbox.getHSId();
        m_mailbox.deliver(fm);
    }
View Full Code Here

            }
            return;
        }
        // need heartbeat something in here?
        if (msg instanceof FaultMessage) {
            FaultMessage fm = (FaultMessage)msg;
            discoverGlobalFaultData(fm);
        }
    }
View Full Code Here

TOP

Related Classes of org.voltcore.messaging.FaultMessage

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.