Interface PartitionListener

All Known Implementing Classes:
BrokerHealthCheckService, CommandApiServiceImpl, TopologyManagerImpl

public interface PartitionListener
Can be implemented and used to react on partition role changes, like on Leader on Actor should be started and on Follower one should be removed. If this listener performs actions that are critical to the progress of a partition, it is expected to complete the future exceptionally on a failure. Otherwise the future should complete normally.
  • Method Details

    • onBecomingFollower

      ActorFuture<Void> onBecomingFollower(int partitionId, long term)
      Is called by the ZeebePartition on becoming partition follower after all partition installation/clean up related things are done.
      Parameters:
      partitionId - the corresponding partition id
      term - the current term
      Returns:
      future that should be completed by the listener
    • onBecomingLeader

      ActorFuture<Void> onBecomingLeader(int partitionId, long term, @Deprecated LogStream logStream, QueryService queryService)
      Is called by the ZeebePartition on becoming partition leader after all partition installation/clean up related things are done.
      Parameters:
      partitionId - the corresponding partition id
      term - the current term
      logStream - the corresponding log stream
      queryService - the corresponding query service
      Returns:
      future that should be completed by the listener
    • onBecomingInactive

      ActorFuture<Void> onBecomingInactive(int partitionId, long term)
      Is called by the ZeebePartition on becoming inactive after a Raft role change or a failed transition.
      Parameters:
      partitionId - the corresponding partition id
      term - the current term
      Returns:
      future that should be completed by the listener