public abstract class AbstractIndexedDiskCache<K extends Serializable,V extends Serializable> extends AbstractMapBackedCustomTtlCache<K,V,BlockMetaData>
| Modifier and Type | Field and Description |
|---|---|
protected DataFile |
dataFile |
protected IndexFile |
indexFile |
protected File |
lockFile |
UNLIMITED_IDLE_TIME| Constructor and Description |
|---|
AbstractIndexedDiskCache(String name,
long defaultTimeToLive,
ExpungeStrategy expungeStrategy,
File baseDir) |
AbstractIndexedDiskCache(String name,
long defaultTimeToLive,
long defaultMaxIdleTime,
ExpungeStrategy expungeStrategy,
File baseDir) |
| Modifier and Type | Method and Description |
|---|---|
protected Map<K,BlockMetaData> |
buildIndex() |
void |
close()
Closes the cache.
|
protected abstract V |
dataFromBytes(byte[] data) |
protected abstract byte[] |
dataToBytes(V data) |
protected void |
doDelete(K key,
BlockMetaData metaData)
Performs deletion of the data belonging to the metadata.
|
protected V |
doGet(K key,
BlockMetaData metaData)
Performs retrieval of the data belonging to the metadata.
|
protected V |
doPut(K key,
V data,
long timeToLive,
long maxIdleTime)
Performs storage of the given data and adds new metadata to the map.
|
doPut, put, putcleanUp, delete, delete, expunge, get, getEntriesMetaData, getEntriesMetaDataMap, getExpungeStrategy, getMetaData, getStatistics, put, setEntriesMetaDataMap, setExpungeStrategygetCleanUpLogger, getDefaultMaxIdleTime, getDefaultTtl, getLogger, getName, setDefaultMaxIdleTime, setDefaultTtlclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcleanUp, delete, get, getDefaultMaxIdleTime, getDefaultTtl, getMetaData, getName, getStatistics, putprotected final IndexFile indexFile
protected final DataFile dataFile
protected final File lockFile
public AbstractIndexedDiskCache(String name, long defaultTimeToLive, ExpungeStrategy expungeStrategy, File baseDir) throws IOException
IOExceptionpublic AbstractIndexedDiskCache(String name, long defaultTimeToLive, long defaultMaxIdleTime, ExpungeStrategy expungeStrategy, File baseDir) throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionprotected Map<K,BlockMetaData> buildIndex() throws IOException
IOExceptionprotected void doDelete(K key, BlockMetaData metaData) throws CacheException
AbstractMapBackedCachedoDelete in class AbstractMapBackedCache<K extends Serializable,V extends Serializable,BlockMetaData>CacheExceptionprotected V doGet(K key, BlockMetaData metaData) throws CacheException
AbstractMapBackedCachedoGet in class AbstractMapBackedCache<K extends Serializable,V extends Serializable,BlockMetaData>CacheExceptionprotected V doPut(K key, V data, long timeToLive, long maxIdleTime) throws CacheException
AbstractMapBackedCustomTtlCachedoPut in class AbstractMapBackedCustomTtlCache<K extends Serializable,V extends Serializable,BlockMetaData>CacheExceptionprotected abstract V dataFromBytes(byte[] data) throws CacheException
CacheExceptionprotected abstract byte[] dataToBytes(V data) throws CacheException
CacheExceptionCopyright © 2012. All Rights Reserved.