public class BlockDiskCache extends AbstractDiskCache
alive, cacheEventQueue, cacheName, purgatory, purgHitscacheEventLogger, elementSerializer, keyMatcherCACHE_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, updatedisposeWithEventLogging, getMatchingWithEventLogging, getMultiple, getMultipleWithEventLogging, getWithEventLogging, removeAllWithEventLogging, removeWithEventLogging, updateWithEventLoggingcreateICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, setCacheEventLogger, setElementSerializer, setKeyMatcherclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetCacheEventLogger, setElementSerializergetMultiple, setKeyMatcherpublic BlockDiskCache(BlockDiskCacheAttributes cacheAttributes)
cacheAttributes - protected boolean verifyDisk()
public java.util.Set getGroupKeys(java.lang.String groupName)
(non-Javadoc)
getGroupKeys in interface AuxiliaryCachegetGroupKeys in class AbstractDiskCacheAbstractDiskCache.getGroupKeys(java.lang.String)public java.util.Map processGetMatching(java.lang.String pattern)
processGetMatching in class AbstractAuxiliaryCacheEventLoggingpattern - public int getSize()
(non-Javadoc)
getSize in interface ICachegetSize in class AbstractDiskCacheAbstractDiskCache.getSize()protected ICacheElement processGet(java.io.Serializable key)
processGet in class AbstractAuxiliaryCacheEventLoggingkey - AbstractDiskCache.doGet(java.io.Serializable)protected void processUpdate(ICacheElement element)
processUpdate in class AbstractAuxiliaryCacheEventLoggingelement - AbstractDiskCache.doUpdate(org.apache.jcs.engine.behavior.ICacheElement)protected boolean processRemove(java.io.Serializable key)
(non-Javadoc)
processRemove in class AbstractAuxiliaryCacheEventLoggingkey - AbstractDiskCache.doRemove(java.io.Serializable)protected void processRemoveAll()
(non-Javadoc)
processRemoveAll in class AbstractAuxiliaryCacheEventLoggingAbstractDiskCache.doRemoveAll()public void processDispose()
TODO make dispose window configurable.
processDispose in class AbstractAuxiliaryCacheEventLoggingpublic AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
(non-Javadoc)
AuxiliaryCache.getAuxiliaryCacheAttributes()protected void freeBlocks(int[] blocksToFree)
blocksToFree - public java.lang.String getStats()
getStats in interface ICachegetStats in class AbstractDiskCachepublic IStats getStatistics()
(non-Javadoc)
getStatistics in interface AuxiliaryCachegetStatistics in class AbstractDiskCacheAuxiliaryCache.getStatistics()protected java.lang.String getDiskLocation()
getDiskLocation in class AbstractDiskCacheCopyright © 2002-2013 Apache Software Foundation. All Rights Reserved.