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%2FConfigParams.java;h=8d6b965d9bc7950727b47104da5b9a7db42dc3f1;hp=26a828b9b0e4f829b42f105771977fbe76fb838d;hb=b25ae9347455b1bae8f25424a9ceffc017f2f0db;hpb=c9943f5bc72d4cde9356d3bd4cf73d36f4b2f754 diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ConfigParams.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ConfigParams.java index 26a828b9b0..8d6b965d9b 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ConfigParams.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ConfigParams.java @@ -13,15 +13,19 @@ import scala.concurrent.duration.FiniteDuration; /** * Configuration Parameter interface for configuring the Raft consensus system - *

+ * + *

* Any component using this implementation might want to provide an implementation of * this interface to configure * + *

* A default implementation will be used if none is provided. * * @author Kamal Rameshan */ public interface ConfigParams { + int MEGABYTE = 1048576; + /** * Returns the minimum number of entries to be present in the in-memory Raft log for a snapshot to be taken. * @@ -51,7 +55,8 @@ public interface ConfigParams { FiniteDuration getElectionTimeOutInterval(); /** - * Returns the maximum election time variance. The election is scheduled using both the election timeout and variance. + * Returns the maximum election time variance. The election is scheduled using both the election timeout + * and variance. * * @return the election time variance. */ @@ -91,8 +96,7 @@ public interface ConfigParams { /** * Returns the RaftPolicy used to determine certain Raft behaviors. * - * @return an instance of org.opendaylight.controller.cluster.raft.policy.RaftPolicy, if set, or an instance of the - * DefaultRaftPolicy. + * @return an instance of RaftPolicy, if set, or an instance of the DefaultRaftPolicy. */ @Nonnull RaftPolicy getRaftPolicy(); @@ -112,4 +116,27 @@ public interface ConfigParams { */ String getCustomRaftPolicyImplementationClass(); + /** + * Returns the directory in which to create temp files. + * + * @return the directory in which to create temp files. + */ + @Nonnull + String getTempFileDirectory(); + + /** + * Returns the threshold in terms of number of bytes when streaming data before it should switch from storing in + * memory to buffering to a file. + * + * @return the threshold in terms of number of bytes. + */ + int getFileBackedStreamingThreshold(); + + /** + * Returns the threshold in terms of number journal entries that we can lag behind a leader until we raise a + * 'not synced' transition. + * + * @return the threshold in terms of number of journal entries. + */ + long getSyncIndexThreshold(); }