X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FRaftActorRecoveryCohort.java;h=c3760472ac2a11614b1bbb55ad64578deb21dc8f;hb=refs%2Fchanges%2F65%2F45865%2F4;hp=a9f00aa80bcb93621d6f1ef3fadb4695dbe3b8c5;hpb=3b2b1027ba6ab7bb1669466d1b7bdc0249809a08;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorRecoveryCohort.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorRecoveryCohort.java index a9f00aa80b..c3760472ac 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorRecoveryCohort.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorRecoveryCohort.java @@ -7,6 +7,7 @@ */ package org.opendaylight.controller.cluster.raft; +import javax.annotation.Nullable; import org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload; /** @@ -19,6 +20,8 @@ public interface RaftActorRecoveryCohort { /** * This method is called during recovery at the start of a batch of state entries. Derived * classes should perform any initialization needed to start a batch. + * + * @param maxBatchSize the maximum batch size. */ void startLogRecoveryBatch(int maxBatchSize); @@ -42,4 +45,12 @@ public interface RaftActorRecoveryCohort { * log entries. This method is called after {@link #appendRecoveredLogEntry}. */ void applyCurrentLogRecoveryBatch(); + + /** + * Returns the state snapshot to restore from on recovery. + * + * @return the snapshot bytes or null if there's no snapshot to restore + */ + @Nullable + byte[] getRestoreFromSnapshot(); }