Bug:3260-Recovery misses flows installed on single node
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / ReplicatedLog.java
index 82d0839bee772bd8efba88a8d1392ab1d336ff1c..0ad1df3c33bb6433e5ddf0afca46f5f4920d2882 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.controller.cluster.raft;
 
+import akka.japi.Procedure;
 import java.util.List;
 
 /**
@@ -50,8 +51,9 @@ public interface ReplicatedLog {
      * information
      *
      * @param index the index of the log entry
+     * @return the adjusted index of the first log entry removed or -1 if log entry not found.
      */
-    void removeFrom(long index);
+    long removeFrom(long index);
 
 
     /**
@@ -85,6 +87,8 @@ public interface ReplicatedLog {
      */
     void appendAndPersist(final ReplicatedLogEntry replicatedLogEntry);
 
+    void appendAndPersist(ReplicatedLogEntry replicatedLogEntry, Procedure<ReplicatedLogEntry> callback);
+
     /**
      *
      * @param index the index of the log entry
@@ -177,4 +181,10 @@ public interface ReplicatedLog {
      */
     int dataSize();
 
+    /**
+     * We decide if snapshot need to be captured based on the count/memory consumed.
+     * @param replicatedLogEntry
+     */
+    void captureSnapshotIfReady(ReplicatedLogEntry replicatedLogEntry);
+
 }