import akka.cluster.Member;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Optional;
import akka.cluster.Member;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import org.opendaylight.controller.cluster.raft.RaftActorContext;
import org.opendaylight.controller.cluster.raft.RaftState;
import java.util.concurrent.TimeUnit;
import org.opendaylight.controller.cluster.raft.RaftActorContext;
import org.opendaylight.controller.cluster.raft.RaftState;
AbstractRaftActorBehavior(final RaftActorContext context, final RaftState state) {
this.context = requireNonNull(context);
this.state = requireNonNull(state);
AbstractRaftActorBehavior(final RaftActorContext context, final RaftState state) {
this.context = requireNonNull(context);
this.state = requireNonNull(state);
// the log with the later term is more up-to-date. If the logs
// end with the same term, then whichever log is longer is
// more up-to-date.
// the log with the later term is more up-to-date. If the logs
// end with the same term, then whichever log is longer is
// more up-to-date.
- if (requestVote.getLastLogTerm() > lastTerm()) {
- candidateLatest = true;
- } else if (requestVote.getLastLogTerm() == lastTerm()
+ if (requestVote.getLastLogTerm() > lastTerm() || requestVote.getLastLogTerm() == lastTerm()
return context.getConfigParams().getElectionTimeOutInterval().$plus(
new FiniteDuration(variance, TimeUnit.MILLISECONDS));
}
return context.getConfigParams().getElectionTimeOutInterval().$plus(
new FiniteDuration(variance, TimeUnit.MILLISECONDS));
}