Bug 7362: Notify applyState synchronously
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / RaftActorContext.java
index 2896c44a2cef79ef12e002a5332b414e3368e4db..74a214f90ae14715c8053b2c9dcec204c6b2b80b 100644 (file)
@@ -16,10 +16,12 @@ import akka.cluster.Cluster;
 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.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;
@@ -316,4 +318,12 @@ public interface RaftActorContext {
      * @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();
 }