org.apache.solr.handler.dataimport
Class CachedSqlEntityProcessor
java.lang.Object
org.apache.solr.handler.dataimport.EntityProcessor
org.apache.solr.handler.dataimport.EntityProcessorBase
org.apache.solr.handler.dataimport.SqlEntityProcessor
org.apache.solr.handler.dataimport.CachedSqlEntityProcessor
public class CachedSqlEntityProcessor
- extends SqlEntityProcessor
This class enables caching of data obtained from the DB to avoid too many sql
queries
Refer to http://wiki.apache.org/solr/DataImportHandler
for more details.
This API is experimental and subject to change
- Since:
- solr 1.3
- Version:
- $Id: CachedSqlEntityProcessor.java 1065312 2011-01-30 16:08:25Z rmuir $
Fields inherited from class org.apache.solr.handler.dataimport.EntityProcessorBase |
ABORT, CACHE_KEY, CACHE_LOOKUP, cachePk, cacheVariableName, cacheWithWhereClause, context, CONTINUE, dataSourceRowCache, entityName, isFirstInit, ON_ERROR, onError, query, rowIterator, simpleCache, SKIP, SKIP_DOC, TRANSFORM_ROW, TRANSFORMER, transformers |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachedSqlEntityProcessor
public CachedSqlEntityProcessor()
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
- Overrides:
init
in class SqlEntityProcessor
- Parameters:
context
- The current context
nextRow
public Map<String,Object> nextRow()
- Description copied from class:
EntityProcessorBase
- For a simple implementation, this is the only method that the sub-class should implement. This is intended to
stream rows one-by-one. Return null to signal end of rows
- Overrides:
nextRow
in class SqlEntityProcessor
- Returns:
- a row where the key is the name of the field and value can be any Object or a Collection of objects. Return
null to signal end of rows
getAllNonCachedRows
protected List<Map<String,Object>> getAllNonCachedRows()
- Description copied from class:
EntityProcessorBase
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
- Overrides:
getAllNonCachedRows
in class EntityProcessorBase
- Returns:
- the list of all rows fetched from the datasource.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.