|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ehcache.impl.internal.loaderwriter.writebehind.BatchingLocalHeapWriteBehindQueue<K,V>
public class BatchingLocalHeapWriteBehindQueue<K,V>
Constructor Summary | |
---|---|
BatchingLocalHeapWriteBehindQueue(ExecutionService executionService,
java.lang.String defaultThreadPool,
WriteBehindConfiguration config,
CacheLoaderWriter<K,V> cacheLoaderWriter)
|
Method Summary | ||
---|---|---|
protected void |
addOperation(SingleOperation<K,V> operation)
|
|
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. |
|
protected SingleOperation<K,V> |
getOperation(K key)
|
|
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. |
|
protected static
|
putUninterruptibly(java.util.concurrent.BlockingQueue<T> queue,
T r)
|
|
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 BatchingLocalHeapWriteBehindQueue(ExecutionService executionService, java.lang.String defaultThreadPool, WriteBehindConfiguration config, CacheLoaderWriter<K,V> cacheLoaderWriter)
Method Detail |
---|
protected SingleOperation<K,V> getOperation(K key)
protected void addOperation(SingleOperation<K,V> operation)
public void start()
WriteBehind
public void stop()
WriteBehind
public long getQueueSize()
public V load(K key) throws java.lang.Exception
CacheLoaderWriter
Cache
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 loadedpublic java.util.Map<K,V> loadAll(java.lang.Iterable<? extends K> keys) throws java.lang.Exception
CacheLoaderWriter
Cache
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 casepublic void write(K key, V value) throws CacheWritingException
CacheLoaderWriter
write
in interface CacheLoaderWriter<K,V>
key
- the key of the mapping being installed or updatedvalue
- the actual value being updated
CacheWritingException
Cache.put(Object, Object)
public void writeAll(java.lang.Iterable<? extends java.util.Map.Entry<? extends K,? extends V>> entries) throws BulkCacheWritingException, java.lang.Exception
CacheLoaderWriter
BulkCacheWritingException
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 CacheWritingException
CacheLoaderWriter
delete
in interface CacheLoaderWriter<K,V>
key
- the key to delete
CacheWritingException
Cache.remove(Object)
public void deleteAll(java.lang.Iterable<? extends K> keys) throws BulkCacheWritingException, java.lang.Exception
CacheLoaderWriter
BulkCacheWritingException
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)
protected static <T> void putUninterruptibly(java.util.concurrent.BlockingQueue<T> queue, T r)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |