"From what I could find SKIPPED_DEPENDENCY_FAILED and FILTERED_OUT were only used in the code that you see below:
|
private static int executeRunCheckCommand(CheckCommand cmd, List<CheckCommand.Check> givenChecks, |
|
ServerContext context, ServerUtilOpts opts) throws Exception { |
|
// Get all the checks in the order they are declared in the enum |
|
final var allChecks = CheckCommand.Check.values(); |
|
final TreeMap<CheckCommand.Check,CheckCommand.CheckStatus> checkStatus = new TreeMap<>(); |
|
|
|
for (CheckCommand.Check check : allChecks) { |
|
if (depsFailed(check, checkStatus)) { |
|
checkStatus.put(check, CheckCommand.CheckStatus.SKIPPED_DEPENDENCY_FAILED); |
|
} else { |
|
if (givenChecks.contains(check)) { |
|
checkStatus.put(check, cmd.getCheckRunner(check).runCheck(context, opts, cmd.fixFiles)); |
|
} else { |
|
checkStatus.put(check, CheckCommand.CheckStatus.FILTERED_OUT); |
|
} |
|
} |
|
} |
|
|
|
printChecksResults(checkStatus); |
|
|
|
if (checkStatus.values().stream() |
|
.anyMatch(status -> status == CheckCommand.CheckStatus.FAILED)) { |
|
return 5; |
|
} else { |
|
return 0; |
|
} |
|
} |
|
|
|
private static boolean depsFailed(CheckCommand.Check check, |
|
TreeMap<CheckCommand.Check,CheckCommand.CheckStatus> checkStatus) { |
|
return check.getDependencies().stream() |
|
.anyMatch(dep -> checkStatus.get(dep) == CheckCommand.CheckStatus.FAILED |
|
|| checkStatus.get(dep) == CheckCommand.CheckStatus.SKIPPED_DEPENDENCY_FAILED); |
|
} |
If runCheck on line 1439 returned a boolean, then you could convert that to OK or FAILED at that time and I think it would make the checks a little easier to read. I'm happy to do it in a follow-on."
Originally posted by @dlmarion in #5348 (comment)
"From what I could find
SKIPPED_DEPENDENCY_FAILEDandFILTERED_OUTwere only used in the code that you see below:accumulo/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java
Lines 1428 to 1461 in c1dec00
If
runCheckon line 1439 returned a boolean, then you could convert that toOKorFAILEDat that time and I think it would make the checks a little easier to read. I'm happy to do it in a follow-on."Originally posted by @dlmarion in #5348 (comment)