Package org.apache.zookeeper.server.quorum.flexible

Examples of org.apache.zookeeper.server.quorum.flexible.QuorumHierarchical


                }

                /*
                 * Set the quorumVerifier to be QuorumHierarchical
                 */
                quorumVerifier = new QuorumHierarchical(numGroups,
                        serverWeight, serverGroup);
            } else {
                /*
                 * The default QuorumVerifier is QuorumMaj
                 */
 
View Full Code Here


                new InetSocketAddress("127.0.0.1", leport5 + 1000),
                withObservers ? QuorumPeer.LearnerType.OBSERVER
                        : QuorumPeer.LearnerType.PARTICIPANT));

        LOG.info("creating QuorumPeer 1 port " + port1);
        QuorumHierarchical hq1 = new QuorumHierarchical(qp);
        s1 = new QuorumPeer(peers, s1dir, s1dir, port1, 3, 1, tickTime, initLimit, syncLimit, hq1);
        Assert.assertEquals(port1, s1.getClientPort());
       
        LOG.info("creating QuorumPeer 2 port " + port2);
        QuorumHierarchical hq2 = new QuorumHierarchical(qp);
        s2 = new QuorumPeer(peers, s2dir, s2dir, port2, 3, 2, tickTime, initLimit, syncLimit, hq2);
        Assert.assertEquals(port2, s2.getClientPort());
       
        LOG.info("creating QuorumPeer 3 port " + port3);
        QuorumHierarchical hq3 = new QuorumHierarchical(qp);
        s3 = new QuorumPeer(peers, s3dir, s3dir, port3, 3, 3, tickTime, initLimit, syncLimit, hq3);
        Assert.assertEquals(port3, s3.getClientPort());
       
        LOG.info("creating QuorumPeer 4 port " + port4);
        QuorumHierarchical hq4 = new QuorumHierarchical(qp);
        s4 = new QuorumPeer(peers, s4dir, s4dir, port4, 3, 4, tickTime, initLimit, syncLimit, hq4);
        if (withObservers) {
            s4.setLearnerType(QuorumPeer.LearnerType.OBSERVER);
        }
        Assert.assertEquals(port4, s4.getClientPort());
                      
        LOG.info("creating QuorumPeer 5 port " + port5);
        QuorumHierarchical hq5 = new QuorumHierarchical(qp);
        s5 = new QuorumPeer(peers, s5dir, s5dir, port5, 3, 5, tickTime, initLimit, syncLimit, hq5);
        if (withObservers) {
            s5.setLearnerType(QuorumPeer.LearnerType.OBSERVER);
        }
        Assert.assertEquals(port5, s5.getClientPort());
View Full Code Here

            tmpdir[i] = ClientBase.createTmpDir();
            port[i] = PortAssignment.unique();
        }

        for(int i = 0; i < le.length; i++) {
            QuorumHierarchical hq = new QuorumHierarchical(qp);
            QuorumPeer peer = new QuorumPeer(peers, tmpdir[i], tmpdir[i], port[i], 3, i, 1000, 2, 2, hq);
            peer.startLeaderElection();
            LEThread thread = new LEThread(peer, i);
            thread.start();
            threads.add(thread);
View Full Code Here

                }

                /*
                 * Set the quorumVerifier to be QuorumHierarchical
                 */
                quorumVerifier = new QuorumHierarchical(numGroups,
                        serverWeight, serverGroup);
            } else {
                /*
                 * The default QuorumVerifier is QuorumMaj
                 */
 
View Full Code Here

                new InetSocketAddress("127.0.0.1", leport5 + 1000),
                withObservers ? QuorumPeer.LearnerType.OBSERVER
                        : QuorumPeer.LearnerType.PARTICIPANT));

        LOG.info("creating QuorumPeer 1 port " + port1);
        QuorumHierarchical hq1 = new QuorumHierarchical(qp);
        s1 = new QuorumPeer(peers, s1dir, s1dir, port1, 3, 1, tickTime, initLimit, syncLimit, hq1);
        assertEquals(port1, s1.getClientPort());
       
        LOG.info("creating QuorumPeer 2 port " + port2);
        QuorumHierarchical hq2 = new QuorumHierarchical(qp);
        s2 = new QuorumPeer(peers, s2dir, s2dir, port2, 3, 2, tickTime, initLimit, syncLimit, hq2);
        assertEquals(port2, s2.getClientPort());
       
        LOG.info("creating QuorumPeer 3 port " + port3);
        QuorumHierarchical hq3 = new QuorumHierarchical(qp);
        s3 = new QuorumPeer(peers, s3dir, s3dir, port3, 3, 3, tickTime, initLimit, syncLimit, hq3);
        assertEquals(port3, s3.getClientPort());
       
        LOG.info("creating QuorumPeer 4 port " + port4);
        QuorumHierarchical hq4 = new QuorumHierarchical(qp);
        s4 = new QuorumPeer(peers, s4dir, s4dir, port4, 3, 4, tickTime, initLimit, syncLimit, hq4);
        if (withObservers) {
            s4.setPeerType(QuorumPeer.LearnerType.OBSERVER);
        }
        assertEquals(port4, s4.getClientPort());
                      
        LOG.info("creating QuorumPeer 5 port " + port5);
        QuorumHierarchical hq5 = new QuorumHierarchical(qp);
        s5 = new QuorumPeer(peers, s5dir, s5dir, port5, 3, 5, tickTime, initLimit, syncLimit, hq5);
        if (withObservers) {
            s5.setPeerType(QuorumPeer.LearnerType.OBSERVER);
        }
        assertEquals(port5, s5.getClientPort());
View Full Code Here

        peers.put(Long.valueOf(5), new QuorumServer(5,
                new InetSocketAddress("127.0.0.1", port5 + 1000),
                new InetSocketAddress("127.0.0.1", leport5 + 1000)));

        LOG.info("creating QuorumPeer 1 port " + port1);
        QuorumHierarchical hq1 = new QuorumHierarchical(qp);
        s1 = new QuorumPeer(peers, s1dir, s1dir, port1, 3, 1, tickTime, initLimit, syncLimit, hq1);
        assertEquals(port1, s1.getClientPort());
       
        LOG.info("creating QuorumPeer 2 port " + port2);
        QuorumHierarchical hq2 = new QuorumHierarchical(qp);
        s2 = new QuorumPeer(peers, s2dir, s2dir, port2, 3, 2, tickTime, initLimit, syncLimit, hq2);
        assertEquals(port2, s2.getClientPort());
       
        LOG.info("creating QuorumPeer 3 port " + port3);
        QuorumHierarchical hq3 = new QuorumHierarchical(qp);
        s3 = new QuorumPeer(peers, s3dir, s3dir, port3, 3, 3, tickTime, initLimit, syncLimit, hq3);
        assertEquals(port3, s3.getClientPort());
       
        LOG.info("creating QuorumPeer 4 port " + port4);
        QuorumHierarchical hq4 = new QuorumHierarchical(qp);
        s4 = new QuorumPeer(peers, s4dir, s4dir, port4, 3, 4, tickTime, initLimit, syncLimit, hq4);
        assertEquals(port4, s4.getClientPort());
       
        LOG.info("creating QuorumPeer 5 port " + port5);
        QuorumHierarchical hq5 = new QuorumHierarchical(qp);
        s5 = new QuorumPeer(peers, s5dir, s5dir, port5, 3, 5, tickTime, initLimit, syncLimit, hq5);
        assertEquals(port5, s5.getClientPort());
        LOG.info("start QuorumPeer 1");
        s1.start();
        LOG.info("start QuorumPeer 2");
View Full Code Here

            tmpdir[i] = ClientBase.createTmpDir();
            port[i] = baseport + i;
        }

        for(int i = 0; i < le.length; i++) {
            QuorumHierarchical hq = new QuorumHierarchical(qp);
            QuorumPeer peer = new QuorumPeer(peers, tmpdir[i], tmpdir[i], port[i], 3, i, 2, 2, 2, hq);
            peer.startLeaderElection();
            LEThread thread = new LEThread(peer, i);
            thread.start();
            threads.add(thread);
View Full Code Here

                }

                /*
                 * Set the quorumVerifier to be QuorumHierarchical
                 */
                quorumVerifier = new QuorumHierarchical(numGroups,
                        serverWeight, serverGroup);
            } else {
                /*
                 * The default QuorumVerifier is QuorumMaj
                 */
 
View Full Code Here

       
        if (withObservers) {
               qp.setProperty("server.4", "127.0.0.1:" + (port4 + 1000) + ":" + (leport4 + 1000) + ":observer" + ";" + clientport4)
               qp.setProperty("server.5", "127.0.0.1:" + (port5 + 1000) + ":" + (leport5 + 1000) ":observer" + ";" + clientport5);
        }
        QuorumHierarchical hq1 = new QuorumHierarchical(qp);
        s1 = new QuorumPeer(peers, s1dir, s1dir, clientport1, 3, 1, tickTime, initLimit, syncLimit, hq1);
        Assert.assertEquals(clientport1, s1.getClientPort());
       
        LOG.info("creating QuorumPeer 2 port " + clientport2);
        QuorumHierarchical hq2 = new QuorumHierarchical(qp);
        s2 = new QuorumPeer(peers, s2dir, s2dir, clientport2, 3, 2, tickTime, initLimit, syncLimit, hq2);
        Assert.assertEquals(clientport2, s2.getClientPort());
       
        LOG.info("creating QuorumPeer 3 port " + clientport3);
        QuorumHierarchical hq3 = new QuorumHierarchical(qp);
        s3 = new QuorumPeer(peers, s3dir, s3dir, clientport3, 3, 3, tickTime, initLimit, syncLimit, hq3);
        Assert.assertEquals(clientport3, s3.getClientPort());
       
        LOG.info("creating QuorumPeer 4 port " + clientport4);
        QuorumHierarchical hq4 = new QuorumHierarchical(qp);
        s4 = new QuorumPeer(peers, s4dir, s4dir, clientport4, 3, 4, tickTime, initLimit, syncLimit, hq4);
        if (withObservers) {
            s4.setLearnerType(QuorumPeer.LearnerType.OBSERVER);
        }
        Assert.assertEquals(clientport4, s4.getClientPort());
                      
        LOG.info("creating QuorumPeer 5 port " + clientport5);
        QuorumHierarchical hq5 = new QuorumHierarchical(qp);
        s5 = new QuorumPeer(peers, s5dir, s5dir, clientport5, 3, 5, tickTime, initLimit, syncLimit, hq5);
        if (withObservers) {
            s5.setLearnerType(QuorumPeer.LearnerType.OBSERVER);
        }
        Assert.assertEquals(clientport5, s5.getClientPort());
View Full Code Here

            peers.put(Long.valueOf(i), new QuorumServer(i, addr1, addr2, addr3));
            tmpdir[i] = ClientBase.createTmpDir();
        }

        for(int i = 0; i < count; i++) {
            QuorumHierarchical hq = new QuorumHierarchical(qp);
            QuorumPeer peer = new QuorumPeer(peers, tmpdir[i], tmpdir[i], port[i], 3, i, 1000, 2, 2, hq);
            peer.startLeaderElection();
            LEThread thread = new LEThread(peer, i);
            thread.start();
            threads.add(thread);
View Full Code Here

TOP

Related Classes of org.apache.zookeeper.server.quorum.flexible.QuorumHierarchical

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.