Class RunInfo

java.lang.Object
org.apache.tika.eval.app.RunInfo

public class RunInfo extends Object
Provenance for an eval run: what tika-eval this is, what it was pointed at, and (via --runInfo) what batch run produced the extracts. Lands in run_info (run_info_a/run_info_b for the two sides of a comparison) as key/value rows.
  • Field Details

  • Method Details

    • loadSide

      public static RunInfo.Side loadSide(Path explicitPipesReport, Path explicitRunInfo, Path extracts) throws IOException
      Resolves and loads one side's ledger and run-info: an explicit path wins, otherwise <extracts>/.run-info/ is searched, and the pair is refused if it is from two runs.
      Throws:
      IOException
    • discoverRunInfo

      public static Path discoverRunInfo(Path extracts) throws IOException
      The batch script leaves its files in <extracts>/.run-info/. Used when the CLI flags are absent; exactly one run-info there is required, since two means the extracts were written by two runs.
      Returns:
      run-info json path or null if the dir has none
      Throws:
      IOException
    • discoverPipesReport

      public static Path discoverPipesReport(Path extracts) throws IOException
      Throws:
      IOException
    • isRunInfoPath

      public static boolean isRunInfoPath(String relativePath)
    • loadBatch

      public static Map<String,String> loadBatch(Path json) throws IOException
      Flattens the batch script's run-info json into dotted keys under batch..
      Throws:
      IOException
    • checkRunId

      public static void checkRunId(Map<String,String> batch, Path pipesReport)
      A pipes report produced by a different batch run than the run-info describes is the failure mode nobody can see after the fact; refuse it. The script names the ledger crashes-<run.id>.jsonl; a run-info with a blank run.id cannot vouch for any ledger.
    • pipesReportInfo

      public static Map<String,String> pipesReportInfo(PipesReport report)
    • extractsInfo

      public static Map<String,String> extractsInfo(Path extracts) throws IOException
      Count and a sha256 over the sorted "relpath size" lines of the extract set.
      Throws:
      IllegalArgumentException - if extracts is not a directory
      IOException
    • evalInfo

      public static Map<String,String> evalInfo(String[] args, EvalConfig config, Path inputDir)
    • write

      public static void write(IDBWriter writer, TableInfo table, Map<String,String> info) throws IOException
      Throws:
      IOException
    • finish

      public static void finish(IDBWriter writer, TableInfo evalTable, Map<TableInfo,PipesReport> reportsByTable)
      Records the end time and the join outcome of each ledger, then flushes. Never throws: this runs in the runners' finally, where an exception would mask the real failure and skip the executor/connection shutdown after it.