Interface Processor

All Known Subinterfaces:
WrappingProcessor
All Known Implementing Classes:
AbstractProcessor, CompoundProcessor, ConditionalProcessor, DropProcessor, OnFailureProcessor, PipelineProcessor, TrackingResultProcessor

public interface Processor
A processor implementation may modify the data belonging to a document. Whether changes are made and what exactly is modified is up to the implementation. Processors may get called concurrently and thus need to be thread-safe.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A factory that knows how to construct a processor based on a map of maps.
    static class 
    Infrastructure class that holds services that can be used by processor factories to create processor instances and that gets passed around to all IngestPlugins.
  • Method Summary

    Modifier and Type
    Method
    Description
    execute(IngestDocument ingestDocument)
    Introspect and potentially modify the incoming data.
    default void
    Introspect and potentially modify the incoming data.
    default void
    Validate a processor after it has been constructed by a factory.
    Gets the description of a processor.
    Gets the tag of a processor.
    Gets the type of a processor
    default boolean
     
  • Method Details

    • execute

      default void execute(IngestDocument ingestDocument, BiConsumer<IngestDocument,Exception> handler)
      Introspect and potentially modify the incoming data. Expert method: only override this method if a processor implementation needs to make an asynchronous call, otherwise just overwrite execute(IngestDocument).
    • execute

      default IngestDocument execute(IngestDocument ingestDocument) throws Exception
      Introspect and potentially modify the incoming data.
      Returns:
      If null is returned then the current document will be dropped and not be indexed, otherwise this document will be kept and indexed
      Throws:
      Exception
    • getType

      String getType()
      Gets the type of a processor
    • getTag

      String getTag()
      Gets the tag of a processor.
    • getDescription

      String getDescription()
      Gets the description of a processor.
    • isAsync

      default boolean isAsync()
    • extraValidation

      default void extraValidation() throws Exception
      Validate a processor after it has been constructed by a factory. Override this method to perform additional post-construction validation that should be performed at the rest/transport level. If there's an issue with the processor, then indicate that by throwing an exception. See IngestService.validatePipeline(Map, String, Map)} for the call site where there is invoked in a try/catch. An example of where this would be needed is a processor that interacts with external state like the license state -- it may be okay to create that processor on day 1 with license state A, but later illegal to create a similar processor on day 2 with state B. We want to reject put requests on day 2 (at the rest/transport level), but still allow for restarting nodes in the cluster (so we can't throw exceptions from Processor.Factory.create(Map, String, String, Map)).
      Throws:
      Exception