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>>, org.apache.flink.util.Collector<StreamRecord<OUT>>

@Internal public class RecordWriterOutput<OUT> extends Object implements WatermarkGaugeExposingOutput<StreamRecord<OUT>>, OutputWithChainingCheck<StreamRecord<OUT>>
Implementation of Output that sends data using a RecordWriter.
  • Constructor Details

    • RecordWriterOutput

      public RecordWriterOutput(RecordWriter<SerializationDelegate<StreamRecord<OUT>>> recordWriter, org.apache.flink.api.common.typeutils.TypeSerializer<OUT> outSerializer, org.apache.flink.util.OutputTag outputTag, boolean supportsUnalignedCheckpoints)
  • Method Details

    • collect

      public void collect(StreamRecord<OUT> record)
      Specified by:
      collect in interface org.apache.flink.util.Collector<OUT>
    • collect

      public <X> void collect(org.apache.flink.util.OutputTag<X> outputTag, StreamRecord<X> record)
      Description copied from interface: Output
      Emits a record to the side output identified by the given OutputTag.
      Specified by:
      collect in interface Output<OUT>
      record - The record to collect.
    • collectAndCheckIfChained

      public boolean collectAndCheckIfChained(StreamRecord<OUT> record)
      Specified by:
      collectAndCheckIfChained in interface OutputWithChainingCheck<OUT>
      Returns:
      true if the collected record has been emitted to a downstream subtask. Otherwise, false.
    • collectAndCheckIfChained

      public <X> boolean collectAndCheckIfChained(org.apache.flink.util.OutputTag<X> outputTag, StreamRecord<X> record)
      Specified by:
      collectAndCheckIfChained in interface OutputWithChainingCheck<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 a Watermark 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 interface Output<OUT>
    • emitWatermarkStatus

      public void emitWatermarkStatus(WatermarkStatus watermarkStatus)
      Specified by:
      emitWatermarkStatus in interface Output<OUT>
    • emitLatencyMarker

      public void emitLatencyMarker(LatencyMarker latencyMarker)
      Specified by:
      emitLatencyMarker in interface Output<OUT>
    • setNumRecordsOut

      public void setNumRecordsOut(org.apache.flink.metrics.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()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.apache.flink.util.Collector<OUT>
    • getWatermarkGauge

      public org.apache.flink.metrics.Gauge<Long> getWatermarkGauge()
      Specified by:
      getWatermarkGauge in interface WatermarkGaugeExposingOutput<OUT>
    • emitRecordAttributes

      public void emitRecordAttributes(RecordAttributes recordAttributes)
      Description copied from interface: Output
      Emits a RecordAttributes from an operator. This element is broadcast to all downstream operators.
      Specified by:
      emitRecordAttributes in interface Output<OUT>
    • emitWatermark

      public void emitWatermark(WatermarkEvent watermark)
      Description copied from interface: Output
      Emits a Watermark from an operator, wrapped in a WatermarkEvent.
      Specified by:
      emitWatermark in interface Output<OUT>