Class CommandApiService
- java.lang.Object
-
- io.camunda.zeebe.util.sched.Actor
-
- io.camunda.zeebe.broker.transport.commandapi.CommandApiService
-
- All Implemented Interfaces:
PartitionListener,DiskSpaceUsageListener,CloseableSilently,AsyncClosable,AutoCloseable
public final class CommandApiService extends Actor implements PartitionListener, DiskSpaceUsageListener
-
-
Constructor Summary
Constructors Constructor Description CommandApiService(ServerTransport serverTransport, BrokerInfo localBroker, PartitionAwareRequestLimiter limiter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()Consumer<TypedRecord>getOnProcessedListener(int partitionId)CommandResponseWriternewCommandResponseWriter()protected voidonActorClosing()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.voidonDiskSpaceAvailable()Will be called when disk space usage goes below the threshold after it was above it.voidonDiskSpaceNotAvailable()Will be called when disk space usage grows above the threshold-
Methods inherited from class io.camunda.zeebe.util.sched.Actor
buildActorName, buildActorName, close, closeAsync, handleFailure, isActorClosed, onActorClosed, onActorCloseRequested, onActorFailed, onActorStarted, onActorStarting, wrap
-
-
-
-
Constructor Detail
-
CommandApiService
public CommandApiService(ServerTransport serverTransport, BrokerInfo localBroker, PartitionAwareRequestLimiter limiter)
-
-
Method Detail
-
onActorClosing
protected void onActorClosing()
- Overrides:
onActorClosingin classActor
-
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
-
newCommandResponseWriter
public CommandResponseWriter newCommandResponseWriter()
-
getOnProcessedListener
public Consumer<TypedRecord> getOnProcessedListener(int partitionId)
-
onDiskSpaceNotAvailable
public void onDiskSpaceNotAvailable()
Description copied from interface:DiskSpaceUsageListenerWill be called when disk space usage grows above the threshold- Specified by:
onDiskSpaceNotAvailablein interfaceDiskSpaceUsageListener
-
onDiskSpaceAvailable
public void onDiskSpaceAvailable()
Description copied from interface:DiskSpaceUsageListenerWill be called when disk space usage goes below the threshold after it was above it.- Specified by:
onDiskSpaceAvailablein interfaceDiskSpaceUsageListener
-
-