public class CountingOutput<OUT> extends Object implements WatermarkGaugeExposingOutput<StreamRecord<OUT>>
Output that updates metrics on the number of emitted elements.| Constructor and Description |
|---|
CountingOutput(WatermarkGaugeExposingOutput<StreamRecord<OUT>> output,
org.apache.flink.metrics.Counter numRecordsOut) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
<X> void |
collect(org.apache.flink.util.OutputTag<X> outputTag,
StreamRecord<X> record)
Emits a record to the side output identified by the given
OutputTag. |
void |
collect(StreamRecord<OUT> record) |
void |
emitLatencyMarker(LatencyMarker latencyMarker) |
void |
emitRecordAttributes(RecordAttributes recordAttributes)
Emits a
RecordAttributes from an operator. |
void |
emitWatermark(Watermark mark)
Emits a
Watermark from an operator. |
void |
emitWatermarkStatus(WatermarkStatus watermarkStatus) |
org.apache.flink.metrics.Gauge<Long> |
getWatermarkGauge() |
public CountingOutput(WatermarkGaugeExposingOutput<StreamRecord<OUT>> output, org.apache.flink.metrics.Counter numRecordsOut)
public void emitWatermark(Watermark mark)
OutputWatermark 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.
emitWatermark in interface Output<StreamRecord<OUT>>public void emitWatermarkStatus(WatermarkStatus watermarkStatus)
emitWatermarkStatus in interface Output<StreamRecord<OUT>>public void emitLatencyMarker(LatencyMarker latencyMarker)
emitLatencyMarker in interface Output<StreamRecord<OUT>>public void collect(StreamRecord<OUT> record)
collect in interface org.apache.flink.util.Collector<StreamRecord<OUT>>public <X> void collect(org.apache.flink.util.OutputTag<X> outputTag,
StreamRecord<X> record)
OutputOutputTag.collect in interface Output<StreamRecord<OUT>>record - The record to collect.public void close()
close in interface Closeableclose in interface AutoCloseableclose in interface org.apache.flink.util.Collector<StreamRecord<OUT>>public org.apache.flink.metrics.Gauge<Long> getWatermarkGauge()
getWatermarkGauge in interface WatermarkGaugeExposingOutput<StreamRecord<OUT>>public void emitRecordAttributes(RecordAttributes recordAttributes)
OutputRecordAttributes from an operator. This element is broadcast to all
downstream operators.emitRecordAttributes in interface Output<StreamRecord<OUT>>Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.