net.dontdrinkandroot.cache.impl.disk.indexed

## Class LruBufferedSerializableIndexedDiskCache

- 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
          - - net.dontdrinkandroot.cache.impl.disk.indexed.BufferedSerializableIndexedDiskCache
            - - net.dontdrinkandroot.cache.impl.disk.indexed.LruBufferedSerializableIndexedDiskCache

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

    public class LruBufferedSerializableIndexedDiskCache
    extends BufferedSerializableIndexedDiskCache
    implements BufferedRecyclingCache<Serializable,Serializable>

A `BufferedSerializableIndexedDiskCache` that uses a `LruRecyclingExpungeStrategy` for both disk and buffer.

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

### Field Summary

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

`bufferExpungeStrategy`

### 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

Constructors
Constructor and Description
`LruBufferedSerializableIndexedDiskCache(String name, long defaultTimeToLive, File baseDir, int size, int recycleSize, int bufferSize, int bufferRecycleSize)`
`LruBufferedSerializableIndexedDiskCache(String name, long defaultTimeToLive, long defaultMaxIdleTime, File baseDir, int size, int recycleSize, int bufferSize, int bufferRecycleSize)`

### Method Summary

Methods
`int` `getBufferMaxSize()`
`int` `getBufferRecycleSize()`
`int` `getMaxSize()`
`int` `getRecycleSize()`
`void` `setBufferMaxSize(int maxSize)`
`void` `setBufferRecycleSize(int bufferRecycleSize)`
`void` `setExpungeStrategy(ExpungeStrategy expungeStrategy)`
`void` `setMaxSize(int maxSize)`
`void` `setRecycleSize(int recycleSize)`

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

`copyData, doDelete, doGet, doPut, getBufferStatistics, isCopyOnRead, isCopyOnWrite, setCopyOnRead, setCopyOnWrite`

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

`dataFromBytes, dataToBytes, getDataFileNumAllocatedBlocks, getIndexFileNumAllocatedBlocks`

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

`buildIndex, close`

### 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`

### 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, setDefaultTtl`

### Constructor Detail

#### LruBufferedSerializableIndexedDiskCache

    public LruBufferedSerializableIndexedDiskCache(String name,
                                           long defaultTimeToLive,
                                           File baseDir,
                                           int size,
                                           int recycleSize,
                                           int bufferSize,
                                           int bufferRecycleSize)
                                            throws IOException

Throws:
  `IOException`

#### LruBufferedSerializableIndexedDiskCache

    public LruBufferedSerializableIndexedDiskCache(String name,
                                           long defaultTimeToLive,
                                           long defaultMaxIdleTime,
                                           File baseDir,
                                           int size,
                                           int recycleSize,
                                           int bufferSize,
                                           int bufferRecycleSize)
                                            throws IOException

Throws:
  `IOException`

### Method Detail

#### setExpungeStrategy

    public void setExpungeStrategy(ExpungeStrategy expungeStrategy)

Overrides:
  `setExpungeStrategy` in class `AbstractMapBackedCache<Serializable,Serializable,BlockMetaData>`

#### getMaxSize

    public int getMaxSize()

Specified by:
  `getMaxSize` in interface `RecyclingCache<Serializable,Serializable>`

#### setMaxSize

    public void setMaxSize(int maxSize)

Specified by:
  `setMaxSize` in interface `RecyclingCache<Serializable,Serializable>`

#### getRecycleSize

    public int getRecycleSize()

Specified by:
  `getRecycleSize` in interface `RecyclingCache<Serializable,Serializable>`

#### setRecycleSize

    public void setRecycleSize(int recycleSize)

Specified by:
  `setRecycleSize` in interface `RecyclingCache<Serializable,Serializable>`

#### getBufferMaxSize

    public int getBufferMaxSize()

Specified by:
  `getBufferMaxSize` in interface `BufferedRecyclingCache<Serializable,Serializable>`

#### setBufferMaxSize

    public void setBufferMaxSize(int maxSize)

Specified by:
  `setBufferMaxSize` in interface `BufferedRecyclingCache<Serializable,Serializable>`

#### getBufferRecycleSize

    public int getBufferRecycleSize()

Specified by:
  `getBufferRecycleSize` in interface `BufferedRecyclingCache<Serializable,Serializable>`

#### setBufferRecycleSize

    public void setBufferRecycleSize(int bufferRecycleSize)

Specified by:
  `setBufferRecycleSize` in interface `BufferedRecyclingCache<Serializable,Serializable>`