Class BooleanBucketedSort

java.lang.Object
org.elasticsearch.compute.data.sort.BooleanBucketedSort
All Implemented Interfaces:
Closeable, AutoCloseable, org.elasticsearch.core.Releasable

public class BooleanBucketedSort extends Object implements org.elasticsearch.core.Releasable
Aggregates the top N boolean values per bucket. This class collects by just keeping the count of true and false values.
  • Constructor Details

    • BooleanBucketedSort

      public BooleanBucketedSort(BigArrays bigArrays, SortOrder order, int bucketSize)
  • Method Details

    • collect

      public void collect(boolean value, int bucket)
      Collects a value into a bucket.

      It may or may not be inserted in the heap, depending on if it is better than the current root.

    • getOrder

      public SortOrder getOrder()
      The order of the sort.
    • getBucketSize

      public int getBucketSize()
      The number of values to store per bucket.
    • merge

      public void merge(int groupId, BooleanBucketedSort other, int otherGroupId)
      Merge the values from other's otherGroupId into groupId.
    • toBlock

      public Block toBlock(BlockFactory blockFactory, IntVector selected)
      Creates a block with the values from the selected groups.
    • close

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