org.h2.mvstore

## Class OffHeapStore

- java.lang.Object
- - org.h2.mvstore.FileStore<org.h2.mvstore.SFChunk>
  - - org.h2.mvstore.RandomAccessStore
    - - org.h2.mvstore.OffHeapStore

    public class OffHeapStore
    extends RandomAccessStore

A storage mechanism that "persists" data in the off-heap area of the main memory.

### Nested Class Summary

### Nested classes/interfaces inherited from class org.h2.mvstore.FileStore

`FileStore.PageSerializationManager`

### Field Summary

### Fields inherited from class org.h2.mvstore.RandomAccessStore

`freeSpace`

### Fields inherited from class org.h2.mvstore.FileStore

`lastChunk, META_ID_KEY, PIPE_LENGTH, readBytes, readCount, recoveryMode, saveChunkLock, storeHeader, writeBytes, writeCount`

### Constructor Summary

Constructors
Constructor and Description
`OffHeapStore()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `backup(java.util.zip.ZipOutputStream out)`
`void` `free(long pos, int length)` Mark the space as free.
`int` `getDefaultRetentionTime()` Get the default retention time for this store in milliseconds.
`OffHeapStore` `open(java.lang.String fileName, boolean readOnly)`
`void` `open(java.lang.String fileName, boolean readOnly, char[] encryptionKey)`
`java.nio.ByteBuffer` `readFully(org.h2.mvstore.SFChunk chunk, long pos, int len)` Read data from the store.
`java.lang.String` `toString()`
`void` `truncate(long size)`
`void` `writeFully(org.h2.mvstore.SFChunk chunk, long pos, java.nio.ByteBuffer src)` Write to the file.

### Methods inherited from class org.h2.mvstore.RandomAccessStore

`adjustStoreToLastChunk, allocateChunkSpace, clear, compactMoveChunks, compactStore, createChunk, createChunk, createChunk, doHousekeeping, freeChunkSpace, getAfterLastBlock_, getFillRate, getMovePriority, getRewriteCandidates, initializeStoreHeader, isSpaceReused, markUsed, readStoreHeader, setReuseSpace, shouldSaveNow, shrinkStoreIfPossible, validateFileLength, writeChunk, writeCleanShutdownMark`

### Methods inherited from class org.h2.mvstore.FileStore

`accountForRemovedPage, bind, close, compact, compactStore, deregisterMapRoot, discoverChunk, dropUnusedChunks, executeFileStoreOperation, findLastChunkWithCompleteValidChunkSet, getAutoCommitDelay, getAutoCompactFillRate, getCacheHitRatio, getCacheSize, getCacheSizeUsed, getChunks, getChunksFillRate, getChunksFromLayoutMap, getCreationTime, getFileName, getLayoutMap, getMaxPageSize, getMetaMapId, getMvStore, getReadBytes, getReadCount, getRetentionTime, getRootPos, getStoreHeader, getTocCacheHitRatio, getWriteBuffer, getWriteCount, hasChangesSince, hasPersistentData, init, initializeCommonHeaderAttributes, isIdle, isKnownVersion, isReadOnly, isRegularMap, lastChunkVersion, populateInfo, processCommonHeaderAttributes, readChunkFooter, readChunkHeaderAndFooter, readChunkHeaderOptionally, readChunkHeaderOptionally, readFully, registerDeadChunk, releaseWriteBuffer, rewriteChunks, rollbackTo, saveChunkMetadataChanges, setAutoCommitDelay, setCacheSize, setLastChunk, setRetentionTime, setSize, size, start, stop, store, sync, writeCleanShutdown`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### OffHeapStore

    public OffHeapStore()

### Method Detail

#### open

    public void open(java.lang.String fileName,
                     boolean readOnly,
                     char[] encryptionKey)

Specified by:
  `open` in class `FileStore<org.h2.mvstore.SFChunk>`

#### open

    public OffHeapStore open(java.lang.String fileName,
                             boolean readOnly)

Specified by:
  `open` in class `FileStore<org.h2.mvstore.SFChunk>`

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### readFully

    public java.nio.ByteBuffer readFully(org.h2.mvstore.SFChunk chunk,
                                         long pos,
                                         int len)

Description copied from class: `FileStore`
Read data from the store.

Specified by:
  `readFully` in class `FileStore<org.h2.mvstore.SFChunk>`
Parameters:
  `chunk` - that owns data to be read
  `pos` - the read "position"
  `len` - the number of bytes to read
Returns:
  the byte buffer with data requested

#### free

    public void free(long pos,
                     int length)

Description copied from class: `RandomAccessStore`
Mark the space as free.

Overrides:
  `free` in class `RandomAccessStore`
Parameters:
  `pos` - the position in bytes
  `length` - the number of bytes

#### writeFully

    public void writeFully(org.h2.mvstore.SFChunk chunk,
                           long pos,
                           java.nio.ByteBuffer src)

Description copied from class: `FileStore`
Write to the file.

Specified by:
  `writeFully` in class `FileStore<org.h2.mvstore.SFChunk>`
Parameters:
  `chunk` - to write
  `pos` - the write position
  `src` - the source buffer

#### truncate

    public void truncate(long size)

Specified by:
  `truncate` in class `RandomAccessStore`

#### getDefaultRetentionTime

    public int getDefaultRetentionTime()

Description copied from class: `FileStore`
Get the default retention time for this store in milliseconds.

Overrides:
  `getDefaultRetentionTime` in class `FileStore<org.h2.mvstore.SFChunk>`
Returns:
  the retention time

#### backup

    public void backup(java.util.zip.ZipOutputStream out)

Specified by:
  `backup` in class `FileStore<org.h2.mvstore.SFChunk>`