LogEntryProto startLeaderState(RaftServerImpl server, RaftProperties properties) { return updateAndGet(leaderState, new LeaderState(server, properties)).start(); }
synchronized void changeToLeader() { Preconditions.assertTrue(isCandidate()); shutdownElectionDaemon(); setRole(Role.LEADER, "changeToLeader"); state.becomeLeader(); // start sending AppendEntries RPC to followers leaderState = new LeaderState(this, getProxy().getProperties()); leaderState.start(); }