Package org.apache.ignite

## Interface IgniteSnapshot

-     public interface IgniteSnapshot

  This interface provides functionality for creating cluster-wide cache data snapshots.

  Current limitations:

  - Snapshot will trigger PME (partition map exchange) to run itself.
  - Snapshot will be taken from all registered persistence caches to grantee data consistency between them.
  - Snapshot must be resorted manually on the switched off cluster by copying data to the working directory on each cluster node.
  - Concurrent updates from `IgniteDataStreamer` with default `IgniteDataStreamer.allowOverwrite()` setting (false) into a persistent cache can cause that cache data stored inconsistent.
  You can create cache dump, also. Cache dump is consistent files consist of entry by entry cache content. This type of snapshots supports in-memory caches.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `IgniteFuture<Void>` | `cancelSnapshot​(String name)` | Cancel running snapshot operation.
    `IgniteFuture<Boolean>` | `cancelSnapshotRestore​(String name)` | Cancel snapshot restore operation.
    `IgniteFuture<Void>` | `createDump​(String name, @Nullable Collection<String> cacheGroupNames)` | Creates cache groups dump.
    `IgniteFuture<Void>` | `createIncrementalSnapshot​(String snapshotName)` | Create an incremental snapshot for an existing snapshot.
    `IgniteFuture<Void>` | `createSnapshot​(String name)` | Create a consistent copy of all persistence cache groups from the whole cluster.
    `IgniteFuture<Void>` | `restoreSnapshot​(String name, @Nullable Collection<String> cacheGroupNames)` | Restore cache group(s) from the snapshot.
    `IgniteFuture<Void>` | `restoreSnapshot​(String name, @Nullable Collection<String> cacheGroupNames, int incIdx)` | Restore cache group(s) from the snapshot and its increments.

- - ### Method Detail

    - #### createSnapshot

          IgniteFuture<Void> createSnapshot​(String name)

      Create a consistent copy of all persistence cache groups from the whole cluster.
      Parameters:
        `name` - Snapshot unique name which satisfies the following name pattern [a-zA-Z0-9_].
      Returns:
        Future which will be completed when the process ends.

    - #### createIncrementalSnapshot

          IgniteFuture<Void> createIncrementalSnapshot​(String snapshotName)

      Create an incremental snapshot for an existing snapshot.
      Parameters:
        `snapshotName` - Snapshot name.
      Returns:
        Future which will be completed when the process ends.

    - #### cancelSnapshot

          IgniteFuture<Void> cancelSnapshot​(String name)

      Cancel running snapshot operation. All intermediate results of cancelled snapshot operation will be deleted. If snapshot already created this command will have no effect.
      Parameters:
        `name` - Snapshot name to cancel.
      Returns:
        Future which will be completed when cancel operation finished.

    - #### createDump

          IgniteFuture<Void> createDump​(String name,
                                        @Nullable
                                        @Nullable Collection<String> cacheGroupNames)

      Creates cache groups dump. Dump is consistent entry by entry backup of cache group content. In-memory cache groups also supported.
      Parameters:
        `name` - Dump name.
        `cacheGroupNames` - Cache groups to include in snapshot or `null` to include all.
      Returns:
        Future which will be completed when dump ends.

    - #### restoreSnapshot

          IgniteFuture<Void> restoreSnapshot​(String name,
                                             @Nullable
                                             @Nullable Collection<String> cacheGroupNames)

      Restore cache group(s) from the snapshot.

      NOTE: Cache groups to be restored from the snapshot must not present in the cluster, if they present, they must be destroyed by the user (eg with `IgniteCache.destroy()`) before starting this operation.

      Parameters:
        `name` - Snapshot name.
        `cacheGroupNames` - Cache groups to be restored or `null` to restore all cache groups from the snapshot.
      Returns:
        Future which will be completed when restore operation finished.

    - #### restoreSnapshot

          IgniteFuture<Void> restoreSnapshot​(String name,
                                             @Nullable
                                             @Nullable Collection<String> cacheGroupNames,
                                             int incIdx)

      Restore cache group(s) from the snapshot and its increments. Snapshot is restored first and after that all increments are restored sequentially from the `1` to the specified `incIdx`.

      NOTE: Cache groups to be restored from the snapshot must not present in the cluster, if they present, they must be destroyed by the user (eg with `IgniteCache.destroy()`) before starting this operation.

      Parameters:
        `name` - Snapshot name.
        `cacheGroupNames` - Cache groups to be restored or `null` to restore all cache groups from the snapshot.
        `incIdx` - Index of incremental snapshot.
      Returns:
        Future which will be completed when restore operation finished.

    - #### cancelSnapshotRestore

          IgniteFuture<Boolean> cancelSnapshotRestore​(String name)

      Cancel snapshot restore operation.
      Parameters:
        `name` - Snapshot name.
      Returns:
        Future that will be finished when the process is complete on all nodes. The result of this future will be `false` if the restore process with the specified snapshot name is not running at all.