Class OnHeapFSTStore

java.lang.Object
org.apache.lucene.util.fst.OnHeapFSTStore
All Implemented Interfaces:
Accountable, FSTReader, FSTStore

public final class OnHeapFSTStore extends Object implements FSTStore
Provides storage of finite state machine (FST), using byte array or byte store allocated on heap.
  • Field Details

    • BASE_RAM_BYTES_USED

      private static final long BASE_RAM_BYTES_USED
    • bytes

      private BytesStore bytes
      A BytesStore, used during building, or during reading when the FST is very large (more than 1 GB). If the FST is less than 1 GB then bytesArray is set instead.
    • bytesArray

      private byte[] bytesArray
      Used at read time when the FST fits into a single byte[].
    • maxBlockBits

      private final int maxBlockBits
  • Constructor Details

    • OnHeapFSTStore

      public OnHeapFSTStore(int maxBlockBits)
  • Method Details

    • 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
    • getReverseBytesReader

      public FST.BytesReader getReverseBytesReader()
      Description copied from interface: FSTReader
      Get the reverse BytesReader for this FST
      Specified by:
      getReverseBytesReader in interface FSTReader
      Returns:
      the reverse BytesReader
    • 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