X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2Fbehaviors%2FLeader.java;h=7a94c0c15849038f35105789856f98cb74580d51;hp=fcfaee36033f3eba278f1f351d3c8cb3e974feb1;hb=72b9cd4df6297f8ffab9453e67781f797f5d1b28;hpb=6b9ec89c77e614b44dbd01de77a45ee8d9e6d0ec diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java index fcfaee3603..7a94c0c158 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java @@ -12,7 +12,6 @@ import akka.actor.Cancellable; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import org.opendaylight.controller.cluster.raft.RaftActorContext; -import org.opendaylight.controller.cluster.raft.base.messages.InitiateInstallSnapshot; import org.opendaylight.controller.cluster.raft.base.messages.IsolatedLeaderCheck; import scala.concurrent.duration.FiniteDuration; @@ -45,8 +44,6 @@ public class Leader extends AbstractLeader { public Leader(RaftActorContext context) { super(context); - scheduleInstallSnapshotCheck(context.getConfigParams().getIsolatedCheckInterval()); - scheduleIsolatedLeaderCheck( new FiniteDuration(context.getConfigParams().getHeartBeatInterval().length() * 10, context.getConfigParams().getHeartBeatInterval().unit())); @@ -66,30 +63,6 @@ public class Leader extends AbstractLeader { return super.handleMessage(sender, originalMessage); } - protected void stopInstallSnapshotSchedule() { - if (installSnapshotSchedule != null && !installSnapshotSchedule.isCancelled()) { - installSnapshotSchedule.cancel(); - } - } - - protected void scheduleInstallSnapshotCheck(FiniteDuration interval) { - if (getFollowerIds().isEmpty()) { - // Optimization - do not bother scheduling a heartbeat as there are - // no followers - return; - } - - stopInstallSnapshotSchedule(); - - // Schedule a message to send append entries to followers that can - // accept an append entries with some data in it - installSnapshotSchedule = - context.getActorSystem().scheduler().scheduleOnce( - interval, - context.getActor(), new InitiateInstallSnapshot(), - context.getActorSystem().dispatcher(), context.getActor()); - } - protected void stopIsolatedLeaderCheckSchedule() { if (isolatedLeaderCheckSchedule != null && !isolatedLeaderCheckSchedule.isCancelled()) { isolatedLeaderCheckSchedule.cancel(); @@ -104,7 +77,6 @@ public class Leader extends AbstractLeader { @Override public void close() throws Exception { - stopInstallSnapshotSchedule(); stopIsolatedLeaderCheckSchedule(); super.close(); }