Class FileSystemJsonlReporter
java.lang.Object
org.apache.tika.plugins.AbstractTikaExtension
org.apache.tika.pipes.reporters.PipesReporterBase
org.apache.tika.pipes.reporter.fs.FileSystemJsonlReporter
- All Implemented Interfaces:
Closeable,AutoCloseable,PipesReporter,TikaExtension
Append-only per-document audit log: one JSON object per line for every result
accepted by the includes/excludes filter. The line's
id is the
FetchEmitTuple.getId() verbatim, so consumers join on it.
Each line is written and flushed to the OS synchronously in report(org.apache.tika.pipes.api.FetchEmitTuple, org.apache.tika.pipes.api.PipesResult, long), so
it survives the driver process dying (not a host crash; there is no fsync). A
write failure (disk full, etc.) throws from that report(org.apache.tika.pipes.api.FetchEmitTuple, org.apache.tika.pipes.api.PipesResult, long) and every later
one rather than dropping lines silently.
-
Field Summary
Fields inherited from class org.apache.tika.plugins.AbstractTikaExtension
pluginConfig -
Constructor Summary
ConstructorsConstructorDescriptionFileSystemJsonlReporter(ExtensionConfig pluginConfig, FileSystemJsonlReporterConfig config) -
Method Summary
Modifier and TypeMethodDescriptionstatic FileSystemJsonlReporterbuild(ExtensionConfig pluginConfig) voidclose()voidThis is called if the process has crashed.voidThis is called if the process has crashed.voidreport(FetchEmitTuple t, PipesResult result, long elapsed) voidreport(TotalCountResult totalCountResult) Make sure to overridePipesReporter.supportsTotalCount()to returntruebooleanOverride this if your reporter supports total count.Methods inherited from class org.apache.tika.pipes.reporters.PipesReporterBase
acceptMethods inherited from class org.apache.tika.plugins.AbstractTikaExtension
getExtensionConfigMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.tika.plugins.TikaExtension
getExtensionConfig
-
Constructor Details
-
FileSystemJsonlReporter
public FileSystemJsonlReporter(ExtensionConfig pluginConfig, FileSystemJsonlReporterConfig config) throws TikaConfigException, IOException - Throws:
TikaConfigExceptionIOException
-
-
Method Details
-
build
public static FileSystemJsonlReporter build(ExtensionConfig pluginConfig) throws TikaConfigException, IOException - Throws:
TikaConfigExceptionIOException
-
report
-
report
Description copied from interface:PipesReporterMake sure to overridePipesReporter.supportsTotalCount()to returntrue- Parameters:
totalCountResult-
-
supportsTotalCount
public boolean supportsTotalCount()Description copied from interface:PipesReporterOverride this if your reporter supports total count.- Returns:
falseas the baseline implementation
-
error
Description copied from interface:PipesReporterThis is called if the process has crashed. Implementers should not rely on close() to be called after this.- Parameters:
t-
-
error
Description copied from interface:PipesReporterThis is called if the process has crashed. Implementers should not rely on close() to be called after this.- Parameters:
msg-
-
close
- Throws:
IOException
-