public class BlockDiskCache extends AbstractDiskCache
alive, cacheEventQueue, cacheName, purgatory, purgHits
cacheEventLogger, elementSerializer, keyMatcher
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE
Constructor and Description |
---|
BlockDiskCache(BlockDiskCacheAttributes cacheAttributes)
Constructs the BlockDisk after setting up the root directory.
|
Modifier and Type | Method and Description |
---|---|
protected void |
freeBlocks(int[] blocksToFree)
Add these blocks to the emptyBlock list.
|
AuxiliaryCacheAttributes |
getAuxiliaryCacheAttributes()
Returns the attributes.
|
protected java.lang.String |
getDiskLocation()
This is used by the event logging.
|
java.util.Set |
getGroupKeys(java.lang.String groupName)
This requires a full iteration through the keys.
|
int |
getSize()
Returns the number of keys.
|
IStats |
getStatistics()
Returns info about the disk cache.
|
java.lang.String |
getStats()
Gets basic stats for the disk cache.
|
void |
processDispose()
Dispose of the disk cache in a background thread.
|
protected ICacheElement |
processGet(java.io.Serializable key)
Gets the ICacheElement for the key if it is in the cache.
|
java.util.Map |
processGetMatching(java.lang.String pattern)
Gets matching items from the cache.
|
protected boolean |
processRemove(java.io.Serializable key)
Returns true if the removal was succesful; or false if there is nothing to remove.
|
protected void |
processRemoveAll()
Resets the keyfile, the disk file, and the memory key map.
|
protected void |
processUpdate(ICacheElement element)
Writes an element to disk.
|
protected boolean |
verifyDisk()
We need to verify that the file on disk uses the same block size and that the file is the
proper size.
|
dispose, doDispose, doGet, doGetMatching, doRemove, doRemoveAll, doUpdate, get, getCacheName, getCacheType, getEventLoggingExtraInfo, getMatching, getStatus, processGetMultiple, remove, removeAll, update
disposeWithEventLogging, getMatchingWithEventLogging, getMultiple, getMultipleWithEventLogging, getWithEventLogging, removeAllWithEventLogging, removeWithEventLogging, updateWithEventLogging
createICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, setCacheEventLogger, setElementSerializer, setKeyMatcher
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setCacheEventLogger, setElementSerializer
getMultiple, setKeyMatcher
public BlockDiskCache(BlockDiskCacheAttributes cacheAttributes)
cacheAttributes
- protected boolean verifyDisk()
public java.util.Set getGroupKeys(java.lang.String groupName)
(non-Javadoc)
getGroupKeys
in interface AuxiliaryCache
getGroupKeys
in class AbstractDiskCache
AbstractDiskCache.getGroupKeys(java.lang.String)
public java.util.Map processGetMatching(java.lang.String pattern)
processGetMatching
in class AbstractAuxiliaryCacheEventLogging
pattern
- public int getSize()
(non-Javadoc)
getSize
in interface ICache
getSize
in class AbstractDiskCache
AbstractDiskCache.getSize()
protected ICacheElement processGet(java.io.Serializable key)
processGet
in class AbstractAuxiliaryCacheEventLogging
key
- AbstractDiskCache.doGet(java.io.Serializable)
protected void processUpdate(ICacheElement element)
processUpdate
in class AbstractAuxiliaryCacheEventLogging
element
- AbstractDiskCache.doUpdate(org.apache.jcs.engine.behavior.ICacheElement)
protected boolean processRemove(java.io.Serializable key)
(non-Javadoc)
processRemove
in class AbstractAuxiliaryCacheEventLogging
key
- AbstractDiskCache.doRemove(java.io.Serializable)
protected void processRemoveAll()
(non-Javadoc)
processRemoveAll
in class AbstractAuxiliaryCacheEventLogging
AbstractDiskCache.doRemoveAll()
public void processDispose()
TODO make dispose window configurable.
processDispose
in class AbstractAuxiliaryCacheEventLogging
public AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
(non-Javadoc)
AuxiliaryCache.getAuxiliaryCacheAttributes()
protected void freeBlocks(int[] blocksToFree)
blocksToFree
- public java.lang.String getStats()
getStats
in interface ICache
getStats
in class AbstractDiskCache
public IStats getStatistics()
(non-Javadoc)
getStatistics
in interface AuxiliaryCache
getStatistics
in class AbstractDiskCache
AuxiliaryCache.getStatistics()
protected java.lang.String getDiskLocation()
getDiskLocation
in class AbstractDiskCache
Copyright © 2002-2013 Apache Software Foundation. All Rights Reserved.