Class TopologyManagerImpl
- java.lang.Object
-
- io.camunda.zeebe.util.sched.Actor
-
- io.camunda.zeebe.broker.clustering.topology.TopologyManagerImpl
-
- All Implemented Interfaces:
ClusterMembershipEventListener,EventFilter<ClusterMembershipEvent>,EventListener<ClusterMembershipEvent>,TopologyManager,PartitionListener,CloseableSilently,AsyncClosable,AutoCloseable
public final class TopologyManagerImpl extends Actor implements TopologyManager, ClusterMembershipEventListener, PartitionListener
-
-
Constructor Summary
Constructors Constructor Description TopologyManagerImpl(Atomix atomix, BrokerInfo localBroker, ClusterCfg clusterCfg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTopologyPartitionListener(TopologyPartitionListener listener)voidevent(ClusterMembershipEvent clusterMembershipEvent)StringgetName()protected voidonActorStarted()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.voidonHealthChanged(int partitionId, HealthStatus status)voidremoveTopologyPartitionListener(TopologyPartitionListener listener)ActorFuture<Void>setFollower(int partitionId)ActorFuture<Void>setInactive(int partitionId)ActorFuture<Void>setLeader(long term, int partitionId)-
Methods inherited from class io.camunda.zeebe.util.sched.Actor
buildActorName, buildActorName, close, closeAsync, handleFailure, isActorClosed, onActorClosed, onActorCloseRequested, onActorClosing, onActorFailed, onActorStarting, wrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.atomix.utils.event.EventFilter
isRelevant
-
-
-
-
Constructor Detail
-
TopologyManagerImpl
public TopologyManagerImpl(Atomix atomix, BrokerInfo localBroker, ClusterCfg clusterCfg)
-
-
Method Detail
-
onBecomingFollower
public ActorFuture<Void> onBecomingFollower(int partitionId, long term)
Description copied from interface:PartitionListenerIs called by theZeebePartitionon becoming partition follower after all partition installation/clean up related things are done.- Specified by:
onBecomingFollowerin interfacePartitionListener- Parameters:
partitionId- the corresponding partition idterm- the current term- Returns:
- future that should be completed by the listener
-
onBecomingLeader
public ActorFuture<Void> onBecomingLeader(int partitionId, long term, LogStream logStream)
Description copied from interface:PartitionListenerIs called by theZeebePartitionon becoming partition leader after all partition installation/clean up related things are done.- Specified by:
onBecomingLeaderin interfacePartitionListener- Parameters:
partitionId- the corresponding partition idterm- the current termlogStream- the corresponding log stream- Returns:
- future that should be completed by the listener
-
onBecomingInactive
public ActorFuture<Void> onBecomingInactive(int partitionId, long term)
Description copied from interface:PartitionListenerIs called by theZeebePartitionon becoming inactive after a Raft role change or a failed transition.- Specified by:
onBecomingInactivein interfacePartitionListener- Parameters:
partitionId- the corresponding partition idterm- the current term- Returns:
- future that should be completed by the listener
-
onActorStarted
protected void onActorStarted()
- Overrides:
onActorStartedin classActor
-
setLeader
public ActorFuture<Void> setLeader(long term, int partitionId)
-
setFollower
public ActorFuture<Void> setFollower(int partitionId)
-
setInactive
public ActorFuture<Void> setInactive(int partitionId)
-
event
public void event(ClusterMembershipEvent clusterMembershipEvent)
- Specified by:
eventin interfaceEventListener<ClusterMembershipEvent>
-
removeTopologyPartitionListener
public void removeTopologyPartitionListener(TopologyPartitionListener listener)
- Specified by:
removeTopologyPartitionListenerin interfaceTopologyManager
-
addTopologyPartitionListener
public void addTopologyPartitionListener(TopologyPartitionListener listener)
- Specified by:
addTopologyPartitionListenerin interfaceTopologyManager
-
onHealthChanged
public void onHealthChanged(int partitionId, HealthStatus status)
-
-