|
|
|
@ -23,7 +23,6 @@ import org.apache.flink.cdc.common.configuration.Configuration;
|
|
|
|
|
import org.apache.flink.cdc.common.event.Event;
|
|
|
|
|
import org.apache.flink.cdc.common.factories.DataSourceFactory;
|
|
|
|
|
import org.apache.flink.cdc.common.factories.FactoryHelper;
|
|
|
|
|
import org.apache.flink.cdc.common.pipeline.PipelineOptions;
|
|
|
|
|
import org.apache.flink.cdc.common.source.DataSource;
|
|
|
|
|
import org.apache.flink.cdc.common.source.EventSourceProvider;
|
|
|
|
|
import org.apache.flink.cdc.common.source.FlinkSourceFunctionProvider;
|
|
|
|
@ -41,12 +40,14 @@ import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
|
|
|
|
|
public class DataSourceTranslator {
|
|
|
|
|
|
|
|
|
|
public DataStreamSource<Event> translate(
|
|
|
|
|
SourceDef sourceDef, StreamExecutionEnvironment env, Configuration pipelineConfig) {
|
|
|
|
|
SourceDef sourceDef,
|
|
|
|
|
StreamExecutionEnvironment env,
|
|
|
|
|
Configuration pipelineConfig,
|
|
|
|
|
int sourceParallelism) {
|
|
|
|
|
// Create data source
|
|
|
|
|
DataSource dataSource = createDataSource(sourceDef, env, pipelineConfig);
|
|
|
|
|
|
|
|
|
|
// Get source provider
|
|
|
|
|
final int sourceParallelism = pipelineConfig.get(PipelineOptions.PIPELINE_PARALLELISM);
|
|
|
|
|
EventSourceProvider eventSourceProvider = dataSource.getEventSourceProvider();
|
|
|
|
|
if (eventSourceProvider instanceof FlinkSourceProvider) {
|
|
|
|
|
// Source
|
|
|
|
|