Class PipesReporter

java.lang.Object
org.apache.tika.pipes.PipesReporter
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
CompositePipesReporter, FileSystemStatusReporter, LoggingPipesReporter, OpenSearchPipesReporter, PipesReporterBase

public abstract class PipesReporter extends Object implements Closeable
This is called asynchronously by the AsyncProcessor. This is not thread safe, and implementers must be careful to implement report(FetchEmitTuple, PipesResult, long) in a thread safe way.

Note, however, that this is not called in the forked processes. Implementers do not have to worry about synchronizing across processes; for example, one could use an in-memory h2 database as a target.

  • Field Details

    • NO_OP_REPORTER

      public static final PipesReporter NO_OP_REPORTER
  • Constructor Details

    • PipesReporter

      public PipesReporter()
  • Method Details

    • report

      public abstract void report(FetchEmitTuple t, PipesResult result, long elapsed)
    • report

      public void report(TotalCountResult totalCountResult)
      No-op implementation. Override for custom behavior and make sure to override supportsTotalCount() to return true
      Parameters:
      totalCountResult -
    • supportsTotalCount

      public boolean supportsTotalCount()
      Override this if your reporter supports total count.
      Returns:
      false as the baseline implementation
    • close

      public void close() throws IOException
      No-op implementation. Override for custom behavior
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • error

      public abstract void error(Throwable t)
      This is called if the process has crashed. Implementers should not rely on close() to be called after this.
      Parameters:
      t -
    • error

      public abstract void error(String msg)
      This is called if the process has crashed. Implementers should not rely on close() to be called after this.
      Parameters:
      msg -