public void start(int id) throws IOException { PeerStruct ps = getPeer(id); LOG.info("Creating QuorumPeer " + ps.id + "; public port " + ps.clientPort); ps.peer = new QuorumPeer(peersView, ps.dataDir, ps.dataDir, ps.clientPort, electionAlg, ps.id, tickTime, initLimit, syncLimit); if (localSessionEnabled) { ps.peer.enableLocalSessions(true); } Assert.assertEquals(ps.clientPort, ps.peer.getClientPort()); ps.peer.start(); }
LOG.info("QuorumPeer 5 voting view: " + s5.getVotingView()); s1.enableLocalSessions(localSessionsEnabled); s2.enableLocalSessions(localSessionsEnabled); s3.enableLocalSessions(localSessionsEnabled); s4.enableLocalSessions(localSessionsEnabled); s5.enableLocalSessions(localSessionsEnabled); s1.enableLocalSessionsUpgrading(localSessionsUpgradingEnabled); s2.enableLocalSessionsUpgrading(localSessionsUpgradingEnabled);
config.getDataLogDir(), config.getDataDir())); quorumPeer.enableLocalSessions(config.areLocalSessionsEnabled()); quorumPeer.enableLocalSessionsUpgrading( config.isLocalSessionsUpgradingEnabled());
public void startThenShutdown(int id) throws IOException { PeerStruct ps = getPeer(id); LOG.info("Creating QuorumPeer " + ps.id + "; public port " + ps.clientPort); ps.peer = new QuorumPeer(peersView, ps.dataDir, ps.dataDir, ps.clientPort, electionAlg, ps.id, tickTime, initLimit, syncLimit); if (localSessionEnabled) { ps.peer.enableLocalSessions(true); } Assert.assertEquals(ps.clientPort, ps.peer.getClientPort()); ps.peer.start(); Assert.assertTrue("Waiting for server up", ClientBase.waitForServerUp("127.0.0.1:" + getPeer(id).clientPort, ClientBase.CONNECTION_TIMEOUT)); shutdown(id); }