Module org.elasticsearch.compute
Interface TopNEncoder
- All Known Implementing Classes:
SortableTopNEncoder
public interface TopNEncoder
Encodes values for
TopNOperator. Some encoders encode values so sorting
the bytes will sort the values. This is called "sortable" and you can always
go from any TopNEncoder to a "sortable" version of it with toSortable().
If you don't need the bytes to be sortable you can get an "unsortable" encoder
with toUnsortable().-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.elasticsearch.compute.operator.topn.DefaultSortableTopNEncoderAn encoder that encodes values such that sorting the bytes sorts the values.static final org.elasticsearch.compute.operator.topn.DefaultUnsortableTopNEncoderAn encoder that encodes values as compactly as possible without making the encoded bytes sortable.static final org.elasticsearch.compute.operator.topn.FixedLengthTopNEncoderAn encoder for IP addresses.static final org.elasticsearch.compute.operator.topn.UnsupportedTypesTopNEncoderPlaceholder encoder for unsupported data types.static final org.elasticsearch.compute.operator.topn.UTF8TopNEncoderAn encoder for UTF-8 text.static final org.elasticsearch.compute.operator.topn.VersionTopNEncoderAn encoder for semver versions. -
Method Summary
Modifier and TypeMethodDescriptionbooleandecodeBoolean(org.apache.lucene.util.BytesRef bytes) org.apache.lucene.util.BytesRefdecodeBytesRef(org.apache.lucene.util.BytesRef bytes, org.apache.lucene.util.BytesRef scratch) doubledecodeDouble(org.apache.lucene.util.BytesRef bytes) floatdecodeFloat(org.apache.lucene.util.BytesRef bytes) intdecodeInt(org.apache.lucene.util.BytesRef bytes) longdecodeLong(org.apache.lucene.util.BytesRef bytes) voidencodeBoolean(boolean value, BreakingBytesRefBuilder bytesRefBuilder) intencodeBytesRef(org.apache.lucene.util.BytesRef value, BreakingBytesRefBuilder bytesRefBuilder) voidencodeDouble(double value, BreakingBytesRefBuilder bytesRefBuilder) voidencodeFloat(float value, BreakingBytesRefBuilder bytesRefBuilder) voidencodeInt(int value, BreakingBytesRefBuilder bytesRefBuilder) voidencodeLong(long value, BreakingBytesRefBuilder bytesRefBuilder) Get a version of this encoder that encodes values such that sorting the encoded bytes sorts by the values.Get a version of this encoder that encodes values as fast as possible without making the encoded bytes sortable.
-
Field Details
-
DEFAULT_SORTABLE
static final org.elasticsearch.compute.operator.topn.DefaultSortableTopNEncoder DEFAULT_SORTABLEAn encoder that encodes values such that sorting the bytes sorts the values. -
DEFAULT_UNSORTABLE
static final org.elasticsearch.compute.operator.topn.DefaultUnsortableTopNEncoder DEFAULT_UNSORTABLEAn encoder that encodes values as compactly as possible without making the encoded bytes sortable. -
IP
static final org.elasticsearch.compute.operator.topn.FixedLengthTopNEncoder IPAn encoder for IP addresses. -
UTF8
static final org.elasticsearch.compute.operator.topn.UTF8TopNEncoder UTF8An encoder for UTF-8 text. -
VERSION
static final org.elasticsearch.compute.operator.topn.VersionTopNEncoder VERSIONAn encoder for semver versions. -
UNSUPPORTED
static final org.elasticsearch.compute.operator.topn.UnsupportedTypesTopNEncoder UNSUPPORTEDPlaceholder encoder for unsupported data types.
-
-
Method Details
-
encodeLong
-
decodeLong
long decodeLong(org.apache.lucene.util.BytesRef bytes) -
encodeInt
-
decodeInt
int decodeInt(org.apache.lucene.util.BytesRef bytes) -
encodeFloat
-
decodeFloat
float decodeFloat(org.apache.lucene.util.BytesRef bytes) -
encodeDouble
-
decodeDouble
double decodeDouble(org.apache.lucene.util.BytesRef bytes) -
encodeBoolean
-
decodeBoolean
boolean decodeBoolean(org.apache.lucene.util.BytesRef bytes) -
encodeBytesRef
-
decodeBytesRef
org.apache.lucene.util.BytesRef decodeBytesRef(org.apache.lucene.util.BytesRef bytes, org.apache.lucene.util.BytesRef scratch) -
toSortable
TopNEncoder toSortable()Get a version of this encoder that encodes values such that sorting the encoded bytes sorts by the values. -
toUnsortable
TopNEncoder toUnsortable()Get a version of this encoder that encodes values as fast as possible without making the encoded bytes sortable.
-