Class AbstractCreateSnapshotFutureTask
- java.lang.Object
-
- org.apache.ignite.internal.util.future.GridFutureAdapter<T>
-
- org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractCreateSnapshotFutureTask
-
- All Implemented Interfaces:
IgniteInternalFuture<SnapshotFutureTaskResult>
- Direct Known Subclasses:
CreateDumpFutureTask
public abstract class AbstractCreateSnapshotFutureTask extends GridFutureAdapter<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected GridCacheSharedContext<?,?>cctxShared context.protected CompletableFuture<Void>closeFutFuture which will be completed when task requested to be closed.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 Map<Integer,Set<Integer>>processedCache group and corresponding partitions collected under the PME lock.protected UUIDreqIdSnapshot operation request ID.protected StringsnpNameUnique identifier of snapshot process.protected SnapshotSendersnpSndrSnapshot data sender.protected UUIDsrcNodeIdNode id which cause snapshot operation.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCreateSnapshotFutureTask(GridCacheSharedContext<?,?> cctx, UUID srcNodeId, UUID reqId, String snpName, SnapshotSender snpSndr, Map<Integer,Set<Integer>> parts)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidacceptException(Throwable th)Set<Integer>affectedCacheGroups()booleancancel()Default no-op implementation that always returnsfalse.protected abstract CompletableFuture<Void>closeAsync()protected voidprocessPartitions()UUIDrequestId()protected CompletableFuture<Void>runAsync(IgniteThrowableRunner task)protected abstract List<CompletableFuture<Void>>saveCacheConfigs()protected abstract List<CompletableFuture<Void>>saveGroup(int grpId, Set<Integer> grpParts)protected voidsaveSnapshotData()Starts async execution of all tasks required to create snapshot.StringsnapshotName()UUIDsourceNodeId()abstract booleanstart()Initiates snapshot task.protected booleanstopping()StringtoString()-
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
-
processed
protected final Map<Integer,Set<Integer>> processed
Cache group and corresponding partitions collected under the PME lock. For full snapshot additional checkpoint write lock required.
-
closeFut
protected volatile CompletableFuture<Void> closeFut
Future which will be completed when task requested to be closed. Will be executed on system pool.
-
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
-
AbstractCreateSnapshotFutureTask
protected AbstractCreateSnapshotFutureTask(GridCacheSharedContext<?,?> cctx, UUID srcNodeId, UUID reqId, String snpName, SnapshotSender snpSndr, Map<Integer,Set<Integer>> parts)
- Parameters:
cctx- Shared context.srcNodeId- Node id which cause snapshot task creation.reqId- Snapshot operation request ID.snpName- Snapshot name.snpSndr- Factory which produces snapshot sender instance.parts- Partitions to be processed.
-
-
Method Detail
-
saveCacheConfigs
protected abstract List<CompletableFuture<Void>> saveCacheConfigs()
-
saveGroup
protected abstract List<CompletableFuture<Void>> saveGroup(int grpId, Set<Integer> grpParts) throws IgniteCheckedException
- Throws:
IgniteCheckedException
-
cancel
public boolean cancel()
Default no-op implementation that always returnsfalse. Futures that do support cancellation should override this method and callGridFutureAdapter.onCancelled()callback explicitly if cancellation indeed did happen.- Specified by:
cancelin interfaceIgniteInternalFuture<SnapshotFutureTaskResult>- Returns:
Trueif future was canceled (i.e. was not finished prior to this call).
-
closeAsync
protected abstract CompletableFuture<Void> closeAsync()
- Returns:
- Future which will be completed when operations truly stopped.
-
stopping
protected boolean stopping()
- Returns:
trueif current task requested to be stopped.
-
processPartitions
protected void processPartitions() throws IgniteCheckedException- Throws:
IgniteCheckedException
-
saveSnapshotData
protected void saveSnapshotData()
Starts async execution of all tasks required to create snapshot.
-
acceptException
public void acceptException(Throwable th)
- Parameters:
th- An exception which occurred during snapshot processing.
-
runAsync
protected CompletableFuture<Void> runAsync(IgniteThrowableRunner task)
-
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.
-
start
public abstract boolean start()
Initiates snapshot task.- Returns:
trueif task started by this call.
-
toString
public String toString()
- Overrides:
toStringin classGridFutureAdapter<T>
-
-