Class InternalOrder.Streams

java.lang.Object
org.elasticsearch.search.aggregations.InternalOrder.Streams
Enclosing class:
InternalOrder

public static class InternalOrder.Streams extends Object
Contains logic for reading/writing BucketOrder from/to streams.
  • Constructor Details

    • Streams

      public Streams()
  • Method Details

    • readOrder

      public static BucketOrder readOrder(StreamInput in) throws IOException
      Read a BucketOrder from a StreamInput.
      Parameters:
      in - stream with order data to read.
      Returns:
      order read from the stream
      Throws:
      IOException - on error reading from the stream.
    • readHistogramOrder

      public static BucketOrder readHistogramOrder(StreamInput in, boolean bwcOrderFlag) throws IOException
      ONLY FOR HISTOGRAM ORDER: Backwards compatibility logic to read a BucketOrder from a StreamInput.
      Parameters:
      in - stream with order data to read.
      bwcOrderFlag - true to check in.readBoolean() in the backwards compat logic before reading the order. false to skip this flag (order always present).
      Returns:
      order read from the stream
      Throws:
      IOException - on error reading from the stream.
    • writeOrder

      public static void writeOrder(BucketOrder order, StreamOutput out) throws IOException
      Parameters:
      order - order to write to the stream.
      out - stream to write the order to.
      Throws:
      IOException - on error writing to the stream.
    • writeHistogramOrder

      public static void writeHistogramOrder(BucketOrder order, StreamOutput out, boolean bwcOrderFlag) throws IOException
      ONLY FOR HISTOGRAM ORDER: Backwards compatibility logic to write a BucketOrder to a stream.
      Parameters:
      order - order to write to the stream.
      out - stream to write the order to.
      bwcOrderFlag - true to always out.writeBoolean(true) for the backwards compat logic before writing the order. false to skip this flag.
      Throws:
      IOException - on error writing to the stream.