Examples of PeerStruct


Examples of org.apache.zookeeper.test.QuorumUtil.PeerStruct

        qu = new QuorumUtil(1);
        startAll();

        for (int i = 0; i < zkClients.length; i++) {
            zkClientWatchers[i] = new CountdownWatcher();
            PeerStruct peer = qu.getPeer(i + 1);
            zkClients[i] = new ZooKeeper(
                    "127.0.0.1:" + peer.clientPort,
                    ClientTest.CONNECTION_TIMEOUT, zkClientWatchers[i]);
        }
        waitForClientsConnected();
View Full Code Here

Examples of org.apache.zookeeper.test.QuorumUtil.PeerStruct

            // disconnected and reconnected. In some cases the client will
            // disconnect, then attempt to reconnect before the server is
            // back, in which case we'll see another connloss on the operation
            // in the try, this catches that case and waits for the server
            // to come back
            PeerStruct peer = qu.getPeer(idx);
            Assert.assertTrue("Waiting for server down", ClientBase.waitForServerUp(
                    "127.0.0.1:" + peer.clientPort, ClientBase.CONNECTION_TIMEOUT));

            assertNull(zk.exists("/foofoofoo-connected", false));
        }
View Full Code Here

Examples of org.apache.zookeeper.test.QuorumUtil.PeerStruct

   
    private void shutdown(int idx) throws Exception {
        qu.shutdown(idx);

        // leader will shutdown, remaining followers will elect a new leader
        PeerStruct peer = qu.getPeer(idx);
        Assert.assertTrue("Waiting for server down", ClientBase.waitForServerDown(
                "127.0.0.1:" + peer.clientPort, ClientBase.CONNECTION_TIMEOUT));

        // if idx is the the leader then everyone will get disconnected,
        // otherwise if idx is a follower then just that client will get
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.