Class SnapshotRestoreProcess


  • public class SnapshotRestoreProcess
    extends Object
    Distributed process to restore cache group from the snapshot.
    • Field Detail

      • TMP_CACHE_DIR_PREFIX

        public static final String TMP_CACHE_DIR_PREFIX
        Temporary cache directory prefix.
        See Also:
        Constant Field Values
      • SNAPSHOT_RESTORE_METRICS

        public static final String SNAPSHOT_RESTORE_METRICS
        Snapshot restore metrics prefix.
        See Also:
        Constant Field Values
    • Constructor Detail

    • Method Detail

      • registerMetrics

        protected void registerMetrics()
        Register local metrics.
      • start

        public IgniteFutureImpl<Void> start​(String snpName,
                                            @Nullable
                                            @Nullable String snpPath,
                                            @Nullable
                                            @Nullable Collection<String> cacheGrpNames,
                                            int incIdx,
                                            boolean check)
        Start cache group restore operation.
        Parameters:
        snpName - Snapshot name.
        snpPath - Snapshot directory path.
        cacheGrpNames - Cache groups to be restored or null to restore all cache groups from the snapshot.
        incIdx - Index of incremental snapshot.
        check - If true check snapshot before restore.
        Returns:
        Future that will be completed when the restore operation is complete and the cache groups are started.
      • restoringSnapshotName

        @Nullable
        public @Nullable String restoringSnapshotName()
        Get the name of the snapshot currently being restored
        Returns:
        Name of the snapshot currently being restored or null if the restore process is not running.
      • isRestoring

        public boolean isRestoring​(CacheConfiguration<?,​?> ccfg)
        Parameters:
        ccfg - Cache configuration.
        Returns:
        True if the cache or group with the specified name is currently being restored.
      • cacheStartRequiredAliveNodes

        public Set<UUID> cacheStartRequiredAliveNodes​(IgniteUuid reqId)
        Parameters:
        reqId - Request ID.
        Returns:
        Server nodes on which a successful start of the cache(s) is required, if any of these nodes fails when starting the cache(s), the whole procedure is rolled back.
      • onNodeLeft

        public void onNodeLeft​(UUID leftNodeId)
        Node left callback.
        Parameters:
        leftNodeId - Left node ID.
      • cancel

        public IgniteFuture<Boolean> cancel​(UUID reqId,
                                            @Deprecated
                                            String snpName)
        Cancel the currently running local restore procedure.
        Parameters:
        reqId - Snapshot operation request ID.
        snpName - Snapshot name.
        Returns:
        Future that will be finished when process the process is complete. The result of this future will be false if the restore process with the specified snapshot name is not running at all.
      • interrupt

        public void interrupt​(IgniteCheckedException reason)
        Interrupt the currently running local restore procedure.
        Parameters:
        reason - Interruption reason.