Module org.elasticsearch.compute
Class BytesRefBucketedSort
java.lang.Object
org.elasticsearch.compute.data.sort.BytesRefBucketedSort
- All Implemented Interfaces:
Closeable,AutoCloseable,org.elasticsearch.core.Releasable
Aggregates the top N variable length
BytesRef values per bucket.
See BucketedSort for more information.
This is substantially different from IpBucketedSort because
this has to handle variable length byte strings. To do that it allocates
a heap of BreakingBytesRefBuilders.
-
Constructor Summary
ConstructorsConstructorDescriptionBytesRefBucketedSort(CircuitBreaker breaker, String label, BigArrays bigArrays, SortOrder order, int bucketSize) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()voidcollect(org.apache.lucene.util.BytesRef value, int bucket) Collects avalueinto abucket.voidmerge(int bucket, BytesRefBucketedSort other, int otherBucket) Merge the values fromother'sotherGroupIdintogroupId.toBlock(BlockFactory blockFactory, IntVector selected) Creates a block with the values from theselectedgroups.
-
Constructor Details
-
BytesRefBucketedSort
public BytesRefBucketedSort(CircuitBreaker breaker, String label, BigArrays bigArrays, SortOrder order, int bucketSize)
-
-
Method Details
-
collect
public void collect(org.apache.lucene.util.BytesRef value, int bucket) Collects avalueinto abucket.It may or may not be inserted in the heap, depending on if it is better than the current root.
-
merge
Merge the values fromother'sotherGroupIdintogroupId. -
toBlock
Creates a block with the values from theselectedgroups. -
close
public final void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-