use of org.apache.ignite.internal.visor.verify.IndexValidationIssue in project ignite by apache.
the class CacheValidateIndexes method execute.
/**
* {@inheritDoc}
*/
@Override
public Object execute(GridClientConfiguration clientCfg, Logger logger) throws Exception {
VisorValidateIndexesTaskArg taskArg = new VisorValidateIndexesTaskArg(args.caches(), args.nodeId() != null ? Collections.singleton(args.nodeId()) : null, args.checkFirst(), args.checkThrough(), args.checkCrc(), args.checkSizes());
try (GridClient client = Command.startClient(clientCfg)) {
VisorValidateIndexesTaskResult taskRes = executeTaskByNameOnNode(client, "org.apache.ignite.internal.visor.verify.VisorValidateIndexesTask", taskArg, null, clientCfg);
boolean errors = CommandLogger.printErrors(taskRes.exceptions(), "Index validation failed on nodes:", logger);
for (Entry<UUID, VisorValidateIndexesJobResult> nodeEntry : taskRes.results().entrySet()) {
VisorValidateIndexesJobResult jobRes = nodeEntry.getValue();
if (!jobRes.hasIssues())
continue;
errors = true;
logger.info("Index issues found on node " + nodeEntry.getKey() + ":");
for (IndexIntegrityCheckIssue is : jobRes.integrityCheckFailures()) logger.info(INDENT + is);
for (Entry<PartitionKey, ValidateIndexesPartitionResult> e : jobRes.partitionResult().entrySet()) {
ValidateIndexesPartitionResult res = e.getValue();
if (!res.issues().isEmpty()) {
logger.info(INDENT + join(" ", e.getKey(), e.getValue()));
for (IndexValidationIssue is : res.issues()) logger.info(DOUBLE_INDENT + is);
}
}
for (Entry<String, ValidateIndexesPartitionResult> e : jobRes.indexResult().entrySet()) {
ValidateIndexesPartitionResult res = e.getValue();
if (!res.issues().isEmpty()) {
logger.info(INDENT + join(" ", "SQL Index", e.getKey(), e.getValue()));
for (IndexValidationIssue is : res.issues()) logger.info(DOUBLE_INDENT + is);
}
}
for (Entry<String, ValidateIndexesCheckSizeResult> e : jobRes.checkSizeResult().entrySet()) {
ValidateIndexesCheckSizeResult res = e.getValue();
Collection<ValidateIndexesCheckSizeIssue> issues = res.issues();
if (issues.isEmpty())
continue;
logger.info(INDENT + join(" ", "Size check", e.getKey(), res));
for (ValidateIndexesCheckSizeIssue issue : issues) logger.info(DOUBLE_INDENT + issue);
}
}
if (!errors)
logger.info("no issues found.");
else
logger.severe("issues found (listed above).");
logger.info("");
return taskRes;
}
}
Aggregations