net.dontdrinkandroot.cache.impl.disk.indexed

## Class SerializableIndexedDiskCache

- java.lang.Object
- - net.dontdrinkandroot.cache.impl.AbstractCache<K,V>
  - - net.dontdrinkandroot.cache.impl.AbstractMapBackedCache<K,V,M>
    - - net.dontdrinkandroot.cache.impl.AbstractMapBackedCustomTtlCache<K,V,BlockMetaData>
      - - net.dontdrinkandroot.cache.impl.disk.indexed.AbstractIndexedDiskCache<Serializable,Serializable>
        - - net.dontdrinkandroot.cache.impl.disk.indexed.SerializableIndexedDiskCache

All Implemented Interfaces:
  Cache<Serializable,Serializable>, CustomTtlCache<Serializable,Serializable>

Direct Known Subclasses:
  BufferedSerializableIndexedDiskCache

    public class SerializableIndexedDiskCache
    extends AbstractIndexedDiskCache<Serializable,Serializable>

Author:
  Philip W. Sorst <philip@sorst.net>

### Field Summary

### Fields inherited from class net.dontdrinkandroot.cache.impl.disk.indexed.AbstractIndexedDiskCache

`dataFile, dataFileLock, indexFile, indexFileLock, lockFile, queueSizeWarningLimit`

### Fields inherited from interface net.dontdrinkandroot.cache.Cache

`UNLIMITED_IDLE_TIME`

### Constructor Summary

Constructors
Constructor and Description
`SerializableIndexedDiskCache(String name, long defaultTimeToLive, int maxSize, int recycleSize, File baseDir)`
`SerializableIndexedDiskCache(String name, long defaultTimeToLive, long defaultMaxIdleTime, int maxSize, int recycleSize, File baseDir)`

### Method Summary

Methods
`<T extends Serializable> T` `dataFromBytes(byte[] dataBytes)`
`<T extends Serializable> byte[]` `dataToBytes(T data)`
`int` `getDataFileNumAllocatedBlocks()`
`int` `getIndexFileNumAllocatedBlocks()`

### Methods inherited from class net.dontdrinkandroot.cache.impl.disk.indexed.AbstractIndexedDiskCache

`buildIndex, close, doDelete, doGet, doPut, flush, getWriteQueueLength, isWriterThreadAlive, setQueueSizeWarningLimit`

### 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, expunge, get, getCleanUpInterval, getComparator, getEntriesMetaData, getEntry, getMaxSize, getMetaData, getRecycleSize, getStatistics, getWithErrors, put, putEntry, putWithErrors, setCleanUpInterval, setMaxSize, setRecycleSize, triggerExpunge`

### 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, expunge, get, getDefaultMaxIdleTime, getDefaultTtl, getMetaData, getName, getStatistics, getWithErrors, put, putWithErrors, setDefaultTtl`

### Constructor Detail

#### SerializableIndexedDiskCache

    public SerializableIndexedDiskCache(String name,
                                long defaultTimeToLive,
                                int maxSize,
                                int recycleSize,
                                File baseDir)
                                 throws IOException

Throws:
  `IOException`

#### SerializableIndexedDiskCache

    public SerializableIndexedDiskCache(String name,
                                long defaultTimeToLive,
                                long defaultMaxIdleTime,
                                int maxSize,
                                int recycleSize,
                                File baseDir)
                                 throws IOException

Throws:
  `IOException`

### Method Detail

#### dataToBytes

    public <T extends Serializable> byte[] dataToBytes(T data)
                       throws CacheException

Specified by:
  `dataToBytes` in class `AbstractIndexedDiskCache<Serializable,Serializable>`
Throws:
  `CacheException`

#### dataFromBytes

    public <T extends Serializable> T dataFromBytes(byte[] dataBytes)
                                         throws CacheException

Specified by:
  `dataFromBytes` in class `AbstractIndexedDiskCache<Serializable,Serializable>`
Throws:
  `CacheException`

#### getIndexFileNumAllocatedBlocks

    public int getIndexFileNumAllocatedBlocks()

#### getDataFileNumAllocatedBlocks

    public int getDataFileNumAllocatedBlocks()