|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.solr.handler.dataimport.EntityProcessor
org.apache.solr.handler.dataimport.EntityProcessorBase
public class EntityProcessorBase
Base class for all implementations of EntityProcessor
Most implementations of EntityProcessor extend this base class which provides common functionality.
This API is experimental and subject to change
Field Summary | |
---|---|
protected String |
cachePk
Only used by cache implementations |
protected String |
cacheVariableName
Only used by cache implementations |
protected Map<String,Map<Object,List<Map<String,Object>>>> |
cacheWithWhereClause
Only used by cache implementations |
protected Context |
context
|
protected List<Map<String,Object>> |
dataSourceRowCache
|
protected String |
entityName
|
protected String |
query
|
protected VariableResolverImpl |
resolver
|
protected List<Map<String,Object>> |
rowcache
|
protected Iterator<Map<String,Object>> |
rowIterator
|
protected Map<String,List<Map<String,Object>>> |
simpleCache
Only used by cache implementations |
static String |
SKIP_DOC
|
static String |
TRANSFORM_ROW
|
static String |
TRANSFORMER
|
protected List<Transformer> |
transformers
|
Constructor Summary | |
---|---|
EntityProcessorBase()
|
Method Summary | |
---|---|
protected Map<String,Object> |
applyTransformer(Map<String,Object> row)
|
protected void |
cacheInit()
Only used by cache implementations |
void |
clearSession()
Clears the internal session maintained by this EntityProcessor |
void |
destroy()
Invoked when the Entity processor is detroyed. |
protected List<Map<String,Object>> |
getAllNonCachedRows()
Get all the rows from the the datasource for the given query. |
protected Map<String,Object> |
getFromRowCache()
|
protected Map<String,Object> |
getFromRowCacheTransformed()
|
protected Map<String,Object> |
getIdCacheData(String query)
If the where clause is present the cache is sql Vs Map of key Vs List of Rows. |
protected Map<String,Object> |
getNext()
|
Object |
getSessionAttribute(Object key)
|
protected Map<String,Object> |
getSimpleCacheData(String query)
If where clause is not present the cache is a Map of query vs List of Rows. |
void |
init(Context context)
This method is called when it starts processing an entity. |
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()
For a simple implementation, this is the only method that the sub-class should implement. |
void |
setSessionAttribute(Object key,
Object val)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String entityName
protected Context context
protected VariableResolverImpl resolver
protected Iterator<Map<String,Object>> rowIterator
protected List<Transformer> transformers
protected List<Map<String,Object>> rowcache
protected String query
protected String cachePk
protected String cacheVariableName
protected Map<String,List<Map<String,Object>>> simpleCache
protected Map<String,Map<Object,List<Map<String,Object>>>> cacheWithWhereClause
protected List<Map<String,Object>> dataSourceRowCache
public static final String TRANSFORMER
public static final String TRANSFORM_ROW
public static final String SKIP_DOC
Constructor Detail |
---|
public EntityProcessorBase()
Method Detail |
---|
public void init(Context context)
EntityProcessor
init
in class EntityProcessor
context
- The current contextprotected Map<String,Object> getFromRowCache()
protected Map<String,Object> applyTransformer(Map<String,Object> row)
protected Map<String,Object> getNext()
public Map<String,Object> nextModifiedRowKey()
EntityProcessor
nextModifiedRowKey
in class EntityProcessor
public Map<String,Object> nextDeletedRowKey()
EntityProcessor
nextDeletedRowKey
in class EntityProcessor
public Map<String,Object> nextModifiedParentRowKey()
EntityProcessor
nextModifiedParentRowKey
in class EntityProcessor
public void setSessionAttribute(Object key, Object val)
public Object getSessionAttribute(Object key)
public Map<String,Object> nextRow()
nextRow
in class EntityProcessor
public void destroy()
EntityProcessor
destroy
in class EntityProcessor
public void clearSession()
protected void cacheInit()
protected Map<String,Object> getIdCacheData(String query)
query
- the query string for which cached data is to be returned
protected List<Map<String,Object>> getAllNonCachedRows()
Get all the rows from the the datasource for the given query. Only used by cache implementations.
This must be implemented by sub-classes which intend to provide a cached implementation
protected Map<String,Object> getSimpleCacheData(String query)
query
- string for which cached row is to be returned
protected Map<String,Object> getFromRowCacheTransformed()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |