Class RecordWriterOutput<OUT>
- java.lang.Object
-
- org.apache.flink.streaming.runtime.io.RecordWriterOutput<OUT>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Output<StreamRecord<OUT>>
,OutputWithChainingCheck<StreamRecord<OUT>>
,WatermarkGaugeExposingOutput<StreamRecord<OUT>>
,Collector<StreamRecord<OUT>>
@Internal public class RecordWriterOutput<OUT> extends Object implements WatermarkGaugeExposingOutput<StreamRecord<OUT>>, OutputWithChainingCheck<StreamRecord<OUT>>
Implementation ofOutput
that sends data using aRecordWriter
.
-
-
Constructor Summary
Constructors Constructor Description RecordWriterOutput(RecordWriter<SerializationDelegate<StreamRecord<OUT>>> recordWriter, TypeSerializer<OUT> outSerializer, OutputTag outputTag, boolean supportsUnalignedCheckpoints)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abortCheckpoint(long checkpointId, CheckpointException cause)
void
alignedBarrierTimeout(long checkpointId)
void
broadcastEvent(AbstractEvent event, boolean isPriorityEvent)
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
.boolean
collectAndCheckIfChained(StreamRecord<OUT> record)
<X> boolean
collectAndCheckIfChained(OutputTag<X> outputTag, StreamRecord<X> 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
flush()
Gauge<Long>
getWatermarkGauge()
void
setNumRecordsOut(Counter numRecordsOut)
-
-
-
Constructor Detail
-
RecordWriterOutput
public RecordWriterOutput(RecordWriter<SerializationDelegate<StreamRecord<OUT>>> recordWriter, TypeSerializer<OUT> outSerializer, OutputTag outputTag, boolean supportsUnalignedCheckpoints)
-
-
Method Detail
-
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
.
-
collectAndCheckIfChained
public boolean collectAndCheckIfChained(StreamRecord<OUT> record)
- Specified by:
collectAndCheckIfChained
in interfaceOutputWithChainingCheck<OUT>
- Returns:
- true if the collected record has been emitted to a downstream subtask. Otherwise, false.
-
collectAndCheckIfChained
public <X> boolean collectAndCheckIfChained(OutputTag<X> outputTag, StreamRecord<X> record)
- Specified by:
collectAndCheckIfChained
in interfaceOutputWithChainingCheck<OUT>
- Returns:
- true if the collected record has been emitted to a downstream subtask. Otherwise, false.
-
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>
-
setNumRecordsOut
public void setNumRecordsOut(Counter numRecordsOut)
-
broadcastEvent
public void broadcastEvent(AbstractEvent event, boolean isPriorityEvent) throws IOException
- Throws:
IOException
-
alignedBarrierTimeout
public void alignedBarrierTimeout(long checkpointId) throws IOException
- Throws:
IOException
-
abortCheckpoint
public void abortCheckpoint(long checkpointId, CheckpointException cause)
-
flush
public void flush() throws IOException
- Throws:
IOException
-
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>
-
-