Class EntityProcessorWrapper
- java.lang.Object
-
- org.apache.solr.handler.dataimport.EntityProcessor
-
- org.apache.solr.handler.dataimport.EntityProcessorWrapper
-
public class EntityProcessorWrapper extends EntityProcessor
A Wrapper overEntityProcessor
instance which performs transforms and handles multi-row outputs correctly.- Since:
- solr 1.4
-
-
Field Summary
Fields Modifier and Type Field Description protected List<Map<String,Object>>
rowcache
protected List<Transformer>
transformers
-
Constructor Summary
Constructors Constructor Description EntityProcessorWrapper(EntityProcessor delegate, Entity entity, DocBuilder docBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>
applyTransformer(Map<String,Object> row)
void
close()
Invoked when the Entity processor is destroyed towards the end of import.void
destroy()
Invoked for each entity at the very end of the import to do any needed cleanup tasks.List<EntityProcessorWrapper>
getChildren()
Context
getContext()
DataSource
getDatasource()
Entity
getEntity()
protected Map<String,Object>
getFromRowCache()
VariableResolver
getVariableResolver()
void
init(Context context)
This method is called when it starts processing an entity.boolean
isInitialized()
Map<String,Object>
nextDeletedRowKey()
This is used during delta-import.Map<String,Object>
nextModifiedParentRowKey()
This is used during delta-import.Map<String,Object>
nextModifiedRowKey()
This is used for delta-import.Map<String,Object>
nextRow()
This method helps streaming the data for each row .void
setDatasource(DataSource datasource)
void
setInitialized(boolean initialized)
-
Methods inherited from class org.apache.solr.handler.dataimport.EntityProcessor
postTransform
-
-
-
-
Constructor Detail
-
EntityProcessorWrapper
public EntityProcessorWrapper(EntityProcessor delegate, Entity entity, DocBuilder docBuilder)
-
-
Method Detail
-
init
public void init(Context context)
Description copied from class:EntityProcessor
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- Specified by:
init
in classEntityProcessor
- Parameters:
context
- The current context
-
nextRow
public Map<String,Object> nextRow()
Description copied from class:EntityProcessor
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- Specified by:
nextRow
in classEntityProcessor
- 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 Map<String,Object> nextModifiedRowKey()
Description copied from class:EntityProcessor
This is used for delta-import. It gives the pks of the changed rows in this entity- Specified by:
nextModifiedRowKey
in classEntityProcessor
- Returns:
- the pk vs value of all changed rows
-
nextDeletedRowKey
public Map<String,Object> nextDeletedRowKey()
Description copied from class:EntityProcessor
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- Specified by:
nextDeletedRowKey
in classEntityProcessor
- Returns:
- the pk vs value of all changed rows
-
nextModifiedParentRowKey
public Map<String,Object> nextModifiedParentRowKey()
Description copied from class:EntityProcessor
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.- Specified by:
nextModifiedParentRowKey
in classEntityProcessor
- Returns:
- the pk vs value of all changed rows in the parent entity
-
destroy
public void destroy()
Description copied from class:EntityProcessor
Invoked for each entity at the very end of the import to do any needed cleanup tasks.- Specified by:
destroy
in classEntityProcessor
-
getVariableResolver
public VariableResolver getVariableResolver()
-
getContext
public Context getContext()
-
close
public void close()
Description copied from class:EntityProcessor
Invoked when the Entity processor is destroyed towards the end of import.- Overrides:
close
in classEntityProcessor
-
getEntity
public Entity getEntity()
-
getChildren
public List<EntityProcessorWrapper> getChildren()
-
getDatasource
public DataSource getDatasource()
-
setDatasource
public void setDatasource(DataSource datasource)
-
isInitialized
public boolean isInitialized()
-
setInitialized
public void setInitialized(boolean initialized)
-
-