net.dontdrinkandroot.cache.impl.disk.indexed
Class ByteArrayIndexedDiskCache

java.lang.Object
  extended by net.dontdrinkandroot.cache.impl.AbstractCache<K,V>
      extended by net.dontdrinkandroot.cache.impl.AbstractMapBackedCache<K,V,M>
          extended by net.dontdrinkandroot.cache.impl.AbstractMapBackedCustomTtlCache<K,V,BlockMetaData>
              extended by net.dontdrinkandroot.cache.impl.disk.indexed.AbstractIndexedDiskCache<Serializable,byte[]>
                  extended by net.dontdrinkandroot.cache.impl.disk.indexed.ByteArrayIndexedDiskCache
All Implemented Interfaces:
Cache<Serializable,byte[]>, CustomTtlCache<Serializable,byte[]>

public class ByteArrayIndexedDiskCache
extends AbstractIndexedDiskCache<Serializable,byte[]>

Author:
Philip W. Sorst

Field Summary
 
Fields inherited from class net.dontdrinkandroot.cache.impl.disk.indexed.AbstractIndexedDiskCache
dataFile, indexFile, lockFile
 
Fields inherited from interface net.dontdrinkandroot.cache.Cache
UNLIMITED_IDLE_TIME
 
Constructor Summary
ByteArrayIndexedDiskCache(String name, long defaultTimeToLive, ExpungeStrategy expungeStrategy, File baseDir)
           
ByteArrayIndexedDiskCache(String name, long defaultTimeToLive, long defaultMaxIdleTime, ExpungeStrategy expungeStrategy, File baseDir)
           
 
Method Summary
 boolean assertAllocatedConsistency()
           
 byte[] dataFromBytes(byte[] data)
           
 byte[] dataToBytes(byte[] data)
           
 int getDataFileNumAllocatedBlocks()
           
 int getMetaFileNumAllocatedBlocks()
           
 
Methods inherited from class net.dontdrinkandroot.cache.impl.disk.indexed.AbstractIndexedDiskCache
buildIndex, close, doDelete, doGet, doPut
 
Methods inherited from class net.dontdrinkandroot.cache.impl.AbstractMapBackedCustomTtlCache
doPut, put, put, putWithErrors, putWithErrors
 
Methods inherited from class net.dontdrinkandroot.cache.impl.AbstractMapBackedCache
cleanUp, delete, delete, expunge, get, getEntriesMetaData, getEntriesMetaDataMap, getExpungeStrategy, getMetaData, getStatistics, getWithErrors, put, putWithErrors, setEntriesMetaDataMap, setExpungeStrategy
 
Methods inherited from class net.dontdrinkandroot.cache.impl.AbstractCache
getCleanUpLogger, getDefaultMaxIdleTime, getDefaultTtl, getLogger, getName, setDefaultMaxIdleTime, setDefaultTtl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.dontdrinkandroot.cache.Cache
cleanUp, delete, get, getDefaultMaxIdleTime, getDefaultTtl, getMetaData, getName, getStatistics, getWithErrors, put, putWithErrors
 

Constructor Detail

ByteArrayIndexedDiskCache

public ByteArrayIndexedDiskCache(String name,
                                 long defaultTimeToLive,
                                 ExpungeStrategy expungeStrategy,
                                 File baseDir)
                          throws IOException
Throws:
IOException

ByteArrayIndexedDiskCache

public ByteArrayIndexedDiskCache(String name,
                                 long defaultTimeToLive,
                                 long defaultMaxIdleTime,
                                 ExpungeStrategy expungeStrategy,
                                 File baseDir)
                          throws IOException
Throws:
IOException
Method Detail

dataToBytes

public byte[] dataToBytes(byte[] data)
                   throws CacheException
Specified by:
dataToBytes in class AbstractIndexedDiskCache<Serializable,byte[]>
Throws:
CacheException

dataFromBytes

public byte[] dataFromBytes(byte[] data)
                     throws CacheException
Specified by:
dataFromBytes in class AbstractIndexedDiskCache<Serializable,byte[]>
Throws:
CacheException

getMetaFileNumAllocatedBlocks

public int getMetaFileNumAllocatedBlocks()

getDataFileNumAllocatedBlocks

public int getDataFileNumAllocatedBlocks()

assertAllocatedConsistency

public boolean assertAllocatedConsistency()


Copyright © 2013 dontdrinkandroot. All Rights Reserved.