Class MultiInputSortingDataInput<IN,​K>

  • All Implemented Interfaces:
    Closeable, AutoCloseable, AvailabilityProvider, PushingAsyncDataInput<IN>, StreamTaskInput<IN>

    public final class MultiInputSortingDataInput<IN,​K>
    extends Object
    implements StreamTaskInput<IN>
    An input that wraps an underlying input and sorts the incoming records. It starts emitting records downstream only when all the other inputs coupled with this MultiInputSortingDataInput have finished sorting as well.

    Moreover it will report it is available or approximately available if it has some records pending only if the head of the MultiInputSortingDataInput.CommonContext.getQueueOfHeads() belongs to the input. That way there is only ever one input that reports it is available.

    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.