Package com.hazelcast.persistence
Interface PersistenceService
- All Known Subinterfaces:
HotRestartService
public interface PersistenceService
Service for interacting with Persistence. For example - starting cluster-wide data backups, determining the
local backup state and interrupting a currently running local backup.
- Since:
- 5.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe prefix for each persistence backup directory. -
Method Summary
Modifier and TypeMethodDescriptionvoidbackup()Attempts to perform a cluster-wide data backup.voidbackup(long backupSeq) Attempts to perform a cluster-wide data backup.Returns the persistence backup directory.Returns the local backup task status (not the cluster backup status).voidInterrupts the backup tasks on each cluster member if one is currently running.voidInterrupts the local backup task if one is currently running.booleanReturns if backup is enabled.
-
Field Details
-
BACKUP_DIR_PREFIX
The prefix for each persistence backup directory. The backup sequence is appended to this prefix.- See Also:
-
-
Method Details
-
backup
void backup()Attempts to perform a cluster-wide data backup. Each node will create a directory under the defined backup dir with the nameBACKUP_DIR_PREFIXfollowed by the cluster time defined by this node. The backup request is performed transactionally. This method will throw an exception if another request (transaction) is already in progress. If a node is already performing a backup (there is a file indicating a backup is in progress), the node will only log a warning and ignore the backup request.- Since:
- 5.0
-
backup
void backup(long backupSeq) Attempts to perform a cluster-wide data backup. Each node will create a directory under the defined backup dir with the nameBACKUP_DIR_PREFIXfollowed by thebackupSeq. The backup request is performed transactionally. This method will throw an exception if another request (transaction) is already in progress. If a node is already performing a backup (there is a file indicating a backup is in progress), the node will only log a warning and ignore the backup request.- Parameters:
backupSeq- the suffix of the backup directory for this cluster backup- Since:
- 5.0
-
getBackupTaskStatus
BackupTaskStatus getBackupTaskStatus()Returns the local backup task status (not the cluster backup status).- Since:
- 5.0
-
interruptLocalBackupTask
void interruptLocalBackupTask()Interrupts the local backup task if one is currently running. The contents of the target backup directory will be left as-is.- Since:
- 5.0
-
interruptBackupTask
void interruptBackupTask()Interrupts the backup tasks on each cluster member if one is currently running. The contents of the target backup directories will be left as-is.- Since:
- 5.0
-
isBackupEnabled
boolean isBackupEnabled()Returns if backup is enabled.- Returns:
trueif backup is enabled,falseotherwise- Since:
- 5.0
-
getBackupDirectory
String getBackupDirectory()Returns the persistence backup directory.- Returns:
- persistence backup directory if backup is enabled,
nullotherwise. - Since:
- 5.0
-