public abstract class AbstractWriteBehindQueue extends Object implements WriteBehind
Constructor and Description |
---|
AbstractWriteBehindQueue(CacheConfiguration config)
Create a new write behind queue.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addItem(SingleOperation operation)
Add an item to the write behind queue
|
void |
delete(CacheEntry entry)
Add a delete operation for the given cache entry
|
protected Thread |
getProcessingThread()
Backdoor to allow killing the processing thread for testing purposes.
|
abstract long |
getQueueSize()
Gets the best estimate for items in the queue still awaiting processing.
|
protected abstract List<SingleOperation> |
quarantineItems()
Quarantine items to be processed.
|
protected abstract void |
reinsertUnprocessedItems(List<SingleOperation> operations)
Reinsert any unfinished operations into the queue.
|
void |
setOperationsFilter(OperationsFilter filter)
Set the operations filter that should be used.
|
void |
start(CacheWriter writer)
Start the write behind queue with a cache writer
|
void |
stop()
Stop the coordinator and all the internal data structures.
|
void |
write(Element element)
Add a write operation for a given element.
|
public AbstractWriteBehindQueue(CacheConfiguration config)
config
- the configuration for the queueprotected abstract List<SingleOperation> quarantineItems()
protected abstract void addItem(SingleOperation operation)
operation
- operation to be doneprotected abstract void reinsertUnprocessedItems(List<SingleOperation> operations)
operations
- list of unfinished operationspublic void start(CacheWriter writer)
start
in interface WriteBehind
writer
- the cache writer that should be used to process the operationsWriteBehind.stop()
public void setOperationsFilter(OperationsFilter filter)
setOperationsFilter
in interface WriteBehind
filter
- the filter that will be used as of nowpublic void write(Element element)
write
in interface WriteBehind
element
- the element for which a write operation will be added to the write behind queuepublic void delete(CacheEntry entry)
delete
in interface WriteBehind
entry
- the cache entry for which a delete operation will be added to the write behind queuepublic void stop() throws CacheException
stop
in interface WriteBehind
CacheException
WriteBehind.start(net.sf.ehcache.writer.CacheWriter)
public abstract long getQueueSize()
getQueueSize
in interface WriteBehind
protected Thread getProcessingThread()
Copyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.