|
||||||||||
| 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,
java.util.concurrent.ExecutorService es,
CacheLoader.StorageListener sl,
int exp)
Get a CacheLoader with all the options. |
|
| Method Summary | ||
|---|---|---|
|
loadData(java.util.Iterator<java.util.Map.Entry<java.lang.String,T>> i)
Load data from the given iterator. |
|
|
loadData(java.util.Map<java.lang.String,T> map)
Load data from the given map. |
|
|
push(java.lang.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,
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 loading| Method Detail |
|---|
public <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 loaded
public <T> java.util.concurrent.Future<java.lang.Boolean> push(java.lang.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 | |||||||||