Class IndexStageBase<T extends IndexStageConfig>

  • Type Parameters:
    T - index stage configuration class
    All Implemented Interfaces:
    IndexStage<T>

    public abstract class IndexStageBase<T extends IndexStageConfig>
    extends java.lang.Object
    implements IndexStage<T>
    Convenient base class for index pipeline stage containing default initialization logic. Extend this class to implement custom index pipeline stage:
     @Stage(type = "myStage", configClass = MyStageConfig.class)
     public class MyStage extends IndexStageBase<MyStageConfig> {
    
       @Override
       public Document process(Document document, Context context) {
         // get configuration
         String myBlobId = config.myBlobdId();
    
         // call Fusion API methods
         fusion.blobs().getBlobContent(myBlobId);
    
         // further document processing logic
       }
     }
     
    • Constructor Detail

      • IndexStageBase

        public IndexStageBase()
    • Method Detail

      • newDocument

        public Document newDocument()
      • newDocument

        public Document newDocument​(java.lang.String id)
      • init

        public void init​(T config,
                         Fusion fusion)
        Description copied from interface: IndexStage
        Stage initialization callback. This method will be called by Fusion when index stage instance is created and before 'process' method is called. Stage configuration will be passed by Fusion as IndexStageConfig instance. Additionally Fusion interface instance will be passed to allow calling Fusion API from the index stage.
        Specified by:
        init in interface IndexStage<T extends IndexStageConfig>
        Parameters:
        config - index pipeline stage configuration
        fusion - Fusion API instance