public synchronized void restartLeaderElection(QuorumVerifier qvOLD, QuorumVerifier qvNEW){ if (qvOLD == null || !qvOLD.equals(qvNEW)) { LOG.warn("Restarting Leader Election"); getElectionAlg().shutdown(); shuttingDownLE = false; startLeaderElection(); } }
@Override public synchronized void start() { if (!getView().containsKey(myid)) { throw new RuntimeException("My id " + myid + " not in the peer list"); } loadDataBase(); startServerCnxnFactory(); try { adminServer.start(); } catch (AdminServerException e) { LOG.warn("Problem starting AdminServer", e); System.out.println(e); } startLeaderElection(); super.start(); }
@Override public synchronized void start() { loadDataBase(); cnxnFactory.start(); startLeaderElection(); super.start(); }
peer.startLeaderElection(); peerRound++; } else {
peer.startLeaderElection(); FLERestartThread thread = new FLERestartThread(peer, i); thread.start();
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();
peer.startLeaderElection(); LEThread thread = new LEThread(peer, i); thread.start(); peer.startLeaderElection(); LEThread thread = new LEThread(peer, 0); thread.start();
QuorumPeer peer = new QuorumPeer(peers, tmpdir[i], tmpdir[i], port[i], 3, i, 1000, 2, 2); peer.startLeaderElection(); LEThread thread = new LEThread(this, peer, i, rounds, quora); thread.start();
servers.mt[falseLeader].main.quorumPeer.startLeaderElection();
if (shuttingDownLE) { shuttingDownLE = false; startLeaderElection(); if (shuttingDownLE) { shuttingDownLE = false; startLeaderElection();
@Test public void testLostMessage() throws Exception { LOG.info("TestLE: {}, {}", getTestName(), count); for(int i = 0; i < count; i++) { int clientport = PortAssignment.unique(); peers.put(Long.valueOf(i), new QuorumServer(i, new InetSocketAddress(clientport), new InetSocketAddress(PortAssignment.unique()))); tmpdir[i] = ClientBase.createTmpDir(); port[i] = clientport; } /* * Start server 0 */ QuorumPeer peer = new QuorumPeer(peers, tmpdir[1], tmpdir[1], port[1], 3, 1, 1000, 2, 2); peer.startLeaderElection(); FLETestUtils.LEThread thread = new FLETestUtils.LEThread(peer, 1); thread.start(); /* * Start mock server 1 */ mockServer(); thread.join(5000); if (thread.isAlive()) { Assert.fail("Threads didn't join"); } }
peer.startLeaderElection(); FLETestUtils.LEThread thread = new FLETestUtils.LEThread(peer, 0); thread.start();
@Override public synchronized void start() { try { zkDb.loadDataBase(); } catch(IOException ie) { LOG.fatal("Unable to load database on disk", ie); throw new RuntimeException("Unable to run quorum server ", ie); } cnxnFactory.start(); startLeaderElection(); super.start(); }
@Override public synchronized void start() { loadDataBase(); cnxnFactory.start(); startLeaderElection(); super.start(); }