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%2FRaftActorLeadershipTransferCohort.java;h=85980e2ca371fe752d1743cc0f3aab6df186628a;hp=d5dfcf3943387149a179a731a6e51e04819c23cc;hb=92cbb07ef81943b0740ba7c8915001ac6785f560;hpb=c2ecbded084e74232719f5d906197f15cc260965 diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorLeadershipTransferCohort.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorLeadershipTransferCohort.java index d5dfcf3943..85980e2ca3 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorLeadershipTransferCohort.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorLeadershipTransferCohort.java @@ -52,16 +52,14 @@ public class RaftActorLeadershipTransferCohort { private static final Logger LOG = LoggerFactory.getLogger(RaftActorLeadershipTransferCohort.class); private final RaftActor raftActor; - private final ActorRef replyTo; private Cancellable newLeaderTimer; private final List onCompleteCallbacks = new ArrayList<>(); private long newLeaderTimeoutInMillis = 2000; private final Stopwatch transferTimer = Stopwatch.createUnstarted(); private boolean isTransferring; - RaftActorLeadershipTransferCohort(RaftActor raftActor, ActorRef replyTo) { + RaftActorLeadershipTransferCohort(RaftActor raftActor) { this.raftActor = raftActor; - this.replyTo = replyTo; } void init() { @@ -161,18 +159,17 @@ public class RaftActorLeadershipTransferCohort { transferTimer.stop(); if(success) { LOG.info("{}: Successfully transferred leadership to {} in {}", raftActor.persistenceId(), - raftActor.getLeaderId(), transferTimer.toString()); + raftActor.getLeaderId(), transferTimer); } else { - LOG.warn("{}: Failed to transfer leadership in {}", raftActor.persistenceId(), - transferTimer.toString()); + LOG.warn("{}: Failed to transfer leadership in {}", raftActor.persistenceId(), transferTimer); } } for(OnComplete onComplete: onCompleteCallbacks) { if(success) { - onComplete.onSuccess(raftActor.self(), replyTo); + onComplete.onSuccess(raftActor.self()); } else { - onComplete.onFailure(raftActor.self(), replyTo); + onComplete.onFailure(raftActor.self()); } } } @@ -191,7 +188,7 @@ public class RaftActorLeadershipTransferCohort { } interface OnComplete { - void onSuccess(ActorRef raftActorRef, ActorRef replyTo); - void onFailure(ActorRef raftActorRef, ActorRef replyTo); + void onSuccess(ActorRef raftActorRef); + void onFailure(ActorRef raftActorRef); } }