Bump persisted PayloadVersion
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / persisted / Snapshot.java
index 42a4a8de810bd5a2b4d04d872b2e00620ff9bd07..091009e2bd31e3898af14552874bf6cc17597898 100644 (file)
@@ -31,6 +31,15 @@ public class Snapshot implements Serializable {
      * @author Thomas Pantelis
      */
     public interface State extends Serializable {
+        /**
+         * Indicate whether the snapshot requires migration, i.e. a new snapshot should be created after recovery.
+         * Default implementation returns false, i.e. do not re-snapshot.
+         *
+         * @return True if complete recovery based upon this snapshot should trigger a new snapshot.
+         */
+        default boolean needsMigration() {
+            return false;
+        }
     }
 
     private static final class Proxy implements Externalizable {