BUG-8618: make sync threshold tuneable
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / ConfigParams.java
index 652771b4f1c6c6250600e0463ee8242520692757..8d6b965d9bc7950727b47104da5b9a7db42dc3f1 100644 (file)
@@ -13,15 +13,19 @@ import scala.concurrent.duration.FiniteDuration;
 
 /**
  * Configuration Parameter interface for configuring the Raft consensus system
- * <p/>
+ *
+ * <p>
  * Any component using this implementation might want to provide an implementation of
  * this interface to configure
- * <p/>
+ *
+ * <p>
  * 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.
      *
@@ -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();
 }