Class BackupService
java.lang.Object
io.camunda.zeebe.scheduler.Actor
io.camunda.zeebe.backup.management.BackupService
- All Implemented Interfaces:
BackupManager,AsyncClosable,ConcurrencyControl,AutoCloseable
Backup manager that takes and manages backup asynchronously
-
Nested Class Summary
Nested classes/interfaces inherited from class io.camunda.zeebe.scheduler.Actor
Actor.ActorBuilder -
Field Summary
Fields inherited from class io.camunda.zeebe.scheduler.Actor
actor, ACTOR_PROP_NAME, ACTOR_PROP_PARTITION_ID -
Constructor Summary
ConstructorsConstructorDescriptionBackupService(int nodeId, int partitionId, int numberOfPartitions, BackupStore backupStore, PersistedSnapshotStore snapshotStore, Path segmentsDirectory, Predicate<Path> isSegmentsFile) -
Method Summary
Modifier and TypeMethodDescriptiondeleteBackup(long checkpointId) Deletes the backup.voidfailInProgressBackup(long lastCheckpointId) getBackupStatus(long checkpointId) Get the status of the backupgetName()Get all available backups where status is one ofBackupStatusCode.COMPLETED,BackupStatusCode.FAILED,BackupStatusCode.IN_PROGRESSprotected voidvoidtakeBackup(long checkpointId, long checkpointPosition) Takes backup with id checkpointId.Methods inherited from class io.camunda.zeebe.scheduler.Actor
buildActorName, buildActorName, close, closeAsync, createContext, getContext, handleFailure, isActorClosed, newActor, onActorClosed, onActorCloseRequested, 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.backup.api.BackupManager
closeAsyncMethods inherited from interface io.camunda.zeebe.scheduler.ConcurrencyControl
createCompletedFuture, createFuture
-
Constructor Details
-
BackupService
public BackupService(int nodeId, int partitionId, int numberOfPartitions, BackupStore backupStore, PersistedSnapshotStore snapshotStore, Path segmentsDirectory, Predicate<Path> isSegmentsFile)
-
-
Method Details
-
getName
-
onActorClosing
protected void onActorClosing()- Overrides:
onActorClosingin classActor
-
takeBackup
public void takeBackup(long checkpointId, long checkpointPosition) Description copied from interface:BackupManagerTakes backup with id checkpointId. The method returns immediately after triggering the backup.BackupManager.getBackupStatus(long)must be used to check if the backup is completed or not. If a completed backup with same id already exists, no new backup will be taken.The implementation of this method should be non-blocking to not block the caller.
- Specified by:
takeBackupin interfaceBackupManager- Parameters:
checkpointId- id of the backupcheckpointPosition- position of the record until which must be included in the backup.
-
getBackupStatus
Description copied from interface:BackupManagerGet the status of the backup- Specified by:
getBackupStatusin interfaceBackupManager- Returns:
- backup status
-
listBackups
Description copied from interface:BackupManagerGet all available backups where status is one ofBackupStatusCode.COMPLETED,BackupStatusCode.FAILED,BackupStatusCode.IN_PROGRESS- Specified by:
listBackupsin interfaceBackupManager- Returns:
- a collection of backup status
-
deleteBackup
Description copied from interface:BackupManagerDeletes the backup.- Specified by:
deleteBackupin interfaceBackupManager- Returns:
- future which will be completed after the backup is deleted.
-
failInProgressBackup
public void failInProgressBackup(long lastCheckpointId) - Specified by:
failInProgressBackupin interfaceBackupManager
-