org.ehcache.loaderwriter.writebehind
Interface WriteBehind<K,V>

All Known Implementing Classes:
AbstractWriteBehindQueue, AggregateWriteBehindQueue, LocalHeapWriteBehindQueue

public interface WriteBehind<K,V>


Method Summary
 void delete(K key)
          Deletes a single 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.
 void setOperationsFilter(OperationsFilter<SingleOperation<K,V>> filter)
          Set the operations filter that should be used.
 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
 

Method Detail

start

void start()
Start the write behind queue


load

V load(K key)
       throws java.lang.Exception
Loads the value to be associated with the given key in the Cache using this CacheLoaderWriter instance.

Parameters:
key - the key that will map to the value returned
Returns:
the value to be mapped
Throws:
java.lang.Exception

write

void write(K key,
           V value)
           throws CacheWritingException
Writes a single entry to the underlying system of record, maybe a brand new value or an update to an existing value

Throws:
CacheWritingException

delete

void delete(K key)
            throws CacheWritingException
Deletes a single entry from the underlying system of record.

Throws:
CacheWritingException

stop

void stop()
Stop the coordinator and all the internal data structures.

This stops as quickly as possible without losing any previously added items. However, no guarantees are made towards the processing of these items. It's highly likely that items are still inside the internal data structures and not processed.


setOperationsFilter

void setOperationsFilter(OperationsFilter<SingleOperation<K,V>> filter)
Set the operations filter that should be used.

Parameters:
filter - the filter that will be used as of now

getQueueSize

long getQueueSize()
Gets the best estimate for items in the queue still awaiting processing. Not including elements currently processed

Returns:
the amount of elements still awaiting processing.