Class DIHCacheSupport
- java.lang.Object
-
- org.apache.solr.handler.dataimport.DIHCacheSupport
-
public class DIHCacheSupport extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
CACHE_DELETE_PRIOR_DATA
If the cache supports persistent data, set to "true" to delete any prior persisted data before running the entity.static String
CACHE_FOREIGN_KEY
Specify the Foreign Key from the parent entity to join on.static String
CACHE_IMPL
Specify the class for the cache implementationstatic String
CACHE_PRIMARY_KEY
Specify the Primary Key field from this Entity to map the input records withstatic String
CACHE_READ_ONLY
If true, a pre-existing cache is re-opened for read-only access.
-
Constructor Summary
Constructors Constructor Description DIHCacheSupport(Context context, String cacheImplName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroyAll()
Map<String,Object>
getCacheData(Context context, String query, Iterator<Map<String,Object>> rowIterator)
protected Map<String,Object>
getFromRowCacheTransformed()
protected Map<String,Object>
getIdCacheData(Context context, String query, Iterator<Map<String,Object>> rowIterator)
If the where clause is present the cache is sql Vs Map of key Vs List of Rows.protected Map<String,Object>
getSimpleCacheData(Context context, String query, Iterator<Map<String,Object>> rowIterator)
If where clause is not present the cache is a Map of query vs List of Rows.void
initNewParent(Context context)
void
populateCache(String query, Iterator<Map<String,Object>> rowIterator)
Get all the rows from the datasource for the given query and cache them
-
-
-
Field Detail
-
CACHE_IMPL
public static final String CACHE_IMPL
Specify the class for the cache implementation
- See Also:
- Constant Field Values
-
CACHE_DELETE_PRIOR_DATA
public static final String CACHE_DELETE_PRIOR_DATA
If the cache supports persistent data, set to "true" to delete any prior persisted data before running the entity.
- See Also:
- Constant Field Values
-
CACHE_FOREIGN_KEY
public static final String CACHE_FOREIGN_KEY
Specify the Foreign Key from the parent entity to join on. Use if the cache is on a child entity.
- See Also:
- Constant Field Values
-
CACHE_PRIMARY_KEY
public static final String CACHE_PRIMARY_KEY
Specify the Primary Key field from this Entity to map the input records with
- See Also:
- Constant Field Values
-
CACHE_READ_ONLY
public static final String CACHE_READ_ONLY
If true, a pre-existing cache is re-opened for read-only access.
- See Also:
- Constant Field Values
-
-
Method Detail
-
initNewParent
public void initNewParent(Context context)
-
destroyAll
public void destroyAll()
-
populateCache
public void populateCache(String query, Iterator<Map<String,Object>> rowIterator)
Get all the rows from the datasource for the given query and cache them
-
getCacheData
public Map<String,Object> getCacheData(Context context, String query, Iterator<Map<String,Object>> rowIterator)
-
getIdCacheData
protected Map<String,Object> getIdCacheData(Context context, String query, Iterator<Map<String,Object>> rowIterator)
If the where clause is present the cache is sql Vs Map of key Vs List of Rows.- Parameters:
query
- the query string for which cached data is to be returned- Returns:
- the cached row corresponding to the given query after all variables have been resolved
-
getSimpleCacheData
protected Map<String,Object> getSimpleCacheData(Context context, String query, Iterator<Map<String,Object>> rowIterator)
If where clause is not present the cache is a Map of query vs List of Rows.- Parameters:
query
- string for which cached row is to be returned- Returns:
- the cached row corresponding to the given query
-
-