T - Type of elements after deserialization by source@Experimental public interface ExternalContext<T> extends Serializable, AutoCloseable
This context is responsible for providing:
SourceSplitDataWriter for creating splits and writing test data into the created
split
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ExternalContext.Factory<T>
Factory for
ExternalContext. |
| Modifier and Type | Method and Description |
|---|---|
org.apache.flink.api.connector.source.Source<T,?,?> |
createSource(org.apache.flink.api.connector.source.Boundedness boundedness)
Create a new instance of connector source implemented in
Source. |
SourceSplitDataWriter<T> |
createSourceSplitDataWriter()
Create a new split in the external system and a data writer corresponding to the new split.
|
Collection<T> |
generateTestData(int splitIndex,
long seed)
Generate test data.
|
closeorg.apache.flink.api.connector.source.Source<T,?,?> createSource(org.apache.flink.api.connector.source.Boundedness boundedness)
Source.SourceSplitDataWriter<T> createSourceSplitDataWriter()
Collection<T> generateTestData(int splitIndex, long seed)
Make sure that the T#equals(Object) returns false when the records in different
splits.
splitIndex - index of the split.seed - Seed for generating random test data set.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.