T - Type of elements after deserialization by source@Experimental public interface DataStreamSourceExternalContext<T> extends ExternalContext, org.apache.flink.api.java.typeutils.ResultTypeQueryable<T>
| Modifier and Type | Method and Description |
|---|---|
org.apache.flink.api.connector.source.Source<T,?,?> |
createSource(TestingSourceSettings sourceSettings)
Create an instance of
Source satisfying given options. |
ExternalSystemSplitDataWriter<T> |
createSourceSplitDataWriter(TestingSourceSettings sourceSettings)
Create a new split in the external system and return a data writer corresponding to the new
split.
|
List<T> |
generateTestData(TestingSourceSettings sourceSettings,
int splitIndex,
long seed)
Generate test data.
|
getConnectorJarPathscloseorg.apache.flink.api.connector.source.Source<T,?,?> createSource(TestingSourceSettings sourceSettings) throws UnsupportedOperationException
Source satisfying given options.sourceSettings - settings of the sourceUnsupportedOperationException - if the provided option is not supported.ExternalSystemSplitDataWriter<T> createSourceSplitDataWriter(TestingSourceSettings sourceSettings)
sourceSettings - options of the sourceList<T> generateTestData(TestingSourceSettings sourceSettings, int splitIndex, long seed)
These test data will be written to external system using ExternalSystemSplitDataWriter, consume back by source in testing Flink job, and make
comparison with T#equals(Object) for validating correctness.
Note: Make sure that the T#equals(Object) returns false when the records in
different splits.
sourceSettings - options of the sourcesplitIndex - index of the split.seed - Seed for generating random test data set.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.