Package io.camunda.zeebe.broker
Interface PartitionListener
-
- All Known Implementing Classes:
BrokerHealthCheckService,CommandApiService,LeaderManagementRequestHandler,SubscriptionApiCommandMessageHandlerService,TopologyManagerImpl
public interface PartitionListenerCan 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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ActorFuture<Void>onBecomingFollower(int partitionId, long term)Is called by theZeebePartitionon becoming partition follower after all partition installation/clean up related things are done.ActorFuture<Void>onBecomingInactive(int partitionId, long term)Is called by theZeebePartitionon becoming inactive after a Raft role change or a failed transition.ActorFuture<Void>onBecomingLeader(int partitionId, long term, LogStream logStream)Is called by theZeebePartitionon becoming partition leader after all partition installation/clean up related things are done.
-
-
-
Method Detail
-
onBecomingFollower
ActorFuture<Void> onBecomingFollower(int partitionId, long term)
Is called by theZeebePartitionon becoming partition follower after all partition installation/clean up related things are done.- Parameters:
partitionId- the corresponding partition idterm- the current term- Returns:
- future that should be completed by the listener
-
onBecomingLeader
ActorFuture<Void> onBecomingLeader(int partitionId, long term, LogStream logStream)
Is called by theZeebePartitionon becoming partition leader after all partition installation/clean up related things are done.- Parameters:
partitionId- the corresponding partition idterm- the current termlogStream- the corresponding log stream- Returns:
- future that should be completed by the listener
-
onBecomingInactive
ActorFuture<Void> onBecomingInactive(int partitionId, long term)
Is called by theZeebePartitionon becoming inactive after a Raft role change or a failed transition.- Parameters:
partitionId- the corresponding partition idterm- the current term- Returns:
- future that should be completed by the listener
-
-