Package org.h2.mvstore
Class OffHeapStore
- java.lang.Object
-
- org.h2.mvstore.FileStore
-
- org.h2.mvstore.OffHeapStore
-
public class OffHeapStore extends FileStore
A storage mechanism that "persists" data in the off-heap area of the main memory.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.TreeMap<java.lang.Long,java.nio.ByteBuffer>memory-
Fields inherited from class org.h2.mvstore.FileStore
fileSize, freeSpace, readBytes, readCount, writeBytes, writeCount
-
-
Constructor Summary
Constructors Constructor Description OffHeapStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close this store.voidfree(long pos, int length)Mark the space as free.intgetDefaultRetentionTime()Get the default retention time for this store in milliseconds.voidopen(java.lang.String fileName, boolean readOnly, char[] encryptionKey)Try to open the file.java.nio.ByteBufferreadFully(long pos, int len)Read from the file.voidsync()Flush all changes.java.lang.StringtoString()voidtruncate(long size)Truncate the file.voidwriteFully(long pos, java.nio.ByteBuffer src)Write to the file.private voidwriteNewEntry(long pos, java.nio.ByteBuffer src)-
Methods inherited from class org.h2.mvstore.FileStore
allocate, clear, getAfterLastBlock, getEncryptedFile, getFile, getFileLengthInUse, getFileName, getFillRate, getFirstFree, getMovePriority, getProjectedFillRate, getReadBytes, getReadCount, getWriteBytes, getWriteCount, isFragmented, isReadOnly, markUsed, predictAllocation, size
-
-
-
-
Method Detail
-
open
public void open(java.lang.String fileName, boolean readOnly, char[] encryptionKey)Description copied from class:FileStoreTry to open the file.
-
readFully
public java.nio.ByteBuffer readFully(long pos, int len)Description copied from class:FileStoreRead from the file.
-
free
public void free(long pos, int length)Description copied from class:FileStoreMark the space as free.
-
writeFully
public void writeFully(long pos, java.nio.ByteBuffer src)Description copied from class:FileStoreWrite to the file.- Overrides:
writeFullyin classFileStore- Parameters:
pos- the write positionsrc- the source buffer
-
writeNewEntry
private void writeNewEntry(long pos, java.nio.ByteBuffer src)
-
truncate
public void truncate(long size)
Description copied from class:FileStoreTruncate the file.
-
close
public void close()
Description copied from class:FileStoreClose this store.
-
sync
public void sync()
Description copied from class:FileStoreFlush all changes.
-
getDefaultRetentionTime
public int getDefaultRetentionTime()
Description copied from class:FileStoreGet the default retention time for this store in milliseconds.- Overrides:
getDefaultRetentionTimein classFileStore- Returns:
- the retention time
-
-