|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ehcache.impl.internal.loaderwriter.writebehind.StripedWriteBehind<K,V>
public class StripedWriteBehind<K,V>
| Constructor Summary | |
|---|---|
StripedWriteBehind(ExecutionService executionService,
java.lang.String defaultThreadPool,
WriteBehindConfiguration config,
CacheLoaderWriter<K,V> cacheLoaderWriter)
|
|
| Method Summary | |
|---|---|
void |
delete(K key)
Deletes a single entry from the underlying system of record. |
void |
deleteAll(java.lang.Iterable<? extends K> keys)
Deletes a set of entry from the underlying system of record. |
long |
getQueueSize()
Gets the best estimate for items in the queue still awaiting processing. |
V |
load(K key)
Loads the value to be associated with the given key in the Cache using this
CacheLoaderWriter instance. |
java.util.Map<K,V> |
loadAll(java.lang.Iterable<? extends K> keys)
Loads the values to be associated with the keys in the Cache using this
CacheLoaderWriter instance. |
void |
start()
Start the write behind queue |
void |
stop()
Stop the coordinator and all the internal data structures. |
void |
write(K key,
V value)
Writes a single entry to the underlying system of record, maybe a brand new value or an update to an existing value |
void |
writeAll(java.lang.Iterable<? extends java.util.Map.Entry<? extends K,? extends V>> entries)
Writes multiple entries to the underlying system of record. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StripedWriteBehind(ExecutionService executionService,
java.lang.String defaultThreadPool,
WriteBehindConfiguration config,
CacheLoaderWriter<K,V> cacheLoaderWriter)
| Method Detail |
|---|
public void start()
WriteBehind
start in interface WriteBehind<K,V>
public V load(K key)
throws java.lang.Exception
CacheLoaderWriterCache using this
CacheLoaderWriter instance.
load in interface CacheLoaderWriter<K,V>key - the key that will map to the value returned
java.lang.Exception - if the value cannot be loaded
public java.util.Map<K,V> loadAll(java.lang.Iterable<? extends K> keys)
throws java.lang.Exception
CacheLoaderWriterCache using this
CacheLoaderWriter instance. The returned Map should contain
null mapped keys for values that couldn't be found.
key as found in the input parameter keys
mapped to the result of loadAllResult.get(key). Any other mapping will be ignored.
loadAll in interface CacheLoaderWriter<K,V>keys - the keys that will be mapped to the values returned in the map
Map of values for each key passed in, where no mapping means no value to map.
BulkCacheLoadingException - This writer must throw this exception to indicate partial
success. The exception declares which keys were actually loaded (if any)
java.lang.Exception - a generic failure. All values will be considered not loaded in this case
public void write(K key,
V value)
throws java.lang.Exception
CacheLoaderWriter
write in interface CacheLoaderWriter<K,V>key - the key of the mapping being installed or updatedvalue - the actual value being updated
java.lang.Exception - if the write operation failedCache.put(Object, Object)
public void writeAll(java.lang.Iterable<? extends java.util.Map.Entry<? extends K,? extends V>> entries)
throws BulkCacheWritingException,
java.lang.Exception
CacheLoaderWriterBulkCacheWritingException must be thrown (see below)
writeAll in interface CacheLoaderWriter<K,V>entries - the key to value mappings
BulkCacheWritingException - This writer must throw this exception to indicate partial success. The exception
declares which keys were actually written (if any)
java.lang.Exception - a generic failure. All entries will be considered not written in this caseCache.putAll(java.util.Map)
public void delete(K key)
throws java.lang.Exception
CacheLoaderWriter
delete in interface CacheLoaderWriter<K,V>key - the key to delete
java.lang.Exception - if the write operation failedCache.remove(Object)
public void deleteAll(java.lang.Iterable<? extends K> keys)
throws BulkCacheWritingException,
java.lang.Exception
CacheLoaderWriterBulkCacheWritingException must be thrown (see below)
deleteAll in interface CacheLoaderWriter<K,V>keys - the keys to delete
BulkCacheWritingException - This writer must throw this exception to indicate partial success. The exception
declares which keys were actually deleted (if any)
java.lang.Exception - a generic failure. All entries will be considered not deleted in this caseCache.removeAll(java.util.Set)public void stop()
WriteBehind
stop in interface WriteBehind<K,V>public long getQueueSize()
WriteBehind
getQueueSize in interface WriteBehind<K,V>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||