Class TimestampedCollector<T>

  • Type Parameters:
    T - The type of the elements that can be emitted.
    All Implemented Interfaces:
    Output<T>, Collector<T>

    @Internal
    public final class TimestampedCollector<T>
    extends Object
    implements Output<T>
    Wrapper around an Output for user functions that expect a Output. Before giving the TimestampedCollector to a user function you must set the timestamp that should be attached to emitted elements. Most operators would set the timestamp of the incoming StreamRecord here.
    • Method Detail

      • collect

        public void collect​(T record)
        Description copied from interface: Collector
        Emits a record.
        Specified by:
        collect in interface Collector<T>
        Parameters:
        record - The record to collect.
      • setTimestamp

        public void setTimestamp​(StreamRecord<?> timestampBase)
      • setAbsoluteTimestamp

        public void setAbsoluteTimestamp​(long timestamp)
      • eraseTimestamp

        public void eraseTimestamp()
      • close

        public void close()
        Description copied from interface: Collector
        Closes the collector. If any data was buffered, that data will be flushed.
        Specified by:
        close in interface Collector<T>
      • emitWatermark

        public void emitWatermark​(Watermark mark)
        Description copied from interface: Output
        Emits a Watermark from an operator. This watermark is broadcast to all downstream operators.

        A watermark specifies that no element with a timestamp lower or equal to the watermark timestamp will be emitted in the future.

        Specified by:
        emitWatermark in interface Output<T>
      • collect

        public <X> void collect​(OutputTag<X> outputTag,
                                StreamRecord<X> record)
        Description copied from interface: Output
        Emits a record to the side output identified by the given OutputTag.
        Specified by:
        collect in interface Output<T>
        record - The record to collect.