Class RunSummaryWriter
runSummaryFile system property names a file to write it to:
-DrunSummaryFile=/var/run/my-crawl/summary.json
The property is read rather than a configuration setting because the caller
that wants the summary is usually the one that launched the JVM — a
supervising process, a scheduler, a CI job — and it needs to choose the path
without editing the crawl configuration. This mirrors
-DenableJMX=true, which exists for the same reason. Nothing is
written when the property is absent.
The file is produced at the end of a crawl, while the ledger is still open, and looks like this:
{
"crawlerId" : "my-crawler",
"state" : "COMPLETED",
"counts" : { "NEW" : 3, "UNMODIFIED" : 41 }
}
Counts are keyed by
ProcessingOutcome name, so a reader
gets the crawler's own vocabulary rather than a translation of it. Obtaining
them costs one pass over the entries processed in this run, which is why this
is opt-in rather than always on.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe summary document. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSystem property naming the file to write the run summary to. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidwriteIfRequested(CrawlerSession session, CrawlerState finalState) Writes the summary if the system property asks for one.
-
Field Details
-
SYS_PROP_RUN_SUMMARY_FILE
System property naming the file to write the run summary to.- See Also:
-
-
Method Details
-
writeIfRequested
Writes the summary if the system property asks for one.A failure here is logged and swallowed. A report that could not be written is not a reason to fail a crawl that otherwise succeeded, and the crawl's real outcome is already recorded in the ledger and the exit code.
- Parameters:
session- the crawl session, still openfinalState- the state the crawl ended in
-