Class TimestampedCollector<T>
- java.lang.Object
-
- org.apache.flink.streaming.api.operators.TimestampedCollector<T>
-
- Type Parameters:
T- The type of the elements that can be emitted.
- All Implemented Interfaces:
Output<T>,org.apache.flink.util.Collector<T>
@Internal public final class TimestampedCollector<T> extends Object implements Output<T>
Wrapper around anOutputfor user functions that expect aOutput. Before giving theTimestampedCollectorto a user function you must set the timestamp that should be attached to emitted elements. Most operators would set the timestamp of the incomingStreamRecordhere.
-
-
Constructor Summary
Constructors Constructor Description TimestampedCollector(Output<StreamRecord<T>> output)Creates a newTimestampedCollectorthat wraps the givenOutput.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()<X> voidcollect(org.apache.flink.util.OutputTag<X> outputTag, StreamRecord<X> record)Emits a record to the side output identified by the givenOutputTag.voidcollect(T record)voidemitLatencyMarker(LatencyMarker latencyMarker)voidemitRecordAttributes(RecordAttributes recordAttributes)Emits aRecordAttributesfrom an operator.voidemitWatermark(Watermark mark)Emits aWatermarkfrom an operator.voidemitWatermarkStatus(WatermarkStatus watermarkStatus)voideraseTimestamp()voidsetAbsoluteTimestamp(long timestamp)voidsetTimestamp(StreamRecord<?> timestampBase)
-
-
-
Constructor Detail
-
TimestampedCollector
public TimestampedCollector(Output<StreamRecord<T>> output)
Creates a newTimestampedCollectorthat wraps the givenOutput.
-
-
Method Detail
-
collect
public void collect(T record)
- Specified by:
collectin interfaceorg.apache.flink.util.Collector<T>
-
setTimestamp
public void setTimestamp(StreamRecord<?> timestampBase)
-
setAbsoluteTimestamp
public void setAbsoluteTimestamp(long timestamp)
-
eraseTimestamp
public void eraseTimestamp()
-
close
public void close()
- Specified by:
closein interfaceorg.apache.flink.util.Collector<T>
-
emitWatermark
public void emitWatermark(Watermark mark)
Description copied from interface:OutputEmits aWatermarkfrom 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:
emitWatermarkin interfaceOutput<T>
-
emitWatermarkStatus
public void emitWatermarkStatus(WatermarkStatus watermarkStatus)
- Specified by:
emitWatermarkStatusin interfaceOutput<T>
-
collect
public <X> void collect(org.apache.flink.util.OutputTag<X> outputTag, StreamRecord<X> record)Description copied from interface:OutputEmits a record to the side output identified by the givenOutputTag.
-
emitLatencyMarker
public void emitLatencyMarker(LatencyMarker latencyMarker)
- Specified by:
emitLatencyMarkerin interfaceOutput<T>
-
emitRecordAttributes
public void emitRecordAttributes(RecordAttributes recordAttributes)
Description copied from interface:OutputEmits aRecordAttributesfrom an operator. This element is broadcast to all downstream operators.- Specified by:
emitRecordAttributesin interfaceOutput<T>
-
-