| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.spy.memcached.compat.SpyObject
net.spy.memcached.util.CacheLoader
public class CacheLoader
CacheLoader provides efficient mechanisms for storing lots of data.
| Nested Class Summary | |
|---|---|
static interface | 
CacheLoader.StorageListener
If you are interested in the results of your data load, this interface will receive them.  | 
| Constructor Summary | |
|---|---|
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.  | 
|
| Method Summary | ||
|---|---|---|
 | 
loadData(Iterator<Map.Entry<String,T>> i)
Load data from the given iterator.  | 
|
 | 
loadData(Map<String,T> map)
Load data from the given map.  | 
|
 | 
push(String k,
     T value)
Push a value into the cache.  | 
|
| Methods inherited from class net.spy.memcached.compat.SpyObject | 
|---|
getLogger | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public CacheLoader(MemcachedClientIF c)
c - a client
public 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 loading| Method Detail | 
|---|
public <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 loaded
public <T> Future<Boolean> push(String k,
                                T value)
T - the type being storedk - the keyvalue - the value
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||