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.
@Internal public final class TimestampedCollector<T> extends Object implements Output<T>
Wrapper around anOutput
for user functions that expect aOutput
. Before giving theTimestampedCollector
to a user function you must set the timestamp that should be attached to emitted elements. Most operators would set the timestamp of the incomingStreamRecord
here.
-
-
Constructor Summary
Constructors Constructor Description TimestampedCollector(Output<StreamRecord<T>> output)
Creates a newTimestampedCollector
that wraps the givenOutput
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the collector.<X> void
collect(OutputTag<X> outputTag, StreamRecord<X> record)
Emits a record to the side output identified by the givenOutputTag
.void
collect(T record)
Emits a record.void
emitLatencyMarker(LatencyMarker latencyMarker)
void
emitRecordAttributes(RecordAttributes recordAttributes)
Emits aRecordAttributes
from an operator.void
emitWatermark(Watermark mark)
Emits aWatermark
from an operator.void
emitWatermarkStatus(WatermarkStatus watermarkStatus)
void
eraseTimestamp()
void
setAbsoluteTimestamp(long timestamp)
void
setTimestamp(StreamRecord<?> timestampBase)
-
-
-
Constructor Detail
-
TimestampedCollector
public TimestampedCollector(Output<StreamRecord<T>> output)
Creates a newTimestampedCollector
that wraps the givenOutput
.
-
-
Method Detail
-
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.
-
emitWatermark
public void emitWatermark(Watermark mark)
Description copied from interface:Output
Emits aWatermark
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 interfaceOutput<T>
-
emitWatermarkStatus
public void emitWatermarkStatus(WatermarkStatus watermarkStatus)
- Specified by:
emitWatermarkStatus
in interfaceOutput<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 givenOutputTag
.
-
emitLatencyMarker
public void emitLatencyMarker(LatencyMarker latencyMarker)
- Specified by:
emitLatencyMarker
in interfaceOutput<T>
-
emitRecordAttributes
public void emitRecordAttributes(RecordAttributes recordAttributes)
Description copied from interface:Output
Emits aRecordAttributes
from an operator. This element is broadcast to all downstream operators.- Specified by:
emitRecordAttributes
in interfaceOutput<T>
-
-