use of org.apache.ignite.internal.visor.verify.VisorIdleVerifyTaskV2 in project ignite by apache.
the class GridCommonAbstractTest method idleVerify.
/**
* Compares checksums between primary and backup partitions of specified caches.
* Works properly only on idle cluster - there may be false positive conflict reports if data in cluster is being
* concurrently updated.
*
* @param ig Ignite instance.
* @param caches Cache names (if null, all user caches will be verified).
* @return Conflicts result.
* @throws IgniteException If none caches or node found.
*/
protected IdleVerifyResultV2 idleVerify(Ignite ig, @Nullable String... caches) {
log.info("Starting idleVerify ...");
IgniteEx ig0 = (IgniteEx) ig;
Set<String> cacheNames = new HashSet<>();
if (F.isEmpty(caches))
cacheNames.addAll(ig0.cacheNames());
else
Collections.addAll(cacheNames, caches);
if (cacheNames.isEmpty())
throw new IgniteException("None cache for checking.");
ClusterNode node = !ig0.localNode().isClient() ? ig0.localNode() : ig0.cluster().forServers().forRandom().node();
if (node == null)
throw new IgniteException("None server node for verification.");
VisorIdleVerifyTaskArg taskArg = new VisorIdleVerifyTaskArg(cacheNames);
return ig.compute().execute(VisorIdleVerifyTaskV2.class.getName(), new VisorTaskArgument<>(node.id(), taskArg, false));
}
Aggregations