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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassA source output that validates the output. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected final intprotected final intFields inherited from class org.apache.flink.util.TestLogger
log, nameProvider, watchman -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected abstract longgetNextRecordIndex(SplitT split) protected intprotected abstract SplitTgetSplit(int splitId, int numRecords, org.apache.flink.api.connector.source.Boundedness boundedness) getSplits(int numSplits, int numRecordsPerSplit, org.apache.flink.api.connector.source.Boundedness boundedness)
-
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
-
getSplit
protected abstract SplitT getSplit(int splitId, int numRecords, org.apache.flink.api.connector.source.Boundedness boundedness) -
getNextRecordIndex
-