Interface CacheManager
- All Known Implementing Classes:
HazelcastCacheManager,MemoryCacheManager,MVStoreCacheManager
public interface CacheManager
-
Method Summary
Modifier and TypeMethodDescription<T> voidaddCacheEntryChangeListener(CacheEntryChangeListener<T> listener, String cacheName) Adds a cache entry change listener to the specified cache.booleancacheExists(String name) voidClears all caches.voidConsumes every caches, where record value are serialized JSON String.Gets the admin cache for storing administrative data.<T> CacheMap<T> getCacheMap(String name, Class<T> valueType) Gets a named cache storing objects of the supplied type.<T> CacheQueue<T> getCacheQueue(String name, Class<T> valueType) Gets a FIFO queue.getCacheSet(String name) As string-based set, keeping only unique keys.Gets a generic shared cache bound to a crawler that persists forever (never deleted).Gets a generic shared cache tied to a specific crawler run and does not get persisted when the crawler run terminates.Gets a generic shared cache bound to a crawl session that persists until a new crawl session is started (for the same crawler).Gets the pipeline step cache for storing current pipeline steps.Gets the pipeline worker status cache for storing worker statuses.voidimportCaches(List<SerializedCache> caches) Import caches previously exported withexportCaches(Consumer).<T> voidremoveCacheEntryChangeListener(CacheEntryChangeListener<T> listener, String cacheName) Removes a cache entry change listener from the specified cache.vendor()Gets the vendor-specific implementation object.
-
Method Details
-
getCacheMap
Gets a named cache storing objects of the supplied type. By default the returned cache is persisted, but cache implementations may decide otherwise (based on cache name, configuration, etc.).- Type Parameters:
T- type of the value to store- Parameters:
name- cache namevalueType- class of the value to store- Returns:
- a named cache
-
getCacheSet
As string-based set, keeping only unique keys.- Parameters:
name- cache name- Returns:
- a named cache set
-
cacheExists
-
exportCaches
Consumes every caches, where record value are serialized JSON String. Entries are lazy loaded.- Parameters:
c- serialized cache.
-
importCaches
Import caches previously exported withexportCaches(Consumer).- Parameters:
caches- caches to import
-
clearCaches
void clearCaches()Clears all caches. -
getCrawlerCache
Gets a generic shared cache bound to a crawler that persists forever (never deleted).- Returns:
- crawler-scoped persistent cache
-
getCrawlSessionCache
Gets a generic shared cache bound to a crawl session that persists until a new crawl session is started (for the same crawler).- Returns:
- crawl session-scoped persistent cache
-
getCrawlRunCache
Gets a generic shared cache tied to a specific crawler run and does not get persisted when the crawler run terminates.- Returns:
- crawl run non-persistent cache
-
getCacheQueue
Gets a FIFO queue.- Type Parameters:
T- the type of elements in the queue- Parameters:
name- the queue namevalueType- the value type- Returns:
- cache queue
-
getAdminCache
Gets the admin cache for storing administrative data.- Returns:
- admin cache
-
getPipelineStepCache
CacheMap<StepRecord> getPipelineStepCache()Gets the pipeline step cache for storing current pipeline steps.- Returns:
- pipeline step cache
-
getPipelineWorkerStatusCache
CacheMap<StepRecord> getPipelineWorkerStatusCache()Gets the pipeline worker status cache for storing worker statuses.- Returns:
- pipeline worker status cache
-
addCacheEntryChangeListener
Adds a cache entry change listener to the specified cache.- Type Parameters:
T- the type of values in the cache- Parameters:
listener- the listener to addcacheName- the name of the cache
-
removeCacheEntryChangeListener
Removes a cache entry change listener from the specified cache.- Type Parameters:
T- the type of values in the cache- Parameters:
listener- the listener to removecacheName- the name of the cache
-
vendor
Object vendor()Gets the vendor-specific implementation object.- Returns:
- vendor implementation
-