class BucketCache.WriterThread extends HasThread
| Modifier and Type | Field and Description |
|---|---|
private BlockingQueue<BucketCache.RAMQueueEntry> |
inputQueue |
private boolean |
writerEnabled |
| Constructor and Description |
|---|
WriterThread(BlockingQueue<BucketCache.RAMQueueEntry> queue) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
disableWriter() |
(package private) void |
doDrain(List<BucketCache.RAMQueueEntry> entries)
Flush the entries in ramCache to IOEngine and add bucket entry to backingMap.
|
private void |
putIntoBackingMap(BlockCacheKey key,
BucketCache.BucketEntry bucketEntry)
Put the new bucket entry into backingMap.
|
void |
run() |
getName, getThread, interrupt, isAlive, isInterrupted, join, join, join, setDaemon, setName, setPriority, setUncaughtExceptionHandler, startprivate final BlockingQueue<BucketCache.RAMQueueEntry> inputQueue
private volatile boolean writerEnabled
WriterThread(BlockingQueue<BucketCache.RAMQueueEntry> queue)
void disableWriter()
private void putIntoBackingMap(BlockCacheKey key, BucketCache.BucketEntry bucketEntry)
key - Block cache keybucketEntry - Bucket entry to put into backingMap.BlockCacheUtil.shouldReplaceExistingCacheBlock(BlockCache blockCache,BlockCacheKey
cacheKey, Cacheable newBlock)void doDrain(List<BucketCache.RAMQueueEntry> entries) throws InterruptedException
entries - Presumes list passed in here will be processed by this invocation only. No
interference expected.InterruptedExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.