|
ehcache | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.ehcache.store.DiskStore
A disk cache implementation.
Field Summary |
Fields inherited from interface net.sf.ehcache.store.Store |
CACHE_HUB, DISK_CACHE, STATUS_ALIVE, STATUS_DISPOSED, STATUS_ERROR, STATUS_UNINITIALISED |
Constructor Summary | |
DiskStore(Cache cache,
java.lang.String diskPath)
Creates a disk store. |
Method Summary | |
float |
calculateDataFileSparseness()
The design of the layout on the data file means that there will be small gaps created when DiskElements are reused. |
void |
dispose()
Shuts down the disk store in preparation for cache shutdown If a VM crash happens, the shutdown hook will not run. |
Element |
get(java.io.Serializable key)
Gets an Element from the Disk Store. |
int |
getCacheType()
Returns the store type. |
java.lang.String |
getDataFileName()
|
java.lang.String |
getDataFilePath()
|
long |
getDataFileSize()
|
java.lang.String |
getIndexFileName()
|
long |
getIndexFileSize()
|
java.lang.Object[] |
getKeyArray()
Gets an Array of the keys for all elements in the disk store. |
java.lang.String |
getName()
Returns the cache name this disk cache is spooling for |
Element |
getQuiet(java.io.Serializable key)
Gets an Element from the Disk Store, without updating statistics |
int |
getSize()
Returns the current store size. |
int |
getStatus()
Returns the cache status. |
long |
getTotalFileSize()
|
long |
getUsedDataSize()
When elements are deleted, spaces are left in the file. |
boolean |
isExpiryThreadAlive()
The expiry thread is started provided the cache is not eternal If started it will continue to run until the dispose() method is called,
at which time it should be interrupted and then die. |
boolean |
isSpoolEmpty()
Whether there are any elements waiting to be spooled to disk. |
void |
put(Element entry)
Puts an item into the cache. |
boolean |
remove(java.io.Serializable key)
Removes an item from the cache. |
void |
removeAll()
Removes all cached items from the cache. |
java.lang.String |
toString()
Returns a String representation of the DiskStore |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DiskStore(Cache cache, java.lang.String diskPath)
cache
- the Cache
that the store is part ofdiskPath
- the directory in which to create data and index filesMethod Detail |
public int getCacheType()
getCacheType
in interface Store
public java.lang.String getName()
getName
in interface Store
public int getStatus()
getStatus
in interface Store
public Element get(java.io.Serializable key) throws java.io.IOException
Element
from the Disk Store.
get
in interface Store
java.io.IOException
public Element getQuiet(java.io.Serializable key) throws java.io.IOException
Element
from the Disk Store, without updating statistics
java.io.IOException
public java.lang.Object[] getKeyArray()
Serializable
keyspublic int getSize()
getSize
in interface Store
public void put(Element entry) throws java.io.IOException
put
in interface Store
java.io.IOException
public boolean remove(java.io.Serializable key) throws java.io.IOException
remove
in interface Store
java.io.IOException
public void removeAll() throws java.io.IOException
removeAll
in interface Store
java.io.IOException
public void dispose()
dispose
in interface Store
public boolean isSpoolEmpty()
public java.lang.String toString()
String
representation of the DiskStore
public long getTotalFileSize()
public long getDataFileSize()
public float calculateDataFileSparseness()
public long getUsedDataSize()
getDataFileSize()
as a measure of fragmentation.
public long getIndexFileSize()
public java.lang.String getDataFileName()
public java.lang.String getDataFilePath()
public java.lang.String getIndexFileName()
public boolean isExpiryThreadAlive()
dispose()
method is called,
at which time it should be interrupted and then die.
|
ehcache | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |