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,
java.util.concurrent.ExecutorService es,
CacheLoader.StorageListener sl,
int exp)
Get a CacheLoader with all the options.
|
Modifier and Type | Method and Description |
---|---|
<T> java.util.concurrent.Future<?> |
loadData(java.util.Iterator<java.util.Map.Entry<java.lang.String,T>> i)
Load data from the given iterator.
|
<T> java.util.concurrent.Future<?> |
loadData(java.util.Map<java.lang.String,T> map)
Load data from the given map.
|
<T> java.util.concurrent.Future<java.lang.Boolean> |
push(java.lang.String k,
T value)
Push a value into the cache.
|
public CacheLoader(MemcachedClientIF c)
c
- a clientpublic CacheLoader(MemcachedClientIF c, java.util.concurrent.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> java.util.concurrent.Future<?> loadData(java.util.Iterator<java.util.Map.Entry<java.lang.String,T>> i)
T
- type of data being loadedi
- the iterator of data to loadpublic <T> java.util.concurrent.Future<?> loadData(java.util.Map<java.lang.String,T> map)
T
- type of data being loadedmap
- the map of keys to values that needs to be loadedpublic <T> java.util.concurrent.Future<java.lang.Boolean> push(java.lang.String k, T value)
T
- the type being storedk
- the keyvalue
- the valueCopyright © 2006-2009 Dustin Sallings, 2009-2013 Couchbase, Inc.