public class BackupExecutor extends Object implements com.hazelcast.nio.Disposable
inProgress() method.
Repeated calls of run(BackupTask) will run just one backup task. The currently running task can be
interrupted by calling the dispose() method.
An instance of this class can be reused by calling run(BackupTask) with a new backup task.| Constructor and Description |
|---|
BackupExecutor() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
long |
getBackupTaskMaxChunkSeq()
Returns the maximum chunk seq that the last submitted task will or has backed up
|
com.hazelcast.hotrestart.BackupTaskState |
getBackupTaskState()
Returns the current state of the last backup task
|
boolean |
inProgress()
Returns if the backup task is in progress.
|
void |
interruptBackupTask(boolean waitForCompletion)
Interrupts the backup task if one is currently running.
|
boolean |
isBackupTaskDone()
Returns true if the backup task is done (successfully or with failure) or if there is no submitted backup task
|
boolean |
prepareForNewTask()
If there is no currently running task, makes a reservation so that following invocations of
getBackupTaskState()
return BackupTaskState.NOT_STARTED. |
void |
run(BackupTask task)
Runs the backup task.
|
public void run(BackupTask task)
dispose(). This method should be run from a single thread.task - the backup task to be runpublic void dispose()
dispose in interface com.hazelcast.nio.Disposablepublic void interruptBackupTask(boolean waitForCompletion)
waitForCompletion - should this thread block until the backup thread terminatespublic boolean inProgress()
public boolean prepareForNewTask()
getBackupTaskState()
return BackupTaskState.NOT_STARTED. If invoked concurrently, only one invocation will return true,
thus enabling prevention of concurrent backup task runs.public com.hazelcast.hotrestart.BackupTaskState getBackupTaskState()
public long getBackupTaskMaxChunkSeq()
public boolean isBackupTaskDone()
Copyright © 2022 Hazelcast, Inc.. All Rights Reserved.