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.TestLoggerAn abstract test class for all the unit tests ofSourceReaderto inherit.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSourceReaderTestBase.ValidatingSourceOutputA source output that validates the output.
-
Field Summary
Fields Modifier and Type Field Description protected static intNUM_RECORDS_PER_SPLITprotected intnumSplitsprotected inttotalNumRecords
-
Constructor Summary
Constructors Constructor Description SourceReaderTestBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract org.apache.flink.api.connector.source.SourceReader<Integer,SplitT>createReader()voidensureNoDangling()protected abstract longgetNextRecordIndex(SplitT split)protected intgetNumSplits()protected abstract SplitTgetSplit(int splitId, int numRecords, org.apache.flink.api.connector.source.Boundedness boundedness)protected abstract List<SplitT>getSplits(int numSplits, int numRecordsPerSplit, org.apache.flink.api.connector.source.Boundedness boundedness)
-
-
-
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
-
-
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)
-
-