java.lang.Object
org.elasticsearch.compute.operator.GroupKeyEncoder
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.lucene.util.Accountable,org.elasticsearch.core.Releasable
public class GroupKeyEncoder
extends Object
implements org.apache.lucene.util.Accountable, org.elasticsearch.core.Releasable
Encodes the values at a given position across multiple blocks into a single
BytesRef composite key.
Multivalued positions are serialized with list semantics: the value count is written first, then each value
in block iteration order. This means [1, 2] and [2, 1] produce different keys.
Null positions are encoded as a value count of zero.-
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
ConstructorsConstructorDescriptionGroupKeyEncoder(int[] groupChannels, List<ElementType> elementTypes, BreakingBytesRefBuilder scratch) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.apache.lucene.util.BytesRefEncode the group key for the given position from the page into aBytesRef.int[]longMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Constructor Details
-
GroupKeyEncoder
public GroupKeyEncoder(int[] groupChannels, List<ElementType> elementTypes, BreakingBytesRefBuilder scratch)
-
-
Method Details
-
encode
Encode the group key for the given position from the page into aBytesRef. The returned reference is only valid until the next call toencode. -
groupChannels
public int[] groupChannels() -
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsedin interfaceorg.apache.lucene.util.Accountable
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-