public abstract class SynchronousLoadingBlockCache extends Object implements BlockCache
BlockCache.Loader, BlockCache.Stats
Constructor and Description |
---|
SynchronousLoadingBlockCache() |
Modifier and Type | Method and Description |
---|---|
CacheEntry |
getBlock(String blockName,
BlockCache.Loader loader)
This method allows a cache to prevent concurrent loads of the same block.
|
protected abstract CacheEntry |
getBlockNoStats(String blockName)
Get a block from the cache without changing any stats the cache is keeping.
|
protected abstract int |
getMaxEntrySize()
Get the maximum size of an individual cache entry.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cacheBlock, getBlock, getMaxHeapSize, getMaxSize, getStats
protected abstract int getMaxEntrySize()
protected abstract CacheEntry getBlockNoStats(String blockName)
public CacheEntry getBlock(String blockName, BlockCache.Loader loader)
BlockCache
SynchronousLoadingBlockCache
is an abstract class that a cache can extent which does
prevent concurrent loading of the same block.getBlock
in interface BlockCache
blockName
- Block name to fetchloader
- If the block is not present in the cache, the loader can be called to load it.Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.