| Modifier and Type | Class and Description |
|---|---|
| private class | AbstractWriteBehindQueue.ProcessingThread
Thread this will continuously process the items in the queue. |
| Modifier and Type | Field and Description |
|---|---|
| private final AtomicBoolean | |
| private final String | |
| private CacheWriter | |
| private volatile OperationsFilter | |
| private final AtomicLong | |
| private final AtomicLong | |
| private static final Logger | |
| private final int | |
| private final long | |
| private final long | |
| private static final int | |
| private final Thread | |
| private final Condition | |
| private final Condition | |
| private final Condition | |
| private final ReentrantReadWriteLock | |
| private final ReentrantReadWriteLock. | |
| private final ReentrantReadWriteLock. | |
| private final int | |
| private final int | |
| private final int | |
| private boolean | |
| private boolean | |
| private final boolean | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | AbstractWriteBehindQueue(CacheConfiguration
the configuration for the queue config)Create a new write behind queue. |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract void | |
| private List | |
| public void | delete(CacheEntry
the cache entry for which a delete operation will be added to the write behind queue entry)Implements net. |
| private int | |
| private void | |
| private long | |
| protected Thread | |
| public abstract long | Returns: the amount of elements still awaiting processing.Redeclares net. |
| private String | |
| private boolean | |
| private void | |
| private void | |
| private void | |
| private void | |
| protected abstract List | |
| private void | |
| protected abstract void | reinsertUnprocessedItems(List<SingleOperation>
list of unfinished operations operations)Reinsert any unfinished operations into the queue. |
| public void | setOperationsFilter(OperationsFilter<T>
the filter that will be used as of now filter)Implements net. |
| public void | start(CacheWriter
the cache writer that should be used to process the operations writer)Implements net. |
| public void | stop()
Implements net. |
| private void | |
| private void | waitUntilEnoughTimeHasPassed(List<SingleOperation> quarantined, int batchSize, long secondsSinceLastWorkDone)
|
| private void | |
| public void | write(Element
the element for which a write operation will be added to the write behind queue element)Implements net. |
| busyProcessing | back to summary |
|---|---|
| private final AtomicBoolean busyProcessing | |
| cacheName | back to summary |
|---|---|
| private final String cacheName | |
| cacheWriter | back to summary |
|---|---|
| private CacheWriter cacheWriter | |
| filter | back to summary |
|---|---|
| private volatile OperationsFilter<T> filter | |
| lastProcessing | back to summary |
|---|---|
| private final AtomicLong lastProcessing | |
| lastWorkDone | back to summary |
|---|---|
| private final AtomicLong lastWorkDone | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| maxQueueSize | back to summary |
|---|---|
| private final int maxQueueSize | |
| maxWriteDelayMs | back to summary |
|---|---|
| private final long maxWriteDelayMs | |
| minWriteDelayMs | back to summary |
|---|---|
| private final long minWriteDelayMs | |
| MS_IN_SEC | back to summary |
|---|---|
| private static final int MS_IN_SEC | |
| processingThread | back to summary |
|---|---|
| private final Thread processingThread | |
| queueIsEmpty | back to summary |
|---|---|
| private final Condition queueIsEmpty | |
| queueIsFull | back to summary |
|---|---|
| private final Condition queueIsFull | |
| queueIsStopped | back to summary |
|---|---|
| private final Condition queueIsStopped | |
| queueLock | back to summary |
|---|---|
| private final ReentrantReadWriteLock queueLock | |
| queueReadLock | back to summary |
|---|---|
| private final ReentrantReadWriteLock. | |
| queueWriteLock | back to summary |
|---|---|
| private final ReentrantReadWriteLock. | |
| rateLimitPerSecond | back to summary |
|---|---|
| private final int rateLimitPerSecond | |
| retryAttemptDelaySeconds | back to summary |
|---|---|
| private final int retryAttemptDelaySeconds | |
| retryAttempts | back to summary |
|---|---|
| private final int retryAttempts | |
| stopped | back to summary |
|---|---|
| private boolean stopped | |
| stopping | back to summary |
|---|---|
| private boolean stopping | |
| writeBatching | back to summary |
|---|---|
| private final boolean writeBatching | |
| writeBatchSize | back to summary |
|---|---|
| private final int writeBatchSize | |
| AbstractWriteBehindQueue | back to summary |
|---|---|
| public AbstractWriteBehindQueue(CacheConfiguration config) Create a new write behind queue.
| |
| addItem | back to summary |
|---|---|
| protected abstract void addItem(SingleOperation operation) Add an item to the write behind queue
| |
| createMonomorphicBatches | back to summary |
|---|---|
| private List | |
| delete | back to summary |
|---|---|
| public void delete(CacheEntry entry) Implements net. Doc from net. Add a delete operation for the given cache entry
| |
| determineBatchSize | back to summary |
|---|---|
| private int determineBatchSize(List<SingleOperation> quarantined) | |
| filterQuarantined | back to summary |
|---|---|
| private void filterQuarantined(List<SingleOperation> quarantined) | |
| getLastProcessing | back to summary |
|---|---|
| private long getLastProcessing() | |
| getProcessingThread | back to summary |
|---|---|
| protected Thread getProcessingThread() Backdoor to allow killing the processing thread for testing purposes. | |
| getQueueSize | back to summary |
|---|---|
| public abstract long getQueueSize() Redeclares net. Gets the best estimate for items in the queue still awaiting processing. Not including elements currently processed
| |
| getThreadName | back to summary |
|---|---|
| private String getThreadName() | |
| isStopped | back to summary |
|---|---|
| private boolean isStopped() | |
| processBatchedOperations | back to summary |
|---|---|
| private void processBatchedOperations(List<SingleOperation> quarantined) | |
| processItems | back to summary |
|---|---|
| private void processItems() throws CacheException | |
| processQuarantinedItems | back to summary |
|---|---|
| private void processQuarantinedItems(List<SingleOperation> quarantined) | |
| processSingleOperation | back to summary |
|---|---|
| private void processSingleOperation(List<SingleOperation> quarantined) | |
| quarantineItems | back to summary |
|---|---|
| protected abstract List Quarantine items to be processed.
| |
| reassemble | back to summary |
|---|---|
| private void reassemble(List<SingleOperation> quarantined) | |
| reinsertUnprocessedItems | back to summary |
|---|---|
| protected abstract void reinsertUnprocessedItems(List<SingleOperation> operations) Reinsert any unfinished operations into the queue.
| |
| setOperationsFilter | back to summary |
|---|---|
| public void setOperationsFilter(OperationsFilter<T> filter) Implements net. Doc from net. Set the operations filter that should be used.
| |
| start | back to summary |
|---|---|
| public void start(CacheWriter writer) Implements net. Doc from net. Start the write behind queue with a cache writer
| |
| stop | back to summary |
|---|---|
| public void stop() throws CacheException Implements net. Doc from net. 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. | |
| waitForQueueSizeToDrop | back to summary |
|---|---|
| private void waitForQueueSizeToDrop() | |
| waitUntilEnoughTimeHasPassed | back to summary |
|---|---|
| private void waitUntilEnoughTimeHasPassed(List<SingleOperation> quarantined, int batchSize, long secondsSinceLastWorkDone) | |
| waitUntilEnoughWorkItemsAvailable | back to summary |
|---|---|
| private void waitUntilEnoughWorkItemsAvailable(List<SingleOperation> quarantined, int workSize) | |
| write | back to summary |
|---|---|
| public void write(Element element) Implements net. Doc from net. Add a write operation for a given element.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private void |
| ProcessingThread | back to summary |
|---|---|
| private ProcessingThread() | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation. | |
| stopTheQueueThread | back to summary |
|---|---|
| private void stopTheQueueThread() | |