Examples of TxnEgo


Examples of org.voltdb.iv2.TxnEgo

    }

    void verifyUACfromMasterToReplica() throws Exception
    {
        // uac from master?
        TxnEgo txnid = TxnEgo.makeZero(MpInitiator.MP_INIT_PID);
        Object[] params = new Object[2];
        params[0] = ClientUtils.fileToBytes(new File(m_pathToCatalog));
        params[1] = null;
        txnid = txnid.makeNext();
        // We're going to get odd responses for the sentinels, so catch and ignore the exceptions
        try {
            ((ClientImpl)m_client).callProcedure(txnid.getTxnId(), 0L, "@SendSentinel", 0);
        } catch (ProcCallException pce) {}
        try {
            ((ClientImpl)m_client).callProcedure(txnid.getTxnId(), 0L, "@SendSentinel", 1);
        } catch (ProcCallException pce) {}
        ClientResponse r = ((ClientImpl)m_client).callProcedure(txnid.getTxnId(), 0L,
                "@UpdateApplicationCatalog", params);
        assertEquals(ClientResponse.SUCCESS, r.getStatus());

        // adhoc queries still work
        verifyAdhocQuery();
        // undo our previous catalog update through the remote side so the promote test works
        params = new Object[2];
        params[0] = ClientUtils.fileToBytes(new File(m_pathToOtherCatalog));
        params[1] = null;
        txnid = txnid.makeNext();
        // We're going to get odd responses for the sentinels, so catch and ignore the exceptions
        try {
            ((ClientImpl)m_client).callProcedure(txnid.getTxnId(), 0L, "@SendSentinel", 0);
        } catch (ProcCallException pce) {}
        try {
            ((ClientImpl)m_client).callProcedure(txnid.getTxnId(), 0L, "@SendSentinel", 1);
        } catch (ProcCallException pce) {}
        r = ((ClientImpl)m_client).callProcedure(txnid.getTxnId(), 0L,
                "@UpdateApplicationCatalog", params);
        assertEquals(ClientResponse.SUCCESS, r.getStatus());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.