Class SourceReaderTestBase<SplitT extends org.apache.flink.api.connector.source.SourceSplit>

java.lang.Object
org.apache.flink.util.TestLogger
org.apache.flink.connector.testutils.source.reader.SourceReaderTestBase<SplitT>
Type Parameters:
SplitT - the type of the splits.

public abstract class SourceReaderTestBase<SplitT extends org.apache.flink.api.connector.source.SourceSplit> extends org.apache.flink.util.TestLogger
An abstract test class for all the unit tests of SourceReader to inherit.
  • Field Details

    • numSplits

      protected final int numSplits
    • totalNumRecords

      protected final int totalNumRecords
    • NUM_RECORDS_PER_SPLIT

      protected static final int NUM_RECORDS_PER_SPLIT
      See Also:
  • Constructor Details

    • SourceReaderTestBase

      public SourceReaderTestBase()
  • Method Details

    • getNumSplits

      protected int getNumSplits()
    • ensureNoDangling

      @AfterEach public void ensureNoDangling()
    • createReader

      protected abstract org.apache.flink.api.connector.source.SourceReader<Integer,SplitT> createReader() throws Exception
      Throws:
      Exception
    • getSplits

      protected abstract List<SplitT> getSplits(int numSplits, int numRecordsPerSplit, org.apache.flink.api.connector.source.Boundedness boundedness)
    • getSplit

      protected abstract SplitT getSplit(int splitId, int numRecords, org.apache.flink.api.connector.source.Boundedness boundedness)
    • getNextRecordIndex

      protected abstract long getNextRecordIndex(SplitT split)