Class CountingOutput<OUT>
- java.lang.Object
-
- org.apache.flink.streaming.api.operators.CountingOutput<OUT>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Output<StreamRecord<OUT>>
,WatermarkGaugeExposingOutput<StreamRecord<OUT>>
,Collector<StreamRecord<OUT>>
public class CountingOutput<OUT> extends Object implements WatermarkGaugeExposingOutput<StreamRecord<OUT>>
WrappingOutput
that updates metrics on the number of emitted elements.
-
-
Constructor Summary
Constructors Constructor Description CountingOutput(WatermarkGaugeExposingOutput<StreamRecord<OUT>> output, Counter numRecordsOut)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the collector.void
collect(StreamRecord<OUT> record)
Emits a record.<X> void
collect(OutputTag<X> outputTag, StreamRecord<X> record)
Emits a record to the side output identified by the givenOutputTag
.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)
Gauge<Long>
getWatermarkGauge()
-
-
-
Constructor Detail
-
CountingOutput
public CountingOutput(WatermarkGaugeExposingOutput<StreamRecord<OUT>> output, Counter numRecordsOut)
-
-
Method Detail
-
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<OUT>
-
emitWatermarkStatus
public void emitWatermarkStatus(WatermarkStatus watermarkStatus)
- Specified by:
emitWatermarkStatus
in interfaceOutput<OUT>
-
emitLatencyMarker
public void emitLatencyMarker(LatencyMarker latencyMarker)
- Specified by:
emitLatencyMarker
in interfaceOutput<OUT>
-
collect
public void collect(StreamRecord<OUT> record)
Description copied from interface:Collector
Emits a record.
-
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
.
-
close
public void close()
Description copied from interface:Collector
Closes the collector. If any data was buffered, that data will be flushed.
-
getWatermarkGauge
public Gauge<Long> getWatermarkGauge()
- Specified by:
getWatermarkGauge
in interfaceWatermarkGaugeExposingOutput<OUT>
-
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<OUT>
-
-