X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FDefaultConfigParamsImpl.java;h=317ce6a220854f262dce8e5e65678223d6117ab9;hb=refs%2Fchanges%2F83%2F48683%2F4;hp=c64c295ceaefe19333f5c49e144a7899d5b5ca1e;hpb=6e6659e77f3e07e157c81332b367dbbd05d21f2b;p=controller.git 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 c64c295cea..317ce6a220 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 @@ -20,9 +20,7 @@ import org.slf4j.LoggerFactory; import scala.concurrent.duration.FiniteDuration; /** - * Default implementation of the ConfigParams - * - * If no implementation is provided for ConfigParams, then this will be used. + * Default implementation of the ConfigParams. */ public class DefaultConfigParamsImpl implements ConfigParams { @@ -33,7 +31,7 @@ public class DefaultConfigParamsImpl implements ConfigParams { private static final int JOURNAL_RECOVERY_LOG_BATCH_SIZE = 1000; /** - * The maximum election time variance + * The maximum election time variance. */ private static final int ELECTION_TIME_MAX_VARIANCE = 100; @@ -42,8 +40,9 @@ public class DefaultConfigParamsImpl implements ConfigParams { /** * The interval at which a heart beat message will be sent to the remote - * RaftActor - *
+ * RaftActor. + * + *
* Since this is set to 100 milliseconds the Election timeout should be
* at least 200 milliseconds
*/
@@ -78,7 +77,7 @@ public class DefaultConfigParamsImpl implements ConfigParams {
this.snapshotBatchCount = snapshotBatchCount;
}
- public void setSnapshotDataThresholdPercentage(int snapshotDataThresholdPercentage){
+ public void setSnapshotDataThresholdPercentage(int snapshotDataThresholdPercentage) {
this.snapshotDataThresholdPercentage = snapshotDataThresholdPercentage;
}
@@ -94,15 +93,16 @@ public class DefaultConfigParamsImpl implements ConfigParams {
this.isolatedLeaderCheckInterval = isolatedLeaderCheckInterval.toMillis();
}
- public void setElectionTimeoutFactor(long electionTimeoutFactor){
+ public void setElectionTimeoutFactor(long electionTimeoutFactor) {
this.electionTimeoutFactor = electionTimeoutFactor;
electionTimeOutInterval = null;
}
- public void setCustomRaftPolicyImplementationClass(String customRaftPolicyImplementationClass){
+ public void setCustomRaftPolicyImplementationClass(String customRaftPolicyImplementationClass) {
this.customRaftPolicyImplementationClass = customRaftPolicyImplementationClass;
}
+ @Override
public String getCustomRaftPolicyImplementationClass() {
return customRaftPolicyImplementationClass;
}
@@ -125,7 +125,7 @@ public class DefaultConfigParamsImpl implements ConfigParams {
@Override
public FiniteDuration getElectionTimeOutInterval() {
- if(electionTimeOutInterval == null) {
+ if (electionTimeOutInterval == null) {
electionTimeOutInterval = getHeartBeatInterval().$times(electionTimeoutFactor);
}
@@ -162,24 +162,25 @@ public class DefaultConfigParamsImpl implements ConfigParams {
return policySupplier.get();
}
- private class PolicySupplier implements Supplier