public class WriteBehindQueueManager extends Object implements WriteBehind
Modifier and Type | Class and Description |
---|---|
protected static class |
WriteBehindQueueManager.WriteBehindQueueFactory
Factory used to create write behind queues.
|
Modifier | Constructor and Description |
---|---|
|
WriteBehindQueueManager(CacheConfiguration config)
Create a new write behind queue manager.
|
protected |
WriteBehindQueueManager(CacheConfiguration config,
WriteBehindQueueManager.WriteBehindQueueFactory queueFactory)
Create the write behind queue manager with queues created via the passed in
WriteBehindQueueManager.WriteBehindQueueFactory |
Modifier and Type | Method and Description |
---|---|
void |
delete(CacheEntry entry)
Add a delete operation for the given cache entry
|
long |
getQueueSize()
Gets the best estimate for items in the queue still awaiting processing.
|
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.
|
protected WriteBehindQueueManager(CacheConfiguration config, WriteBehindQueueManager.WriteBehindQueueFactory queueFactory)
WriteBehindQueueManager.WriteBehindQueueFactory
config
- configuration for the cache this write behind queue manager is working withqueueFactory
- factory used to create the write behind queues.public WriteBehindQueueManager(CacheConfiguration config)
CacheWriterConfiguration.getWriteBehindConcurrency()
config
- the configuration for the queuepublic void start(CacheWriter writer) throws CacheException
start
in interface WriteBehind
writer
- the cache writer that should be used to process the operationsCacheException
WriteBehind.stop()
public 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 setOperationsFilter(OperationsFilter filter)
setOperationsFilter
in interface WriteBehind
filter
- the filter that will be used as of nowpublic void stop() throws CacheException
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.
stop
in interface WriteBehind
CacheException
WriteBehind.start(net.sf.ehcache.writer.CacheWriter)
public long getQueueSize()
getQueueSize
in interface WriteBehind
Copyright © 2003–2016 Terracotta, Inc.. All rights reserved.