Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade cdc to 3.2.0 #3878

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@
import org.dinky.trans.AbstractOperation;
import org.dinky.trans.Operation;

import org.apache.flink.cdc.cli.parser.YamlPipelineDefinitionParser;
import org.apache.flink.cdc.common.configuration.Configuration;
import org.apache.flink.cdc.composer.PipelineComposer;
import org.apache.flink.cdc.composer.definition.PipelineDef;
import org.apache.flink.cdc.composer.flink.FlinkPipelineComposer;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.table.api.TableResult;
import org.apache.flink.table.api.internal.TableResultImpl;

import java.lang.reflect.Constructor;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -86,11 +90,11 @@ public Operation create(String statement) {
public TableResult execute(Executor executor) {
String yamlText = getPipelineConfigure(statement);
Configuration globalPipelineConfig = Configuration.fromMap(executor.getSetConfig());
// Parse pipeline definition file
YamlTextPipelineDefinitionParser pipelineDefinitionParser = new YamlTextPipelineDefinitionParser();
// Create composer
PipelineComposer composer = createComposer(executor);
try {
// Parse pipeline definition file
YamlPipelineDefinitionParser pipelineDefinitionParser = new YamlPipelineDefinitionParser();
// Create composer
PipelineComposer composer = createComposer(executor);
PipelineDef pipelineDef = pipelineDefinitionParser.parse(yamlText, globalPipelineConfig);
// Compose pipeline
composer.compose(pipelineDef);
Expand All @@ -110,8 +114,16 @@ public String getPipelineConfigure(String statement) {
return "";
}

public DinkyFlinkPipelineComposer createComposer(Executor executor) {

return DinkyFlinkPipelineComposer.of(executor);
public PipelineComposer createComposer(Executor executor) {
try {
Class<FlinkPipelineComposer> clazz = (Class<FlinkPipelineComposer>)
Class.forName("org.apache.flink.cdc.composer.flink.FlinkPipelineComposer");
Constructor<FlinkPipelineComposer> constructor =
clazz.getDeclaredConstructor(StreamExecutionEnvironment.class, boolean.class);
constructor.setAccessible(true);
return constructor.newInstance(executor.getStreamExecutionEnvironment(), false);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
Loading
Loading