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

  • 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 Detail

      • numSplits

        protected final int numSplits
      • totalNumRecords

        protected final int totalNumRecords
      • NUM_RECORDS_PER_SPLIT

        protected static final int NUM_RECORDS_PER_SPLIT
        See Also:
        Constant Field Values
    • Constructor Detail

      • SourceReaderTestBase

        public SourceReaderTestBase()
    • Method Detail

      • 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)