Class AbstractSnapshotVerificationTask
- java.lang.Object
-
- org.apache.ignite.compute.ComputeTaskAdapter<SnapshotPartitionsVerifyTaskArg,SnapshotPartitionsVerifyTaskResult>
-
- org.apache.ignite.internal.processors.cache.persistence.snapshot.AbstractSnapshotVerificationTask
-
- All Implemented Interfaces:
Serializable,ComputeTask<SnapshotPartitionsVerifyTaskArg,SnapshotPartitionsVerifyTaskResult>
- Direct Known Subclasses:
IncrementalSnapshotVerificationTask,SnapshotHandlerRestoreTask,SnapshotPartitionsVerifyTask
public abstract class AbstractSnapshotVerificationTask extends ComputeTaskAdapter<SnapshotPartitionsVerifyTaskArg,SnapshotPartitionsVerifyTaskResult>
The task for checking the consistency of snapshots in the cluster.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractSnapshotVerificationTask.AbstractSnapshotVerificationJob
-
Field Summary
Fields Modifier and Type Field Description protected IgniteExigniteIgnite instance.protected IgniteLoggerlogInjected logger.protected Map<ClusterNode,List<SnapshotMetadata>>metasMap of snapshot metadata information found on each cluster node.
-
Constructor Summary
Constructors Constructor Description AbstractSnapshotVerificationTask()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract AbstractSnapshotVerificationTask.AbstractSnapshotVerificationJobcreateJob(String name, String consId, SnapshotPartitionsVerifyTaskArg args)Map<ComputeJob,ClusterNode>map(List<ClusterNode> subgrid, SnapshotPartitionsVerifyTaskArg arg)This method is called to map or split grid task into multiple grid jobs.ComputeJobResultPolicyresult(ComputeJobResult res, List<ComputeJobResult> rcvd)Default implementation which will wait for all jobs to complete before callingComputeTask.reduce(List)method.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.compute.ComputeTask
reduce
-
-
-
-
Field Detail
-
metas
protected final Map<ClusterNode,List<SnapshotMetadata>> metas
Map of snapshot metadata information found on each cluster node.
-
ignite
@IgniteInstanceResource protected IgniteEx ignite
Ignite instance.
-
log
@LoggerResource protected IgniteLogger log
Injected logger.
-
-
Method Detail
-
map
public Map<ComputeJob,ClusterNode> map(List<ClusterNode> subgrid, SnapshotPartitionsVerifyTaskArg arg)
This method is called to map or split grid task into multiple grid jobs. This is the first method that gets called when task execution starts.- Parameters:
subgrid- Nodes available for this task execution. Note that order of nodes is guaranteed to be randomized by container. This ensures that every time you simply iterate through grid nodes, the order of nodes will be random which over time should result into all nodes being used equally.arg- Task execution argument. Can benull. This is the same argument as the one passed intoGrid#execute(...)methods.- Returns:
- Map of grid jobs assigned to subgrid node. Unless
ComputeTaskContinuousMapperis injected into task, ifnullor empty map is returned, exception will be thrown.
-
result
public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) throws IgniteException
Default implementation which will wait for all jobs to complete before callingComputeTask.reduce(List)method.If remote job resulted in exception (
ComputeJobResult.getException()is notnull), thenComputeJobResultPolicy.FAILOVERpolicy will be returned if the exception is instance ofClusterTopologyExceptionorComputeExecutionRejectedException, which means that remote node either failed or job execution was rejected before it got a chance to start. In all other cases the exception will be rethrown which will ultimately cause task to fail.- Specified by:
resultin interfaceComputeTask<SnapshotPartitionsVerifyTaskArg,SnapshotPartitionsVerifyTaskResult>- Overrides:
resultin classComputeTaskAdapter<SnapshotPartitionsVerifyTaskArg,SnapshotPartitionsVerifyTaskResult>- Parameters:
res- Received remote grid executable result.rcvd- All previously received results.- Returns:
- Result policy that dictates how to process further upcoming job results.
- Throws:
IgniteException- If handling a job result caused an error effectively rejecting a failover. This exception will be thrown out ofComputeTaskFuture.get()method.
-
createJob
protected abstract AbstractSnapshotVerificationTask.AbstractSnapshotVerificationJob createJob(String name, String consId, SnapshotPartitionsVerifyTaskArg args)
- Parameters:
name- Snapshot name.consId- Consistent id of the related node.args- Check snapshot parameters.- Returns:
- Compute job.
-
-