|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jcs.auxiliary.disk.AbstractDiskCache
org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache
Disk cache that uses a RandomAccessFile with keys stored in memory. The maximum number of keys stored in memory is configurable. The disk cache tries to recycle spots on disk to limit file expansion.
Nested Class Summary | |
class |
IndexedDiskCache.LRUMap
class for recylcing and lru |
Field Summary | |
protected EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock |
storageLock
use this lock to synchronize reads and writes to the underlying storage mechansism. |
Fields inherited from class org.apache.jcs.auxiliary.disk.AbstractDiskCache |
alive, cacheEventQueue, cacheName, purgatory, purgHits |
Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType |
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE |
Constructor Summary | |
IndexedDiskCache(IndexedDiskCacheAttributes cattr)
Constructor for the DiskCache object |
Method Summary | |
void |
doDispose()
Dispose of the disk cache in a background thread. |
protected ICacheElement |
doGet(java.io.Serializable key)
Get a value from the persistent store. |
void |
doOptimizeRealTime()
Dispose of the disk cache in a background thread. |
boolean |
doRemove(java.io.Serializable key)
Returns true if the removal was succesful; or false if there is nothing to remove. |
void |
doRemoveAll()
Remove all the items fromt he disk cache by reseting everything. |
void |
doUpdate(ICacheElement ce)
Update the disk cache. |
void |
dump()
For debugging. |
protected long |
getDataFileSize()
This is for debugging and testing. |
java.util.Set |
getGroupKeys(java.lang.String groupName)
Gets the set of keys of objects currently in the group |
int |
getSize()
Returns the current cache size. |
IStats |
getStatistics()
Returns the historical and statistical data for a region's auxiliary cache. |
java.lang.String |
getStats()
Gets basic stats for the disk cache. |
protected void |
loadKeys()
Loads the keys from the .key file. |
protected void |
optimizeFile()
Note: synchronization currently must be managed by the caller method-- dispose. |
protected void |
optimizeRealTime()
Realtime optimization is handled by this method. |
protected void |
saveKeys()
Saves key file to disk. |
Methods inherited from class org.apache.jcs.auxiliary.disk.AbstractDiskCache |
dispose, get, getCacheName, getCacheType, getStatus, remove, removeAll, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock storageLock
Constructor Detail |
public IndexedDiskCache(IndexedDiskCacheAttributes cattr)
cattr
- Method Detail |
protected void loadKeys() throws java.lang.InterruptedException
java.lang.InterruptedException
protected void saveKeys()
public void doUpdate(ICacheElement ce)
doUpdate
in class AbstractDiskCache
ce
- protected ICacheElement doGet(java.io.Serializable key)
AbstractDiskCache
doGet
in class AbstractDiskCache
key
-
AbstractDiskCache.doGet(java.io.Serializable)
public java.util.Set getGroupKeys(java.lang.String groupName)
AuxiliaryCache
getGroupKeys
in interface AuxiliaryCache
getGroupKeys
in class AbstractDiskCache
public boolean doRemove(java.io.Serializable key)
doRemove
in class AbstractDiskCache
key
-
public void doRemoveAll()
doRemoveAll
in class AbstractDiskCache
public void doDispose()
doDispose
in class AbstractDiskCache
public void doOptimizeRealTime()
protected void optimizeRealTime()
protected void optimizeFile()
public int getSize()
getSize
in interface AuxiliaryCache
getSize
in class AbstractDiskCache
ICache.getSize()
protected long getDataFileSize() throws java.io.IOException
java.io.IOException
public void dump()
public java.lang.String getStats()
getStats
in interface ICache
getStats
in class AbstractDiskCache
public IStats getStatistics()
AuxiliaryCache
getStatistics
in interface AuxiliaryCache
getStatistics
in class AbstractDiskCache
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |