import com.google.common.annotations.VisibleForTesting;
import java.util.Collection;
import java.util.Optional;
+import java.util.function.Consumer;
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.raft.base.messages.ApplyState;
import org.opendaylight.controller.cluster.raft.behaviors.RaftActorBehavior;
import org.opendaylight.controller.cluster.raft.persisted.ServerConfigurationPayload;
import org.opendaylight.controller.cluster.raft.policy.RaftPolicy;
* @return current behavior.
*/
RaftActorBehavior getCurrentBehavior();
+
+ /**
+ * Returns the consumer of ApplyState operations. This is invoked by a behavior when a log entry needs to be
+ * applied to the state.
+ *
+ * @return the Consumer
+ */
+ Consumer<ApplyState> getApplyStateConsumer();
+
+ /**
+ * Creates a FileBackedOutputStream with a common configuration.
+ *
+ * @return a FileBackedOutputStream instance
+ */
+ @Nonnull
+ FileBackedOutputStream newFileBackedOutputStream();
+
+ /**
+ * 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);
}