public static int reportVerificationResults(File replicaDir, IndexProcessingResults results,
      boolean failIfCraftedIdsPresent) {
    int exitCode = 0;
    if (results == null) {
      logger.error("Index of {} has no results", replicaDir);
      exitCode = 1;
    } else if (results.getThrowable() != null) {
      logger.error("Processing of index of {} failed", replicaDir, results.getThrowable());
      exitCode = 2;
    } else if (failIfCraftedIdsPresent && results.getCraftedIdCount() != 0) {
      logger.error("Index of {} has {} crafted IDs", replicaDir, results.getCraftedIdCount());
      exitCode = 3;
    } else if (!results.isIndexSane()) {
      logger.error("Index of {} has errors. Results are {}", replicaDir, results);
      exitCode = 4;
    } else {
      logger.info("Index of {} is well formed and without errors", replicaDir);
    }
    return exitCode;
  }
Reports verification results and returns possible exit code
@param replicaDir the directory that contains the indexes for which {@code results} was generated
@param results the processing results for index in {@code replicaDir}
@param failIfCraftedIdsPresent if {@code true}, reports the presence of crafted IDs as a failure
@return the suggested exit code
ambry-tools/src/main/java/com/github/ambry/store/DumpIndexTool.java