java.lang.Object
org.elasticsearch.compute.aggregation.blockhash.AddPage
All Implemented Interfaces:
Closeable, AutoCloseable, org.elasticsearch.core.Releasable
Direct Known Subclasses:
IntLongBlockAdd, LongLongBlockAdd

public class AddPage extends Object implements org.elasticsearch.core.Releasable
Helper for adding a Page worth of Blocks to a BlockHash while flushing the ordinals to the aggregations when we've accumulated emitBatchSize ordinals. See appendOrdSv(int, int) and appendOrdInMv(int, int) for how to add values to it. After adding all values, call emitOrds() to flush the last batch of values to the aggs.
  • Constructor Details

  • Method Details

    • appendOrdSv

      protected final void appendOrdSv(int position, int ord)
      Append a single valued ordinal. This will flush the ordinals to the aggs if we've added emitBatchSize.
    • appendNullSv

      @Deprecated protected final void appendNullSv(int position)
      Deprecated.
      nulls should resolve to some value.
      Append a null valued ordinal. This will flush the ordinals to the aggs if we've added emitBatchSize.
    • appendOrdInMv

      protected final void appendOrdInMv(int position, int ord)
      Append a value inside a multivalued ordinal. If the current position is not started this will begin the position. This will flush the ordinals to the aggs if we've added emitBatchSize.This should be used by like:
      
        appendOrdInMv(position, ord);
        appendOrdInMv(position, ord);
        appendOrdInMv(position, ord);
        finishMv();
       
    • finishMv

      protected final void finishMv()
    • flushRemaining

      protected final void flushRemaining()
      Call when finished to emit all remaining ordinals to the aggs.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.elasticsearch.core.Releasable