org.h2.mvstore
Class OffHeapStore

java.lang.Object
  extended by org.h2.mvstore.FileStore
      extended by 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 inherited from class org.h2.mvstore.FileStore
encryptedFile, file, fileLock, fileName, fileSize, freeSpace, readBytes, readCount, readOnly, writeBytes, writeCount
 
Constructor Summary
OffHeapStore()
           
 
Method Summary
 void close()
          Close this store.
 void free(long pos, int length)
          Mark the space as free.
 int getDefaultRetentionTime()
          Get the default retention time for this store in milliseconds.
 void open(java.lang.String fileName, boolean readOnly, char[] encryptionKey)
          Try to open the file.
 java.nio.ByteBuffer readFully(long pos, int len)
          Read from the file.
 void sync()
          Flush all changes.
 java.lang.String toString()
           
 void truncate(long size)
          Truncate the file.
 void writeFully(long pos, java.nio.ByteBuffer src)
          Write to the file.
 
Methods inherited from class org.h2.mvstore.FileStore
allocate, clear, getEncryptedFile, getFile, getFillRate, getReadBytes, getReadCount, getWriteBytes, getWriteCount, isReadOnly, markUsed, size
 
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)
Description copied from class: FileStore
Try to open the file.

Overrides:
open in class FileStore
Parameters:
fileName - the file name
readOnly - whether the file should only be opened in read-only mode, even if the file is writable
encryptionKey - the encryption key, or null if encryption is not used

toString

public java.lang.String toString()
Overrides:
toString in class FileStore

readFully

public java.nio.ByteBuffer readFully(long pos,
                                     int len)
Description copied from class: FileStore
Read from the file.

Overrides:
readFully in class FileStore
Parameters:
pos - the write position
len - the number of bytes to read
Returns:
the byte buffer

free

public void free(long pos,
                 int length)
Description copied from class: FileStore
Mark the space as free.

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

writeFully

public void writeFully(long pos,
                       java.nio.ByteBuffer src)
Description copied from class: FileStore
Write to the file.

Overrides:
writeFully in class FileStore
Parameters:
pos - the write position
src - the source buffer

truncate

public void truncate(long size)
Description copied from class: FileStore
Truncate the file.

Overrides:
truncate in class FileStore
Parameters:
size - the new file size

close

public void close()
Description copied from class: FileStore
Close this store.

Overrides:
close in class FileStore

sync

public void sync()
Description copied from class: FileStore
Flush all changes.

Overrides:
sync in class FileStore

getDefaultRetentionTime

public int getDefaultRetentionTime()
Description copied from class: FileStore
Get the default retention time for this store in milliseconds.

Overrides:
getDefaultRetentionTime in class FileStore
Returns:
the retention time