Interface DataStreamSinkExternalContext<T>
-
- Type Parameters:
T
- Type of elements before serialization by sink
- All Superinterfaces:
AutoCloseable
,ExternalContext
,ResultTypeQueryable<T>
- All Known Subinterfaces:
DataStreamSinkV2ExternalContext<T>
@Experimental public interface DataStreamSinkExternalContext<T> extends ExternalContext, ResultTypeQueryable<T>
External context for DataStream sinks.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExternalSystemDataReader<T>
createSinkDataReader(TestingSinkSettings sinkSettings)
Create a reader for consuming data written to the external system by sink.List<T>
generateTestData(TestingSinkSettings sinkSettings, long seed)
Generate test data.-
Methods inherited from interface java.lang.AutoCloseable
close
-
Methods inherited from interface org.apache.flink.connector.testframe.external.ExternalContext
getConnectorJarPaths
-
Methods inherited from interface org.apache.flink.api.java.typeutils.ResultTypeQueryable
getProducedType
-
-
-
-
Method Detail
-
createSinkDataReader
ExternalSystemDataReader<T> createSinkDataReader(TestingSinkSettings sinkSettings)
Create a reader for consuming data written to the external system by sink.
-
generateTestData
List<T> generateTestData(TestingSinkSettings sinkSettings, long seed)
Generate test data.These test data will be sent to sink via a special source in Flink job, write to external system by sink, consume back via
ExternalSystemDataReader
, and make comparison withObject.equals(Object)
for validating correctness.Make sure that the
Object.equals(Object)
returns false when the records in different splits.- Parameters:
sinkSettings
- settings of the sinkseed
- Seed for generating random test data set.- Returns:
- List of generated test data.
-
-