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 Detail

      • BACKUP_DIR_PREFIX

        static final java.lang.String BACKUP_DIR_PREFIX
        The prefix for each persistence backup directory. The backup sequence is appended to this prefix.
        See Also:
        Constant Field Values
    • Method Detail

      • backup

        void backup()
        Attempts to perform a cluster-wide data backup. Each node will create a directory under the defined backup dir with the name BACKUP_DIR_PREFIX followed 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 name BACKUP_DIR_PREFIX followed by the backupSeq. 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:
        true if backup is enabled, false otherwise
        Since:
        5.0
      • getBackupDirectory

        java.lang.String getBackupDirectory()
        Returns the persistence backup directory.
        Returns:
        persistence backup directory if backup is enabled, null otherwise.
        Since:
        5.0