Class CollectingReaderOutput<T>

java.lang.Object
io.github.flink.gcp.connector.testutils.CollectingReaderOutput<T>
All Implemented Interfaces:
org.apache.flink.api.common.eventtime.WatermarkOutput, org.apache.flink.api.connector.source.ReaderOutput<T>, org.apache.flink.api.connector.source.SourceOutput<T>

@Internal public final class CollectingReaderOutput<T> extends Object implements org.apache.flink.api.connector.source.ReaderOutput<T>
ReaderOutput for tests that drive SourceReaderBase.pollNext(...), delegating to one shared CollectingSourceOutput whatever split a record came from.

Written here rather than taken from Flink because flink-connector-base's test jar is not a dependency of any module in this repository, and CollectingSourceOutput is a SourceOutput only — which is what a RecordEmitter is handed, not what pollNext takes.

Every split shares the one output: nothing here is about per-split watermarks, and a test that needs them should say so by giving each split its own.

  • Constructor Details

    • CollectingReaderOutput

      public CollectingReaderOutput()
  • Method Details

    • records

      public List<T> records()
    • collect

      public void collect(T record)
      Specified by:
      collect in interface org.apache.flink.api.connector.source.ReaderOutput<T>
      Specified by:
      collect in interface org.apache.flink.api.connector.source.SourceOutput<T>
    • collect

      public void collect(T record, long timestamp)
      Specified by:
      collect in interface org.apache.flink.api.connector.source.ReaderOutput<T>
      Specified by:
      collect in interface org.apache.flink.api.connector.source.SourceOutput<T>
    • emitWatermark

      public void emitWatermark(org.apache.flink.api.common.eventtime.Watermark watermark)
      Specified by:
      emitWatermark in interface org.apache.flink.api.connector.source.ReaderOutput<T>
      Specified by:
      emitWatermark in interface org.apache.flink.api.common.eventtime.WatermarkOutput
    • markIdle

      public void markIdle()
      Specified by:
      markIdle in interface org.apache.flink.api.connector.source.ReaderOutput<T>
      Specified by:
      markIdle in interface org.apache.flink.api.common.eventtime.WatermarkOutput
    • markActive

      public void markActive()
      Specified by:
      markActive in interface org.apache.flink.api.common.eventtime.WatermarkOutput
    • createOutputForSplit

      public org.apache.flink.api.connector.source.SourceOutput<T> createOutputForSplit(String splitId)
      Specified by:
      createOutputForSplit in interface org.apache.flink.api.connector.source.ReaderOutput<T>
    • releaseOutputForSplit

      public void releaseOutputForSplit(String splitId)
      Specified by:
      releaseOutputForSplit in interface org.apache.flink.api.connector.source.ReaderOutput<T>