Class EntityProcessor

    • Constructor Detail

      • EntityProcessor

        public EntityProcessor()
    • Method Detail

      • init

        public abstract void init​(Context context)
        This method is called when it starts processing an entity. When it comes back to the entity it is called again. So it can reset anything at that point. For a rootmost entity this is called only once for an ingestion. For sub-entities , this is called multiple once for each row from its parent entity
        Parameters:
        context - The current context
      • nextRow

        public abstract Map<String,​Object> nextRow()
        This method helps streaming the data for each row . The implementation would fetch as many rows as needed and gives one 'row' at a time. Only this method is used during a full import
        Returns:
        A 'row'. The 'key' for the map is the column name and the 'value' is the value of that column. If there are no more rows to be returned, return 'null'
      • nextModifiedRowKey

        public abstract Map<String,​Object> nextModifiedRowKey()
        This is used for delta-import. It gives the pks of the changed rows in this entity
        Returns:
        the pk vs value of all changed rows
      • nextDeletedRowKey

        public abstract Map<String,​Object> nextDeletedRowKey()
        This is used during delta-import. It gives the primary keys of the rows that are deleted from this entity. If this entity is the root entity, solr document is deleted. If this is a sub-entity, the Solr document is considered as 'changed' and will be recreated
        Returns:
        the pk vs value of all changed rows
      • nextModifiedParentRowKey

        public abstract Map<String,​Object> nextModifiedParentRowKey()
        This is used during delta-import. This gives the primary keys and their values of all the rows changed in a parent entity due to changes in this entity.
        Returns:
        the pk vs value of all changed rows in the parent entity
      • destroy

        public abstract void destroy()
        Invoked for each entity at the very end of the import to do any needed cleanup tasks.
      • postTransform

        public void postTransform​(Map<String,​Object> r)
        Invoked after the transformers are invoked. EntityProcessors can add, remove or modify values added by Transformers in this method.
        Parameters:
        r - The transformed row
        Since:
        solr 1.4
      • close

        public void close()
        Invoked when the Entity processor is destroyed towards the end of import.
        Since:
        solr 1.4