Package org.apache.ignite.internal.processors.cache.persistence.snapshot.dump

## Class CreateDumpFutureTask

- java.lang.Object
- - org.apache.ignite.internal.util.future.GridFutureAdapter<T>
  - - org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractCreateSnapshotFutureTask
    - - org.apache.ignite.internal.processors.cache.persistence.snapshot.dump.CreateDumpFutureTask

All Implemented Interfaces:
  `IgniteInternalFuture<SnapshotFutureTaskResult>`, `DumpEntryChangeListener`

    public class CreateDumpFutureTask
    extends AbstractCreateSnapshotFutureTask
    implements DumpEntryChangeListener

Task creates cache group dump. Dump is a consistent snapshot of cache entries. Directories structure is same as a full snapshot but each partitions saved in "part-0.dump" file. Files structure is a set of `DumpEntry` written one by one.

See Also:
  `Dump`, `DumpEntry`

### Field Summary

Fields
`protected GridCacheSharedContext<?,​?>` `cctx` Shared context.
`static String` `DUMP_FILE_EXT` Dump files name.
`protected AtomicReference<Throwable>` `err` An exception which has been occurred during snapshot processing.
`protected IgniteLogger` `log` Ignite logger.
`protected Map<Integer,​Set<Integer>>` `parts` Partition to be processed.
`protected UUID` `reqId` Snapshot operation request ID.
`protected String` `snpName` Unique identifier of snapshot process.
`protected SnapshotSender` `snpSndr` Snapshot data sender.
`protected UUID` `srcNodeId` Node id which cause snapshot operation.

### Fields inherited from class org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractCreateSnapshotFutureTask

`closeFut, processed`

### Constructor Summary

Constructors
`CreateDumpFutureTask​(GridCacheSharedContext<?,​?> cctx, UUID srcNodeId, UUID reqId, String dumpName, File dumpDir, FileIOFactory ioFactory, BasicRateLimiter rateLimiter, SnapshotSender snpSndr, Map<Integer,​Set<Integer>> parts, boolean compress, boolean encrypt)`

### Method Summary

All Methods Instance Methods Concrete Methods
`Set<Integer>` `affectedCacheGroups()`
`void` `beforeChange​(GridCacheContext cctx, KeyCacheObject key, CacheObject val, long expireTime, GridCacheVersion ver)`
`protected CompletableFuture<Void>` `closeAsync()`
`@Nullable Serializable` `encryptionKey()`
`long` `processedSize()`
`protected void` `processPartitions()`
`UUID` `requestId()`
`protected List<CompletableFuture<Void>>` `saveCacheConfigs()`
`protected List<CompletableFuture<Void>>` `saveGroup​(int grp, Set<Integer> grpParts)`
`String` `snapshotName()`
`UUID` `sourceNodeId()`
`boolean` `start()` Initiates snapshot task.
`String` `toString()`

### Methods inherited from class org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractCreateSnapshotFutureTask

`acceptException, cancel, runAsync, saveSnapshotData, stopping`

### Methods inherited from class org.apache.ignite.internal.util.future.GridFutureAdapter

`chain, chain, chain, chain, chainCompose, chainCompose, error, get, get, get, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, listen, logger, onCancelled, onDone, onDone, onDone, onDone, onDone, reset, result`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### DUMP_FILE_EXT

    public static final String DUMP_FILE_EXT

Dump files name.

See Also:
  Constant Field Values

#### cctx

    protected final GridCacheSharedContext<?,​?> cctx

Shared context.

#### log

    protected final IgniteLogger log

Ignite logger.

#### srcNodeId

    protected final UUID srcNodeId

Node id which cause snapshot operation.

#### reqId

    protected final UUID reqId

Snapshot operation request ID.

#### snpName

    protected final String snpName

Unique identifier of snapshot process.

#### snpSndr

    @GridToStringExclude
    protected final SnapshotSender snpSndr

Snapshot data sender.

#### parts

    protected final Map<Integer,​Set<Integer>> parts

Partition to be processed.

#### err

    protected final AtomicReference<Throwable> err

An exception which has been occurred during snapshot processing.

### Constructor Detail

#### CreateDumpFutureTask

    public CreateDumpFutureTask​(GridCacheSharedContext<?,​?> cctx,
                                UUID srcNodeId,
                                UUID reqId,
                                String dumpName,
                                File dumpDir,
                                FileIOFactory ioFactory,
                                BasicRateLimiter rateLimiter,
                                SnapshotSender snpSndr,
                                Map<Integer,​Set<Integer>> parts,
                                boolean compress,
                                boolean encrypt)

Parameters:
  `cctx` - Cache context.
  `srcNodeId` - Node id which cause snapshot task creation.
  `reqId` - Snapshot operation request ID.
  `dumpName` - Dump name.
  `ioFactory` - IO factory.
  `snpSndr` - Snapshot sender.
  `rateLimiter` - Dump transfer rate limiter.
  `parts` - Parts to dump.
  `compress` - If `true` then compress partition files.
  `encrypt` - If `true` then content of dump encrypted.

### Method Detail

#### start

    public boolean start()

Initiates snapshot task.

Returns:
  `true` if task started by this call.

#### processPartitions

    protected void processPartitions()
                              throws IgniteCheckedException

Overrides:
  `processPartitions` in class `AbstractCreateSnapshotFutureTask`
Throws:
  `IgniteCheckedException`

#### saveCacheConfigs

    protected List<CompletableFuture<Void>> saveCacheConfigs()

Specified by:
  `saveCacheConfigs` in class `AbstractCreateSnapshotFutureTask`

#### saveGroup

    protected List<CompletableFuture<Void>> saveGroup​(int grp,
                                                      Set<Integer> grpParts)

Specified by:
  `saveGroup` in class `AbstractCreateSnapshotFutureTask`

#### beforeChange

    public void beforeChange​(GridCacheContext cctx,
                             KeyCacheObject key,
                             CacheObject val,
                             long expireTime,
                             GridCacheVersion ver)

Specified by:
  `beforeChange` in interface `DumpEntryChangeListener`
Parameters:
  `cctx` - Cache context.
  `key` - Key.
  `val` - Value BEFORE change.
  `expireTime` - Expire time BEFORE change.
  `ver` - Version of entry BEFORE change.

#### closeAsync

    protected CompletableFuture<Void> closeAsync()

Specified by:
  `closeAsync` in class `AbstractCreateSnapshotFutureTask`
Returns:
  Future which will be completed when operations truly stopped.

#### processedSize

    public long processedSize()

Returns:
  Processed dump size in bytes.

#### encryptionKey

    @Nullable
    public @Nullable Serializable encryptionKey()

Returns:
  Encryption key.

#### snapshotName

    public String snapshotName()

Returns:
  Snapshot name.

#### sourceNodeId

    public UUID sourceNodeId()

Returns:
  Node id which triggers this operation.

#### requestId

    public UUID requestId()

Returns:
  Snapshot operation request ID.

#### affectedCacheGroups

    public Set<Integer> affectedCacheGroups()

Returns:
  Set of cache groups included into snapshot operation.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridFutureAdapter<T>`