Class BackupApiRequestHandler
java.lang.Object
io.camunda.zeebe.scheduler.Actor
io.camunda.zeebe.broker.transport.AsyncApiRequestHandler<BackupApiRequestReader,BackupApiResponseWriter>
io.camunda.zeebe.broker.transport.backupapi.BackupApiRequestHandler
- All Implemented Interfaces:
DiskSpaceUsageListener,AsyncClosable,ConcurrencyControl,RequestHandler,AutoCloseable
public final class BackupApiRequestHandler
extends AsyncApiRequestHandler<BackupApiRequestReader,BackupApiResponseWriter>
implements DiskSpaceUsageListener
Request handler to handle commands and queries related to the backup (
RequestType.BACKUP)-
Nested Class Summary
Nested classes/interfaces inherited from class io.camunda.zeebe.broker.transport.AsyncApiRequestHandler
AsyncApiRequestHandler.RequestReader<T extends org.agrona.sbe.MessageDecoderFlyweight>, AsyncApiRequestHandler.ResponseWriterNested classes/interfaces inherited from class io.camunda.zeebe.scheduler.Actor
Actor.ActorBuilder -
Field Summary
Fields inherited from class io.camunda.zeebe.broker.transport.AsyncApiRequestHandler
LOGFields inherited from class io.camunda.zeebe.scheduler.Actor
actor, ACTOR_PROP_NAME, ACTOR_PROP_PARTITION_ID -
Constructor Summary
ConstructorsConstructorDescriptionBackupApiRequestHandler(AtomixServerTransport transport, LogStreamWriter logStreamWriter, BackupManager backupManager, int partitionId, boolean backupFeatureEnabled) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected ActorFuture<Either<ErrorResponseWriter,BackupApiResponseWriter>> handleAsync(int requestStreamId, long requestId, BackupApiRequestReader requestReader, BackupApiResponseWriter responseWriter, ErrorResponseWriter errorWriter) Handles a request.voidWill be called when disk space usage goes below the threshold after it was above it.voidWill be called when disk space usage grows above the thresholdMethods inherited from class io.camunda.zeebe.broker.transport.AsyncApiRequestHandler
onRequestMethods inherited from class io.camunda.zeebe.scheduler.Actor
buildActorName, closeAsync, createContext, getContext, getName, handleFailure, isActorClosed, newActor, onActorClosed, onActorCloseRequested, onActorClosing, onActorFailed, onActorStarted, onActorStarting, run, runOnCompletion, wrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.camunda.zeebe.scheduler.ConcurrencyControl
createCompletedFuture, createFuture
-
Constructor Details
-
BackupApiRequestHandler
public BackupApiRequestHandler(AtomixServerTransport transport, LogStreamWriter logStreamWriter, BackupManager backupManager, int partitionId, boolean backupFeatureEnabled)
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classActor
-
handleAsync
protected ActorFuture<Either<ErrorResponseWriter,BackupApiResponseWriter>> handleAsync(int requestStreamId, long requestId, BackupApiRequestReader requestReader, BackupApiResponseWriter responseWriter, ErrorResponseWriter errorWriter) Description copied from class:AsyncApiRequestHandlerHandles a request. The is populated at this point.- Specified by:
handleAsyncin classAsyncApiRequestHandler<BackupApiRequestReader,BackupApiResponseWriter> - Parameters:
requestStreamId- the current partition idrequestId- the current request idrequestReader- areaderthat is already populated with the request dataresponseWriter- awriterthat can be used to write successful responseserrorWriter- aErrorResponseWriterthat can be used to write error responses- Returns:
- a
ErrorResponseWriterwhen the handling failed, or aResponseWriterwhen the handling was successful. Writes to the other writer will be ignored and are not sent as a response.
-
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
-