Class IpBucketedSort

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

public class IpBucketedSort extends Object implements org.elasticsearch.core.Releasable
Aggregates the top N IP values per bucket. See BucketedSort for more information.

This is substantially different from BytesRefBucketedSort because this takes advantage of IPs having a fixed length and allocates a dense storage for them.

  • Constructor Details

    • IpBucketedSort

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

    • collect

      public void collect(org.apache.lucene.util.BytesRef 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.

    • merge

      public void merge(int groupId, IpBucketedSort 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