Class SortingDataInput<T,​K>

  • Type Parameters:
    T - The type of the value in incoming StreamRecords.
    K - The type of the key.
    All Implemented Interfaces:
    Closeable, AutoCloseable, AvailabilityProvider, PushingAsyncDataInput<T>, StreamTaskInput<T>

    public final class SortingDataInput<T,​K>
    extends Object
    implements StreamTaskInput<T>
    A StreamTaskInput which sorts in the incoming records from a chained input. It postpones emitting the records until it receives DataInputStatus.END_OF_INPUT from the chained input. After it is done it emits a single record at a time from the sorter.

    The sorter uses binary comparison of keys, which are extracted and serialized when received from the chained input. Moreover the timestamps of incoming records are used for secondary ordering. For the comparison it uses either FixedLengthByteKeyComparator if the length of the serialized key is constant, or VariableLengthByteKeyComparator otherwise.

    Watermarks, watermark statuses, nor latency markers are propagated downstream as they do not make sense with buffered records. The input emits the largest watermark seen after all records.