Add specific serializer for SimpleReplicatedLogEntry
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / RaftActorContext.java
index 1d59ed1f85da6b5d572d71bbe550ac608eea2ec0..aed050c3c04ee4e15afa9bb907d9887d556bb33f 100644 (file)
@@ -21,7 +21,7 @@ import java.util.function.LongSupplier;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import org.opendaylight.controller.cluster.DataPersistenceProvider;
-import org.opendaylight.controller.cluster.io.FileBackedOutputStream;
+import org.opendaylight.controller.cluster.io.FileBackedOutputStreamFactory;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplyState;
 import org.opendaylight.controller.cluster.raft.behaviors.RaftActorBehavior;
 import org.opendaylight.controller.cluster.raft.persisted.ServerConfigurationPayload;
@@ -329,10 +329,25 @@ public interface RaftActorContext {
     Consumer<ApplyState> getApplyStateConsumer();
 
     /**
-     * Creates a FileBackedOutputStream with a common configuration.
+     * Returns the {@link FileBackedOutputStreamFactory} instance with a common configuration.
      *
-     * @return a FileBackedOutputStream instance
+     * @return the {@link FileBackedOutputStreamFactory};
      */
     @Nonnull
-    FileBackedOutputStream newFileBackedOutputStream();
+    FileBackedOutputStreamFactory getFileBackedOutputStreamFactory();
+
+    /**
+     * Returns the RaftActorLeadershipTransferCohort if leadership transfer is in progress.
+     *
+     * @return the RaftActorLeadershipTransferCohort if leadership transfer is in progress, null otherwise
+     */
+    @Nullable
+    RaftActorLeadershipTransferCohort getRaftActorLeadershipTransferCohort();
+
+    /**
+     * Sets the RaftActorLeadershipTransferCohort for transferring leadership.
+     *
+     * @param leadershipTransferCohort the RaftActorLeadershipTransferCohort or null to clear the existing one
+     */
+    void setRaftActorLeadershipTransferCohort(@Nullable RaftActorLeadershipTransferCohort leadershipTransferCohort);
 }