Package org.h2.mvstore

# Class OffHeapStore

java.lang.Object
org.h2.mvstore.FileStore<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
Description
`OffHeapStore()`

## Method Summary

Modifier and Type
Method
Description
`void`
`backup(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(String fileName, boolean readOnly)`
`void`
`open(String fileName, boolean readOnly, char[] encryptionKey)`
`ByteBuffer`
`readFully(SFChunk chunk, long pos, int len)`
Read data from the store.
`String`
`toString()`
`void`
`truncate(long size)`
`void`
`writeFully(SFChunk chunk, long pos, 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 Details

### OffHeapStore

public OffHeapStore()

## Method Details

### open

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

Specified by:
  `open` in class `FileStore<SFChunk>`

### open

public OffHeapStore open(String fileName, boolean readOnly)

Specified by:
  `open` in class `FileStore<SFChunk>`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### readFully

public ByteBuffer readFully(SFChunk chunk, long pos, int len)
Description copied from class: `FileStore`
Read data from the store.

Specified by:
  `readFully` in class `FileStore<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(SFChunk chunk, long pos, ByteBuffer src)
Description copied from class: `FileStore`
Write to the file.

Specified by:
  `writeFully` in class `FileStore<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<SFChunk>`
Returns:
  the retention time

### backup

public void backup(ZipOutputStream out)

Specified by:
  `backup` in class `FileStore<SFChunk>`