Module org.elasticsearch.compute
Class DefaultUnsortableTopNEncoder
java.lang.Object
org.elasticsearch.compute.operator.topn.DefaultUnsortableTopNEncoder
- All Implemented Interfaces:
TopNEncoder
A
TopNEncoder that doesn't encode values so they are sortable but is
capable of encoding any values.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VarHandlestatic final VarHandlestatic final VarHandlestatic final VarHandleFields inherited from interface org.elasticsearch.compute.operator.topn.TopNEncoder
DEFAULT_SORTABLE, DEFAULT_UNSORTABLE, IP, UNSUPPORTED, UTF8, VERSION -
Constructor Summary
Constructors -
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) intdecodeVInt(org.apache.lucene.util.BytesRef bytes) Reads an int stored in variable-length format.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) voidencodeVInt(int value, BreakingBytesRefBuilder bytesRefBuilder) Writes an int in a variable-length format.Get a version of this encoder that encodes values such that sorting the encoded bytes sorts by the values.toString()Get a version of this encoder that encodes values as fast as possible without making the encoded bytes sortable.
-
Field Details
-
LONG
-
INT
-
FLOAT
-
DOUBLE
-
-
Constructor Details
-
DefaultUnsortableTopNEncoder
public DefaultUnsortableTopNEncoder()
-
-
Method Details
-
encodeLong
- Specified by:
encodeLongin interfaceTopNEncoder
-
decodeLong
public long decodeLong(org.apache.lucene.util.BytesRef bytes) - Specified by:
decodeLongin interfaceTopNEncoder
-
encodeVInt
Writes an int in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers will always use all 5 bytes. -
decodeVInt
public int decodeVInt(org.apache.lucene.util.BytesRef bytes) Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers will always use all 5 bytes. -
encodeInt
- Specified by:
encodeIntin interfaceTopNEncoder
-
decodeInt
public int decodeInt(org.apache.lucene.util.BytesRef bytes) - Specified by:
decodeIntin interfaceTopNEncoder
-
encodeFloat
- Specified by:
encodeFloatin interfaceTopNEncoder
-
decodeFloat
public float decodeFloat(org.apache.lucene.util.BytesRef bytes) - Specified by:
decodeFloatin interfaceTopNEncoder
-
encodeDouble
- Specified by:
encodeDoublein interfaceTopNEncoder
-
decodeDouble
public double decodeDouble(org.apache.lucene.util.BytesRef bytes) - Specified by:
decodeDoublein interfaceTopNEncoder
-
encodeBoolean
- Specified by:
encodeBooleanin interfaceTopNEncoder
-
decodeBoolean
public boolean decodeBoolean(org.apache.lucene.util.BytesRef bytes) - Specified by:
decodeBooleanin interfaceTopNEncoder
-
encodeBytesRef
public int encodeBytesRef(org.apache.lucene.util.BytesRef value, BreakingBytesRefBuilder bytesRefBuilder) - Specified by:
encodeBytesRefin interfaceTopNEncoder
-
decodeBytesRef
public org.apache.lucene.util.BytesRef decodeBytesRef(org.apache.lucene.util.BytesRef bytes, org.apache.lucene.util.BytesRef scratch) - Specified by:
decodeBytesRefin interfaceTopNEncoder
-
toSortable
Description copied from interface:TopNEncoderGet a version of this encoder that encodes values such that sorting the encoded bytes sorts by the values.- Specified by:
toSortablein interfaceTopNEncoder
-
toUnsortable
Description copied from interface:TopNEncoderGet a version of this encoder that encodes values as fast as possible without making the encoded bytes sortable.- Specified by:
toUnsortablein interfaceTopNEncoder
-
toString
-