Fix warnings and javadocs in sal-akka-raft
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / ConfigParams.java
index 4c6434aec457db0b4899973f36effd0b37e7d14a..26a828b9b0e4f829b42f105771977fbe76fb838d 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.controller.cluster.raft;
 
+import javax.annotation.Nonnull;
+import org.opendaylight.controller.cluster.raft.policy.RaftPolicy;
 import scala.concurrent.duration.FiniteDuration;
 
 /**
@@ -21,35 +23,93 @@ import scala.concurrent.duration.FiniteDuration;
  */
 public interface ConfigParams {
     /**
-     * The minimum number of entries to be present in the in-memory Raft log
-     * for a snapshot to be taken
+     * Returns the minimum number of entries to be present in the in-memory Raft log for a snapshot to be taken.
      *
-     * @return long
+     * @return the minimum number of entries.
      */
-    public long getSnapshotBatchCount();
+    long getSnapshotBatchCount();
 
     /**
-     * The interval at which a heart beat message will be sent to the remote
-     * RaftActor
+     * Returns the percentage of total memory used in the in-memory Raft log before a snapshot should be taken.
      *
-     * @return FiniteDuration
+     * @return the percentage.
      */
-    public FiniteDuration getHeartBeatInterval();
+    int getSnapshotDataThresholdPercentage();
 
     /**
-     * The interval in which a new election would get triggered if no leader is found
+     * Returns the interval at which a heart beat message should be sent to remote followers.
      *
-     * Normally its set to atleast twice the heart beat interval
+     * @return the interval as a FiniteDuration.
+     */
+    FiniteDuration getHeartBeatInterval();
+
+    /**
+     * Returns the interval after which a new election should be triggered if no leader is available.
+     *
+     * @return the interval as a FiniteDuration.
+     */
+    FiniteDuration getElectionTimeOutInterval();
+
+    /**
+     * Returns the maximum election time variance. The election is scheduled using both the election timeout and variance.
+     *
+     * @return the election time variance.
+     */
+    int getElectionTimeVariance();
+
+    /**
+     * Returns the maximum size (in bytes) for the snapshot chunk sent from a Leader.
+     *
+     * @return the maximum size (in bytes).
+     */
+    int getSnapshotChunkSize();
+
+    /**
+     * Returns the maximum number of journal log entries to batch on recovery before applying.
+     *
+     * @return the maximum number of journal log entries.
+     */
+    int getJournalRecoveryLogBatchSize();
+
+    /**
+     * Returns the interval in which the leader needs to check if its isolated.
      *
-     * @return FiniteDuration
+     * @return the interval in ms.
      */
-    public FiniteDuration getElectionTimeOutInterval();
+    long getIsolatedCheckIntervalInMillis();
+
 
     /**
-     * The maximum election time variance. The election is scheduled using both
-     * the Election Timeout and Variance
+     * Returns the multiplication factor to be used to determine the shard election timeout. The election timeout
+     * is determined by multiplying the election timeout factor with the heart beat duration.
      *
-     * @return int
+     * @return the election timeout factor.
      */
-    public int getElectionTimeVariance();
+    long getElectionTimeoutFactor();
+
+
+    /**
+     * 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.
+     */
+    @Nonnull
+    RaftPolicy getRaftPolicy();
+
+    /**
+     * Returns the PeerAddressResolver.
+     *
+     * @return the PeerAddressResolver instance.
+     */
+    @Nonnull
+    PeerAddressResolver getPeerAddressResolver();
+
+    /**
+     * Returns the custom RaftPolicy class name.
+     *
+     * @return the RaftPolicy class name or null if none set.
+     */
+    String getCustomRaftPolicyImplementationClass();
+
 }