Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge changes I3e404877,Ida2a5c32,I9e6ce426,I6a4b90f6,I79717533
[controller.git]
/
opendaylight
/
md-sal
/
sal-akka-raft
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
raft
/
behaviors
/
Leader.java
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 0dd39001136a25416c241eb8fb69085266d3752c..ee3cc65dddb90815aecd50771c834d3ab461ecd4 100644
(file)
--- 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
@@
-5,7
+5,6
@@
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.controller.cluster.raft.behaviors;
import akka.actor.ActorRef;
package org.opendaylight.controller.cluster.raft.behaviors;
import akka.actor.ActorRef;
@@
-74,7
+73,7
@@
public class Leader extends AbstractLeader {
}
protected void scheduleInstallSnapshotCheck(FiniteDuration interval) {
}
protected void scheduleInstallSnapshotCheck(FiniteDuration interval) {
- if
(followers.size() == 0)
{
+ if
(getFollowerIds().isEmpty())
{
// Optimization - do not bother scheduling a heartbeat as there are
// no followers
return;
// Optimization - do not bother scheduling a heartbeat as there are
// no followers
return;
@@
-103,7
+102,8
@@
public class Leader extends AbstractLeader {
context.getActorSystem().dispatcher(), context.getActor());
}
context.getActorSystem().dispatcher(), context.getActor());
}
- @Override public void close() throws Exception {
+ @Override
+ public void close() throws Exception {
stopInstallSnapshotSchedule();
stopIsolatedLeaderCheckSchedule();
super.close();
stopInstallSnapshotSchedule();
stopIsolatedLeaderCheckSchedule();
super.close();
@@
-111,6
+111,11
@@
public class Leader extends AbstractLeader {
@VisibleForTesting
void markFollowerActive(String followerId) {
@VisibleForTesting
void markFollowerActive(String followerId) {
- followerToLog.get(followerId).markFollowerActive();
+ getFollower(followerId).markFollowerActive();
+ }
+
+ @VisibleForTesting
+ void markFollowerInActive(String followerId) {
+ getFollower(followerId).markFollowerInActive();
}
}
}
}