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%2FDefaultConfigParamsImpl.java;h=3e6742c17d37c178d30c7d570490ff993c068806;hp=86867e1d040ee84396450ee72f6097093aecd70e;hb=3927509ec3ecfa32a51b725d2b7155d425f5b877;hpb=742edf369379d28ef00822774f071d253a7b8a9f diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java index 86867e1d04..3e6742c17d 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java @@ -42,8 +42,7 @@ public class DefaultConfigParamsImpl implements ConfigParams { private FiniteDuration heartBeatInterval = HEART_BEAT_INTERVAL; private long snapshotBatchCount = SNAPSHOT_BATCH_COUNT; private int journalRecoveryLogBatchSize = JOURNAL_RECOVERY_LOG_BATCH_SIZE; - private FiniteDuration isolatedLeaderCheckInterval = - new FiniteDuration(HEART_BEAT_INTERVAL.length() * 1000, HEART_BEAT_INTERVAL.unit()); + private long isolatedLeaderCheckInterval = HEART_BEAT_INTERVAL.$times(1000).toMillis(); // 12 is just an arbitrary percentage. This is the amount of the total memory that a raft actor's // in-memory journal can use before it needs to snapshot @@ -68,7 +67,7 @@ public class DefaultConfigParamsImpl implements ConfigParams { } public void setIsolatedLeaderCheckInterval(FiniteDuration isolatedLeaderCheckInterval) { - this.isolatedLeaderCheckInterval = isolatedLeaderCheckInterval; + this.isolatedLeaderCheckInterval = isolatedLeaderCheckInterval.toMillis(); } public void setElectionTimeoutFactor(long electionTimeoutFactor){ @@ -112,7 +111,7 @@ public class DefaultConfigParamsImpl implements ConfigParams { } @Override - public FiniteDuration getIsolatedCheckInterval() { + public long getIsolatedCheckIntervalInMillis() { return isolatedLeaderCheckInterval; }