public abstract class AbstractSnapshotVerificationTask extends ComputeTaskAdapter<SnapshotPartitionsVerifyTaskArg,SnapshotPartitionsVerifyTaskResult>
| Modifier and Type | Field and Description |
|---|---|
protected IgniteEx |
ignite
Ignite instance.
|
protected Map<ClusterNode,List<SnapshotMetadata>> |
metas
Map of snapshot metadata information found on each cluster node.
|
| Constructor and Description |
|---|
AbstractSnapshotVerificationTask() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkMissedMetadata(Collection<SnapshotMetadata> clusterMetas)
Ensures that all parts of the snapshot are available according to the metadata.
|
protected abstract ComputeJob |
createJob(String name,
@Nullable String path,
int incIdx,
String constId,
Collection<String> groups,
boolean check) |
Map<ComputeJob,ClusterNode> |
map(List<ClusterNode> subgrid,
SnapshotPartitionsVerifyTaskArg arg)
This method is called to map or split grid task into multiple grid jobs.
|
ComputeJobResultPolicy |
result(ComputeJobResult res,
List<ComputeJobResult> rcvd)
Default implementation which will wait for all jobs to complete before
calling
ComputeTask.reduce(List) method. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreduceprotected final Map<ClusterNode,List<SnapshotMetadata>> metas
@IgniteInstanceResource protected IgniteEx ignite
public Map<ComputeJob,ClusterNode> map(List<ClusterNode> subgrid, SnapshotPartitionsVerifyTaskArg arg)
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 be null. This is the same argument
as the one passed into Grid#execute(...) methods.ComputeTaskContinuousMapper is
injected into task, if null or empty map is returned, exception will be thrown.public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) throws IgniteException
ComputeTask.reduce(List) method.
If remote job resulted in exception (ComputeJobResult.getException() is not null),
then ComputeJobResultPolicy.FAILOVER policy will be returned if the exception is instance
of ClusterTopologyException or ComputeExecutionRejectedException, 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.
result in interface ComputeTask<SnapshotPartitionsVerifyTaskArg,SnapshotPartitionsVerifyTaskResult>result in class ComputeTaskAdapter<SnapshotPartitionsVerifyTaskArg,SnapshotPartitionsVerifyTaskResult>res - Received remote grid executable result.rcvd - All previously received results.IgniteException - If handling a job result caused an error effectively rejecting
a failover. This exception will be thrown out of ComputeTaskFuture.get() method.public static void checkMissedMetadata(Collection<SnapshotMetadata> clusterMetas) throws IgniteCheckedException
clusterMetas - List of snapshot metadata found in the cluster.IgniteCheckedException - If some metadata is missing.protected abstract ComputeJob createJob(String name, @Nullable @Nullable String path, int incIdx, String constId, Collection<String> groups, boolean check)
name - Snapshot name.path - Snapshot directory path.incIdx - Incremental snapshot index.constId - Snapshot metadata file name.groups - Cache groups to be restored from the snapshot. May be empty if all cache groups are being restored.check - If true check snapshot before restore.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023