Class AbstractBlockPackedWriter

java.lang.Object
org.apache.cassandra.index.sai.disk.v1.bitpack.AbstractBlockPackedWriter
Direct Known Subclasses:
BlockPackedWriter, MonotonicBlockPackedWriter

public abstract class AbstractBlockPackedWriter extends Object
Modified copy of org.apache.lucene.util.packed.AbstractBlockPackedWriter to use DirectWriter for optimised reads that doesn't require seeking through the whole file to open a thread-exclusive reader.
  • Field Details

    • indexOutput

      protected final org.apache.lucene.store.IndexOutput indexOutput
    • blockValues

      protected final long[] blockValues
    • blockMetaWriter

      protected final ResettableByteBuffersIndexOutput blockMetaWriter
    • blockIndex

      protected int blockIndex
    • finished

      protected boolean finished
  • Method Details

    • add

      public void add(long l) throws IOException
      Append a new long.
      Throws:
      IOException
    • finish

      public long finish() throws IOException
      Flush all buffered data to disk. This instance is not usable anymore after this method has been called.
      Returns:
      a file offset to the block metadata
      Throws:
      IOException
    • flushBlock

      protected abstract void flushBlock() throws IOException
      Throws:
      IOException