Class BatchEncoder.DirectEncoder

java.lang.Object
org.elasticsearch.compute.operator.mvdedupe.BatchEncoder
org.elasticsearch.compute.operator.mvdedupe.BatchEncoder.DirectEncoder
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.lucene.util.Accountable, org.elasticsearch.core.Releasable
Direct Known Subclasses:
BatchEncoder.DirectBooleans, BatchEncoder.DirectBytesRefs, BatchEncoder.DirectDoubles, BatchEncoder.DirectInts, BatchEncoder.DirectLongs, BatchEncoder.DirectNulls
Enclosing class:
BatchEncoder

protected abstract static class BatchEncoder.DirectEncoder extends BatchEncoder
  • Field Details

    • BASE_RAM_USAGE

      protected static final long BASE_RAM_USAGE
    • block

      protected final Block block
  • Method Details

    • encodeNextBatch

      public final void encodeNextBatch()
      Description copied from class: BatchEncoder
      Encodes the next batch of entries. This will encode values until the next value doesn't fit into the buffer. Callers should iterate on the values that have been encoded and then call this again for the next batch.

      It's possible for this batch to be empty if there isn't room for the first entry in the buffer. If so, call again to force the buffer to expand and encode that entry.

      Specified by:
      encodeNextBatch in class BatchEncoder
    • positionCount

      public final int positionCount()
      Description copied from class: BatchEncoder
      The number of positions in the current batch.
      Specified by:
      positionCount in class BatchEncoder
    • valueCount

      public final int valueCount(int positionOffset)
      Description copied from class: BatchEncoder
      The number of values at the position with this offset in the batch.
      Specified by:
      valueCount in class BatchEncoder
    • read

      public int read(int index, org.apache.lucene.util.BytesRefBuilder dst)
      Description copied from class: BatchEncoder
      Read the value at the specified index then append to the dst. Values at the first position start at index 0 and advance one per value. So the values at position n start at (0..n-1).sum(valueCount). There is no random-access way to get the first index for a position.
      Specified by:
      read in class BatchEncoder
      Returns:
      the number of bytes has read
    • readValueAtBlockIndex

      protected abstract int readValueAtBlockIndex(int valueIndex, org.apache.lucene.util.BytesRefBuilder dst)
    • ramBytesUsed

      public final long ramBytesUsed()
    • close

      public void close()