Package io.camunda.zeebe.broker
Interface PartitionListener
- All Known Implementing Classes:
BrokerHealthCheckService,CommandApiServiceImpl,RemoteJobStreamErrorHandlerService,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 Summary
Modifier and TypeMethodDescriptiononBecomingFollower(int partitionId, long term) Is called by theZeebePartitionon becoming partition follower after all partition installation/clean up related things are done.onBecomingInactive(int partitionId, long term) Is called by theZeebePartitionon becoming inactive after a Raft role change or a failed transition.onBecomingLeader(int partitionId, long term, LogStream logStream, QueryService queryService) Is called by theZeebePartitionon becoming partition leader after all partition installation/clean up related things are done.
-
Method Details
-
onBecomingFollower
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, @Deprecated LogStream logStream, QueryService queryService) 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 streamqueryService- the corresponding query service- Returns:
- future that should be completed by the listener
-
onBecomingInactive
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
-