public class CacheLoader extends SpyObject
Modifier and Type | Class and Description |
---|---|
static interface |
CacheLoader.StorageListener
If you are interested in the results of your data load, this interface will
receive them.
|
Constructor and Description |
---|
CacheLoader(MemcachedClientIF c)
Simple CacheLoader constructor that doesn't provide any feedback and caches
forever.
|
CacheLoader(MemcachedClientIF c,
ExecutorService es,
CacheLoader.StorageListener sl,
int exp)
Get a CacheLoader with all the options.
|
Modifier and Type | Method and Description |
---|---|
<T> Future<?> |
loadData(Iterator<Map.Entry<String,T>> i)
Load data from the given iterator.
|
<T> Future<?> |
loadData(Map<String,T> map)
Load data from the given map.
|
<T> Future<Boolean> |
push(String k,
T value)
Push a value into the cache.
|
public CacheLoader(MemcachedClientIF c)
c
- a clientpublic CacheLoader(MemcachedClientIF c, ExecutorService es, CacheLoader.StorageListener sl, int exp)
c
- a clientes
- an ExecutorService (e.g. thread pool) to dispatch results (may be
null, in which case no listener may be provided)sl
- a storage listener (may be null)exp
- expiration to use while loadingpublic <T> Future<?> loadData(Iterator<Map.Entry<String,T>> i)
T
- type of data being loadedi
- the iterator of data to loadpublic <T> Future<?> loadData(Map<String,T> map)
T
- type of data being loadedmap
- the map of keys to values that needs to be loadedCopyright © 2021. All rights reserved.