Class OffHeapFSTStore

  • All Implemented Interfaces:
    Accountable, FSTReader, FSTStore

    public final class OffHeapFSTStore
    extends Object
    implements FSTStore
    Provides off heap storage of finite state machine (FST), using underlying index input instead of byte store on heap
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Constructor Detail

      • OffHeapFSTStore

        public OffHeapFSTStore()
    • Method Detail

      • init

        public FSTStore init​(DataInput in,
                             long numBytes)
                      throws IOException
        Description copied from interface: FSTStore
        Initialize the FSTStore
        Specified by:
        init in interface FSTStore
        Parameters:
        in - the DataInput to read from
        numBytes - the number of bytes to read
        Returns:
        this FSTStore
        Throws:
        IOException - if exception occurred during reading the DataInput
      • ramBytesUsed

        public long ramBytesUsed()
        Description copied from interface: Accountable
        Return the memory usage of this object in bytes. Negative values are illegal.
        Specified by:
        ramBytesUsed in interface Accountable
      • size

        public long size()
      • writeTo

        public void writeTo​(DataOutput out)
                     throws IOException
        Description copied from interface: FSTReader
        Write this FST to another DataOutput
        Specified by:
        writeTo in interface FSTReader
        Parameters:
        out - the DataOutput
        Throws:
        IOException - if exception occurred during writing