All Known Implementing Classes:
DefaultUnsortableTopNEncoder, 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

    Fields
    Modifier and Type
    Field
    Description
    static final org.elasticsearch.compute.operator.topn.DefaultSortableTopNEncoder
    An encoder that encodes values such that sorting the bytes sorts the values.
    An encoder that encodes values as compactly as possible without making the encoded bytes sortable.
    static final org.elasticsearch.compute.operator.topn.FixedLengthTopNEncoder
    An encoder for IP addresses.
    static final org.elasticsearch.compute.operator.topn.UnsupportedTypesTopNEncoder
    Placeholder encoder for unsupported data types.
    static final org.elasticsearch.compute.operator.topn.UTF8TopNEncoder
    An encoder for UTF-8 text.
    static final org.elasticsearch.compute.operator.topn.VersionTopNEncoder
    An encoder for semver versions.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    decodeBoolean(org.apache.lucene.util.BytesRef bytes)
     
    org.apache.lucene.util.BytesRef
    decodeBytesRef(org.apache.lucene.util.BytesRef bytes, org.apache.lucene.util.BytesRef scratch)
     
    double
    decodeDouble(org.apache.lucene.util.BytesRef bytes)
     
    float
    decodeFloat(org.apache.lucene.util.BytesRef bytes)
     
    int
    decodeInt(org.apache.lucene.util.BytesRef bytes)
     
    long
    decodeLong(org.apache.lucene.util.BytesRef bytes)
     
    void
    encodeBoolean(boolean value, BreakingBytesRefBuilder bytesRefBuilder)
     
    int
    encodeBytesRef(org.apache.lucene.util.BytesRef value, BreakingBytesRefBuilder bytesRefBuilder)
     
    void
    encodeDouble(double value, BreakingBytesRefBuilder bytesRefBuilder)
     
    void
    encodeFloat(float value, BreakingBytesRefBuilder bytesRefBuilder)
     
    void
    encodeInt(int value, BreakingBytesRefBuilder bytesRefBuilder)
     
    void
    encodeLong(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_SORTABLE
      An encoder that encodes values such that sorting the bytes sorts the values.
    • DEFAULT_UNSORTABLE

      static final DefaultUnsortableTopNEncoder DEFAULT_UNSORTABLE
      An encoder that encodes values as compactly as possible without making the encoded bytes sortable.
    • IP

      static final org.elasticsearch.compute.operator.topn.FixedLengthTopNEncoder IP
      An encoder for IP addresses.
    • UTF8

      static final org.elasticsearch.compute.operator.topn.UTF8TopNEncoder UTF8
      An encoder for UTF-8 text.
    • VERSION

      static final org.elasticsearch.compute.operator.topn.VersionTopNEncoder VERSION
      An encoder for semver versions.
    • UNSUPPORTED

      static final org.elasticsearch.compute.operator.topn.UnsupportedTypesTopNEncoder UNSUPPORTED
      Placeholder encoder for unsupported data types.
  • Method Details

    • encodeLong

      void encodeLong(long value, BreakingBytesRefBuilder bytesRefBuilder)
    • decodeLong

      long decodeLong(org.apache.lucene.util.BytesRef bytes)
    • encodeInt

      void encodeInt(int value, BreakingBytesRefBuilder bytesRefBuilder)
    • decodeInt

      int decodeInt(org.apache.lucene.util.BytesRef bytes)
    • encodeFloat

      void encodeFloat(float value, BreakingBytesRefBuilder bytesRefBuilder)
    • decodeFloat

      float decodeFloat(org.apache.lucene.util.BytesRef bytes)
    • encodeDouble

      void encodeDouble(double value, BreakingBytesRefBuilder bytesRefBuilder)
    • decodeDouble

      double decodeDouble(org.apache.lucene.util.BytesRef bytes)
    • encodeBoolean

      void encodeBoolean(boolean value, BreakingBytesRefBuilder bytesRefBuilder)
    • decodeBoolean

      boolean decodeBoolean(org.apache.lucene.util.BytesRef bytes)
    • encodeBytesRef

      int encodeBytesRef(org.apache.lucene.util.BytesRef value, BreakingBytesRefBuilder bytesRefBuilder)
    • 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.