Package org.apache.zookeeper.server.quorum

Examples of org.apache.zookeeper.server.quorum.QuorumPeer.shutdown()


    public void shutdown(int id) {
        QuorumPeer qp = getPeer(id).peer;
        try {
            LOG.info("Shutting down quorum peer " + qp.getName());
            qp.shutdown();
            Election e = qp.getElectionAlg();
            if (e != null) {
                LOG.info("Shutting down leader election " + qp.getName());
                e.shutdown();
            } else {
View Full Code Here


            }
            fail("Socket has not been closed");
        } catch (Exception e) {
            LOG.info("Socket has been closed as expected");
        }
        peer.shutdown();
        cnxManager.halt();
    }  

    /*
     * Test if Worker threads are getting killed after connection loss
View Full Code Here

        for (int myid = 0; myid < 3; myid++) {
            for (int i = 0; i < 5; i++) {
                // halt one of the listeners and verify count
                QuorumPeer peer = peerList.get(myid);
                LOG.info("Round " + i + ", halting peer " + peer.getId());
                peer.shutdown();
                peerList.remove(myid);
                Thread.sleep((peer.getSyncLimit() * peer.getTickTime()) + 2000);
                verifyThreadCount(peerList, 2);

                // Restart halted node and verify count
View Full Code Here

    public void shutdown(int id) {
        QuorumPeer qp = getPeer(id).peer;
        try {
            LOG.info("Shutting down quorum peer " + qp.getName());
            qp.shutdown();
            Election e = qp.getElectionAlg();
            if (e != null) {
                LOG.info("Shutting down leader election " + qp.getName());
                e.shutdown();
            } else {
View Full Code Here

            }
            fail("Socket has not been closed");
        } catch (Exception e) {
            LOG.info("Socket has been closed as expected");
        }
        peer.shutdown();
        cnxManager.halt();
    }  

    /*
     * Test if Worker threads are getting killed after connection loss
View Full Code Here

        for (int myid = 0; myid < 3; myid++) {
            for (int i = 0; i < 5; i++) {
                // halt one of the listeners and verify count
                QuorumPeer peer = peerList.get(myid);
                LOG.info("Round " + i + ", halting peer " + peer.getId());
                peer.shutdown();
                peerList.remove(myid);
                failure = verifyThreadCount(peerList, 2);
                if (failure != null) {
                    Assert.fail(failure);
                }
View Full Code Here

            }
            Assert.fail("Socket has not been closed");
        } catch (Exception e) {
            LOG.info("Socket has been closed as expected");
        }
        peer.shutdown();
        cnxManager.halt();
    }  

    /*
     * Test if a receiveConnection is able to timeout on socket errors
View Full Code Here

        for (int myid = 0; myid < 3; myid++) {
            for (int i = 0; i < 5; i++) {
                // halt one of the listeners and verify count
                QuorumPeer peer = peerList.get(myid);
                LOG.info("Round " + i + ", halting peer " + peer.getId());
                peer.shutdown();
                peerList.remove(myid);
                failure = verifyThreadCount(peerList, 2);
                if (failure != null) {
                    Assert.fail(failure);
                }
View Full Code Here

        }
        // cleanup
        for (int id = 0; id < 3; id++) {
            peer = peerList.get(id);
            if (peer != null) {
                peer.shutdown();
            }
        }
    }
}
View Full Code Here

    public void shutdown(int id) {
        QuorumPeer qp = getPeer(id).peer;
        try {
            LOG.info("Shutting down quorum peer " + qp.getName());
            qp.shutdown();
            Election e = qp.getElectionAlg();
            if (e != null) {
                LOG.info("Shutting down leader election " + qp.getName());
                e.shutdown();
            } else {
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.