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 interfaceLongKeyedBucketOrds.BucketOrdsEnumAn iterator for buckets inside a particularowningBucketOrd.static classLongKeyedBucketOrds.FromManyImplementation that works properly when collecting from many buckets.static classLongKeyedBucketOrds.FromSingleImplementation that only works if it is collecting from a single bucket. -
Method Summary
Modifier and Type Method Description abstract longadd(long owningBucketOrd, long value)Add theowningBucketOrd, valuepair.abstract longbucketsInOrd(long owningBucketOrd)Count the buckets inowningBucketOrd.static LongKeyedBucketOrdsbuild(BigArrays bigArrays, CardinalityUpperBound cardinality)Build aLongKeyedBucketOrds.abstract longfind(long owningBucketOrd, long value)Find theowningBucketOrd, valuepair.abstract longget(long ordinal)Returns the value currently associated with the bucket ordinalabstract longmaxOwningBucketOrd()The maximum possible usedowningBucketOrd.abstract LongKeyedBucketOrds.BucketOrdsEnumordsEnum(long owningBucketOrd)Build an iterator for buckets insideowningBucketOrdin order of increasing ord.abstract longsize()The number of collected buckets.
-
Method Details
-
build
Build aLongKeyedBucketOrds. -
add
public abstract long add(long owningBucketOrd, long value)Add theowningBucketOrd, valuepair. Return the ord for their bucket if they have yet to be added, or-1-ordif they were already present. -
bucketsInOrd
public abstract long bucketsInOrd(long owningBucketOrd)Count the buckets inowningBucketOrd.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 theowningBucketOrd, valuepair. Return the ord for their bucket if they have been added or-1if 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 usedowningBucketOrd. -
ordsEnum
Build an iterator for buckets insideowningBucketOrdin 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.
-