Class StreamProcessorTransitionStep

java.lang.Object
io.camunda.zeebe.broker.system.partitions.impl.steps.StreamProcessorTransitionStep
All Implemented Interfaces:
PartitionTransitionStep

public final class StreamProcessorTransitionStep extends Object implements PartitionTransitionStep
  • Constructor Details

  • Method Details

    • onNewRaftRole

      public void onNewRaftRole(PartitionTransitionContext context, RaftServer.Role newRole)
      Description copied from interface: PartitionTransitionStep
      This method is called immediately after the new Raft role is known. It is expected that this method completes instantly. It is called on all steps.

      Steps are expected to pause any active requests and assume a neutral stance after this method is called. After all steps have been notified, the first steps' transitionTo(...) will be called, and then subsequently all other steps. This means that during the time between the call to the method and the call to transitionTo(...) some preceding steps may have already transitioned, but others are still waiting for transition.

      To summarize, after this method is called, the partition is in an undefined state. And as soon as transitionTo(...) is called the partition has completed all transition steps up to this point

      Note, that this may also be called while a transition is currently running, for example if the raft partition transitions faster than the Zeebe partition. In this case steps are encouraged to cancel what they are doing

      Specified by:
      onNewRaftRole in interface PartitionTransitionStep
      newRole - target role to transition to
    • prepareTransition

      public ActorFuture<Void> prepareTransition(PartitionTransitionContext context, long term, RaftServer.Role targetRole)
      Description copied from interface: PartitionTransitionStep
      This method is a hook to prepare steps for a pending transition. This method is deprecated because eventually we want ro remove it. Once removed, all steps need to take the necessary preparatory steps as part of newRaftRole(...).

      For a time being, however, this method will be supported. Steps will be called in reverse order and are expected to take any steps to assume a neutral stance

      Specified by:
      prepareTransition in interface PartitionTransitionStep
    • transitionTo

      public ActorFuture<Void> transitionTo(PartitionTransitionContext context, long term, RaftServer.Role targetRole)
      Description copied from interface: PartitionTransitionStep
      This method is called to start the actual transition
      Specified by:
      transitionTo in interface PartitionTransitionStep
    • getName

      public String getName()
      Specified by:
      getName in interface PartitionTransitionStep
      Returns:
      A log-friendly identification of the PartitionTransitionStep.