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 ofDumpEntrywritten one by one.
-
-
Field Summary
Fields Modifier and Type Field Description protected GridCacheSharedContext<?,?>cctxShared context.static StringDUMP_FILE_EXTDump files name.protected AtomicReference<Throwable>errAn exception which has been occurred during snapshot processing.protected IgniteLoggerlogIgnite logger.protected Map<Integer,Set<Integer>>partsPartition to be processed.protected UUIDreqIdSnapshot operation request ID.protected StringsnpNameUnique identifier of snapshot process.protected SnapshotSendersnpSndrSnapshot data sender.protected UUIDsrcNodeIdNode id which cause snapshot operation.-
Fields inherited from class org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractCreateSnapshotFutureTask
closeFut, processed
-
-
Constructor Summary
Constructors Constructor Description 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 Modifier and Type Method Description Set<Integer>affectedCacheGroups()voidbeforeChange(GridCacheContext cctx, KeyCacheObject key, CacheObject val, long expireTime, GridCacheVersion ver)protected CompletableFuture<Void>closeAsync()@Nullable SerializableencryptionKey()longprocessedSize()protected voidprocessPartitions()UUIDrequestId()protected List<CompletableFuture<Void>>saveCacheConfigs()protected List<CompletableFuture<Void>>saveGroup(int grp, Set<Integer> grpParts)StringsnapshotName()UUIDsourceNodeId()booleanstart()Initiates snapshot task.StringtoString()-
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
-
-
-
-
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.
-
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- Iftruethen compress partition files.encrypt- Iftruethen content of dump encrypted.
-
-
Method Detail
-
start
public boolean start()
Initiates snapshot task.- Returns:
trueif task started by this call.
-
processPartitions
protected void processPartitions() throws IgniteCheckedException- Overrides:
processPartitionsin classAbstractCreateSnapshotFutureTask- Throws:
IgniteCheckedException
-
saveCacheConfigs
protected List<CompletableFuture<Void>> saveCacheConfigs()
- Specified by:
saveCacheConfigsin classAbstractCreateSnapshotFutureTask
-
saveGroup
protected List<CompletableFuture<Void>> saveGroup(int grp, Set<Integer> grpParts)
- Specified by:
saveGroupin classAbstractCreateSnapshotFutureTask
-
beforeChange
public void beforeChange(GridCacheContext cctx, KeyCacheObject key, CacheObject val, long expireTime, GridCacheVersion ver)
- Specified by:
beforeChangein interfaceDumpEntryChangeListener- 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:
closeAsyncin classAbstractCreateSnapshotFutureTask- 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:
toStringin classGridFutureAdapter<T>
-
-