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 Details

  • Constructor Details

    • OffHeapStore

      public OffHeapStore()
  • Method Details

    • open

      public void open(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 String toString()
      Overrides:
      toString in class FileStore
    • readFully

      public 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, 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
    • writeNewEntry

      private void writeNewEntry(long pos, ByteBuffer src)
    • 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