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.setLearnerType(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.setLearnerType(QuorumPeer.LearnerType.OBSERVER);
}
assertEquals(port5, s5.getClientPort());