Class LongKeyedBucketOrds

java.lang.Object
org.elasticsearch.search.aggregations.bucket.terms.LongKeyedBucketOrds
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable, Releasable
Direct Known Subclasses:
LongKeyedBucketOrds.FromMany, LongKeyedBucketOrds.FromSingle

public abstract class LongKeyedBucketOrds
extends java.lang.Object
implements Releasable
Maps long bucket keys to bucket ordinals.
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static interface  LongKeyedBucketOrds.BucketOrdsEnum
    An iterator for buckets inside a particular owningBucketOrd.
    static class  LongKeyedBucketOrds.FromMany
    Implementation that works properly when collecting from many buckets.
    static class  LongKeyedBucketOrds.FromSingle
    Implementation that only works if it is collecting from a single bucket.
  • Method Summary

    Modifier and Type Method Description
    abstract long add​(long owningBucketOrd, long value)
    Add the owningBucketOrd, value pair.
    abstract long bucketsInOrd​(long owningBucketOrd)
    Count the buckets in owningBucketOrd.
    static LongKeyedBucketOrds build​(BigArrays bigArrays, CardinalityUpperBound cardinality)
    abstract long find​(long owningBucketOrd, long value)
    Find the owningBucketOrd, value pair.
    abstract long get​(long ordinal)
    Returns the value currently associated with the bucket ordinal
    abstract long maxOwningBucketOrd()
    The maximum possible used owningBucketOrd.
    abstract LongKeyedBucketOrds.BucketOrdsEnum ordsEnum​(long owningBucketOrd)
    Build an iterator for buckets inside owningBucketOrd in order of increasing ord.
    abstract long size()
    The number of collected buckets.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.elasticsearch.common.lease.Releasable

    close
  • Method Details

    • build

      public static LongKeyedBucketOrds build​(BigArrays bigArrays, CardinalityUpperBound cardinality)
    • add

      public abstract long add​(long owningBucketOrd, long value)
      Add the owningBucketOrd, value pair. Return the ord for their bucket if they have yet to be added, or -1-ord if they were already present.
    • bucketsInOrd

      public abstract long bucketsInOrd​(long owningBucketOrd)
      Count the buckets in owningBucketOrd.

      Some aggregations expect this to be fast but most wouldn't mind particularly if it weren't.

    • find

      public abstract long find​(long owningBucketOrd, long value)
      Find the owningBucketOrd, value pair. Return the ord for their bucket if they have been added or -1 if they haven't.
    • get

      public abstract long get​(long ordinal)
      Returns the value currently associated with the bucket ordinal
    • size

      public abstract long size()
      The number of collected buckets.
    • maxOwningBucketOrd

      public abstract long maxOwningBucketOrd()
      The maximum possible used owningBucketOrd.
    • ordsEnum

      public abstract LongKeyedBucketOrds.BucketOrdsEnum ordsEnum​(long owningBucketOrd)
      Build an iterator for buckets inside owningBucketOrd in order of increasing ord.

      When this is first returns it is "unpositioned" and you must call LongKeyedBucketOrds.BucketOrdsEnum.next() to move it to the first value.