Class AbstractBlockPackedWriter

java.lang.Object
org.apache.lucene.util.packed.AbstractBlockPackedWriter
Direct Known Subclasses:
BlockPackedWriter, MonotonicBlockPackedWriter

abstract class AbstractBlockPackedWriter extends Object
  • Field Details

    • MIN_BLOCK_SIZE

      static final int MIN_BLOCK_SIZE
      See Also:
    • MAX_BLOCK_SIZE

      static final int MAX_BLOCK_SIZE
      See Also:
    • MIN_VALUE_EQUALS_0

      static final int MIN_VALUE_EQUALS_0
      See Also:
    • BPV_SHIFT

      static final int BPV_SHIFT
      See Also:
    • out

      protected DataOutput out
    • values

      protected final long[] values
    • blocks

      protected byte[] blocks
    • off

      protected int off
    • ord

      protected long ord
    • finished

      protected boolean finished
  • Constructor Details

    • AbstractBlockPackedWriter

      protected AbstractBlockPackedWriter(DataOutput out, int blockSize)
      Sole constructor.
      Parameters:
      blockSize - the number of values of a single block, must be a multiple of 64
  • Method Details

    • writeVLong

      static void writeVLong(DataOutput out, long i) throws IOException
      Throws:
      IOException
    • reset

      public void reset(DataOutput out)
      Reset this writer to wrap out. The block size remains unchanged.
    • checkNotFinished

      private void checkNotFinished()
    • add

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

      void addBlockOfZeros() throws IOException
      Throws:
      IOException
    • finish

      public void finish() throws IOException
      Flush all buffered data to disk. This instance is not usable anymore after this method has been called until reset(DataOutput) has been called.
      Throws:
      IOException
    • ord

      public long ord()
      Return the number of values which have been added.
    • flush

      protected abstract void flush() throws IOException
      Throws:
      IOException
    • writeValues

      protected final void writeValues(int bitsRequired) throws IOException
      Throws:
      IOException