Class VerifyBackupPartitionsTaskV2
- java.lang.Object
-
- org.apache.ignite.compute.ComputeTaskAdapter<CacheIdleVerifyCommandArg,IdleVerifyResultV2>
-
- org.apache.ignite.internal.management.cache.VerifyBackupPartitionsTaskV2
-
- All Implemented Interfaces:
Serializable,ComputeTask<CacheIdleVerifyCommandArg,IdleVerifyResultV2>
@GridInternal public class VerifyBackupPartitionsTaskV2 extends ComputeTaskAdapter<CacheIdleVerifyCommandArg,IdleVerifyResultV2>
Task for comparing update counters and checksums between primary and backup partitions of specified caches.
Argument: Set of cache names, 'null' will trigger verification for all caches.
Result:IdleVerifyResultV2with conflict partitions.
Works properly only on idle cluster - there may be false positive conflict reports if data in cluster is being concurrently updated.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringIDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGEError thrown when idle_verify is called on an inactive cluster with persistence.static IgniteProductVersionV2_SINCE_VERFirst version of Ignite that is capable of executing Idle Verify V2.
-
Constructor Summary
Constructors Constructor Description VerifyBackupPartitionsTaskV2()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Map<? extends ComputeJob,ClusterNode>map(List<ClusterNode> subgrid, CacheIdleVerifyCommandArg arg)This method is called to map or split grid task into multiple grid jobs.@Nullable IdleVerifyResultV2reduce(List<ComputeJobResult> results)Reduces (or aggregates) results received so far into one compound result to be returned to caller viaComputeTaskFuture.get()method.static IdleVerifyResultV2reduce0(List<ComputeJobResult> results)ComputeJobResultPolicyresult(ComputeJobResult res, List<ComputeJobResult> rcvd)Default implementation which will wait for all jobs to complete before callingComputeTask.reduce(List)method.
-
-
-
Field Detail
-
V2_SINCE_VER
public static final IgniteProductVersion V2_SINCE_VER
First version of Ignite that is capable of executing Idle Verify V2.
-
IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE
public static final String IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE
Error thrown when idle_verify is called on an inactive cluster with persistence.- See Also:
- Constant Field Values
-
-
Method Detail
-
map
@NotNull public @NotNull Map<? extends ComputeJob,ClusterNode> map(List<ClusterNode> subgrid, CacheIdleVerifyCommandArg arg) throws IgniteException
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. - Throws:
IgniteException- If mapping could not complete successfully. This exception will be thrown out ofComputeTaskFuture.get()method.
-
reduce
@Nullable public @Nullable IdleVerifyResultV2 reduce(List<ComputeJobResult> results) throws IgniteException
Reduces (or aggregates) results received so far into one compound result to be returned to caller viaComputeTaskFuture.get()method.Note, that if some jobs did not succeed and could not be failed over then the list of results passed into this method will include the failed results. Otherwise, failed results will not be in the list.
- Parameters:
results- Received results of broadcasted remote executions. Note that if task class hasComputeTaskNoResultCacheannotation, then this list will be empty.- Returns:
- Grid job result constructed from results of remote executions.
- Throws:
IgniteException- If reduction or results caused an error. This exception will be thrown out ofComputeTaskFuture.get()method.
-
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<CacheIdleVerifyCommandArg,IdleVerifyResultV2>- Overrides:
resultin classComputeTaskAdapter<CacheIdleVerifyCommandArg,IdleVerifyResultV2>- 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.
-
reduce0
public static IdleVerifyResultV2 reduce0(List<ComputeJobResult> results)
- Parameters:
results- Received results of broadcast remote requests.- Returns:
- Idle verify job result constructed from results of remote executions.
-
-