Top Description Fields Constructors Methods
org.h2.mvstore

public Class OffHeapStore

extends RandomAccessStore
Class Inheritance
Imports
java.nio.ByteBuffer, java.util.HashMap, .Iterator, .Map.Entry, .TreeMap, java.util.zip.ZipOutputStream

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

Field Summary

Modifier and TypeField and Description
private final TreeMap<Long, ByteBuffer>
Inherited from org.h2.mvstore.RandomAccessStore:
freeSpace

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
free(long
the position in bytes
pos
,
int
the number of bytes
length
)

Overrides org.h2.mvstore.RandomAccessStore.free.

Mark the space as free.

public int
getDefaultRetentionTime()

Overrides org.h2.mvstore.FileStore.getDefaultRetentionTime.

Get the default retention time for this store in milliseconds.

private void
init()

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

Implements abstract org.h2.mvstore.FileStore.open.

public OffHeapStore
open(String fileName, boolean readOnly)

Implements abstract org.h2.mvstore.FileStore.open.

public ByteBuffer
readFully(SFChunk
that owns data to be read
chunk
,
long
the read "position"
pos
,
int
the number of bytes to read
len
)

Implements abstract org.h2.mvstore.FileStore.readFully.

Read data from the store.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
truncate(long size)

Implements abstract org.h2.mvstore.RandomAccessStore.truncate.

public void
writeFully(SFChunk
to write
chunk
,
long
the write position
pos
,
ByteBuffer
the source buffer
src
)

Implements abstract org.h2.mvstore.FileStore.writeFully.

Write to the file.

private void
writeNewEntry(long pos, ByteBuffer src)

Inherited from org.h2.mvstore.RandomAccessStore:
adjustStoreToLastChunkallocateChunkSpaceclearcompactMoveChunkscompactStorecreateChunkcreateChunkcreateChunkdoHousekeepingfreeChunkSpacegetAfterLastBlock_getFileLengthInUsegetFillRategetFirstFreegetMovePrioritygetRewriteCandidatesinitializeStoreHeaderisSpaceReusedmarkUsedreadStoreHeadersetReuseSpaceshouldSaveNowshrinkStoreIfPossiblevalidateFileLengthwriteChunkwriteCleanShutdownMark

Field Detail

memoryback to summary
private final TreeMap<Long, ByteBuffer> memory

Constructor Detail

OffHeapStoreback to summary
public OffHeapStore()

Method Detail

backupback to summary
public void backup(ZipOutputStream out)

Implements abstract org.h2.mvstore.FileStore.backup.

Annotations
@Override
freeback to summary
public void free(long pos, int length)

Overrides org.h2.mvstore.RandomAccessStore.free.

Doc from org.h2.mvstore.RandomAccessStore.free.

Mark the space as free.

Parameters
pos:long

the position in bytes

length:int

the number of bytes

Annotations
@Override
getDefaultRetentionTimeback to summary
public int getDefaultRetentionTime()

Overrides org.h2.mvstore.FileStore.getDefaultRetentionTime.

Doc from org.h2.mvstore.FileStore.getDefaultRetentionTime.

Get the default retention time for this store in milliseconds.

Returns:int

the retention time

Annotations
@Override
initback to summary
private void init()
openback to summary
public void open(String fileName, boolean readOnly, char[] encryptionKey)

Implements abstract org.h2.mvstore.FileStore.open.

Annotations
@Override
openback to summary
public OffHeapStore open(String fileName, boolean readOnly)

Implements abstract org.h2.mvstore.FileStore.open.

Annotations
@Override
readFullyback to summary
public ByteBuffer readFully(SFChunk chunk, long pos, int len)

Implements abstract org.h2.mvstore.FileStore.readFully.

Doc from org.h2.mvstore.FileStore.readFully.

Read data from the store.

Parameters
chunk:SFChunk

that owns data to be read

pos:long

the read "position"

len:int

the number of bytes to read

Returns:ByteBuffer

the byte buffer with data requested

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
truncateback to summary
public void truncate(long size)

Implements abstract org.h2.mvstore.RandomAccessStore.truncate.

Annotations
@Override
writeFullyback to summary
public void writeFully(SFChunk chunk, long pos, ByteBuffer src)

Implements abstract org.h2.mvstore.FileStore.writeFully.

Doc from org.h2.mvstore.FileStore.writeFully.

Write to the file.

Parameters
chunk:SFChunk

to write

pos:long

the write position

src:ByteBuffer

the source buffer

Annotations
@Override
writeNewEntryback to summary
private void writeNewEntry(long pos, ByteBuffer src)