Skip to content

Commit 4551d0b

Browse files
PatrickRenChaomingZhangCN
authored andcommitted
[cdc-common][hotfix] Remove redundant prefix of pipeline options (apache#2821)
This closes apache#2821.
1 parent f3cdece commit 4551d0b

4 files changed

Lines changed: 18 additions & 16 deletions

File tree

flink-cdc-common/src/main/java/com/ververica/cdc/common/pipeline/PipelineOptions.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@
2929
public class PipelineOptions {
3030

3131
public static final ConfigOption<String> PIPELINE_NAME =
32-
ConfigOptions.key("pipeline.name")
32+
ConfigOptions.key("name")
3333
.stringType()
3434
.defaultValue("Flink CDC Pipeline Job")
3535
.withDescription("The name of the pipeline");
3636

37-
public static final ConfigOption<Integer> GLOBAL_PARALLELISM =
38-
ConfigOptions.key("pipeline.global.parallelism")
37+
public static final ConfigOption<Integer> PIPELINE_PARALLELISM =
38+
ConfigOptions.key("parallelism")
3939
.intType()
4040
.noDefaultValue()
41-
.withDescription("The global parallelism of the pipeline");
41+
.withDescription("Parallelism of the pipeline");
4242

43-
public static final ConfigOption<SchemaChangeBehavior> SCHEMA_CHANGE_BEHAVIOR =
44-
ConfigOptions.key("pipeline.schema.change.behavior")
43+
public static final ConfigOption<SchemaChangeBehavior> PIPELINE_SCHEMA_CHANGE_BEHAVIOR =
44+
ConfigOptions.key("schema.change.behavior")
4545
.enumType(SchemaChangeBehavior.class)
4646
.defaultValue(SchemaChangeBehavior.EVOLVE)
4747
.withDescription(
@@ -58,7 +58,7 @@ public class PipelineOptions {
5858
.build());
5959

6060
public static final ConfigOption<String> PIPELINE_LOCAL_TIME_ZONE =
61-
ConfigOptions.key("pipeline.local-time-zone")
61+
ConfigOptions.key("local-time-zone")
6262
.stringType()
6363
// "systemDefault" is a special value to decide whether to use
6464
// ZoneId.systemDefault() in
@@ -77,8 +77,8 @@ public class PipelineOptions {
7777
+ "such as \"America/Los_Angeles\", or a custom timezone id such as \"GMT-08:00\".")
7878
.build());
7979

80-
public static final ConfigOption<String> SCHEMA_OPERATOR_UID =
81-
ConfigOptions.key("pipeline.schema.operator.uid")
80+
public static final ConfigOption<String> PIPELINE_SCHEMA_OPERATOR_UID =
81+
ConfigOptions.key("schema.operator.uid")
8282
.stringType()
8383
.defaultValue("$$_schema_operator_$$")
8484
.withDescription(

flink-cdc-composer/src/main/java/com/ververica/cdc/composer/flink/FlinkPipelineComposer.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private FlinkPipelineComposer(StreamExecutionEnvironment env, boolean isBlocking
9292

9393
@Override
9494
public PipelineExecution compose(PipelineDef pipelineDef) {
95-
int parallelism = pipelineDef.getConfig().get(PipelineOptions.GLOBAL_PARALLELISM);
95+
int parallelism = pipelineDef.getConfig().get(PipelineOptions.PIPELINE_PARALLELISM);
9696
env.getConfig().setParallelism(parallelism);
9797

9898
// Source
@@ -110,8 +110,10 @@ public PipelineExecution compose(PipelineDef pipelineDef) {
110110
// Schema operator
111111
SchemaOperatorTranslator schemaOperatorTranslator =
112112
new SchemaOperatorTranslator(
113-
pipelineDef.getConfig().get(PipelineOptions.SCHEMA_CHANGE_BEHAVIOR),
114-
pipelineDef.getConfig().get(PipelineOptions.SCHEMA_OPERATOR_UID));
113+
pipelineDef
114+
.getConfig()
115+
.get(PipelineOptions.PIPELINE_SCHEMA_CHANGE_BEHAVIOR),
116+
pipelineDef.getConfig().get(PipelineOptions.PIPELINE_SCHEMA_OPERATOR_UID));
115117
stream =
116118
schemaOperatorTranslator.translate(
117119
stream, parallelism, dataSink.getMetadataApplier());

flink-cdc-composer/src/main/java/com/ververica/cdc/composer/flink/translator/DataSourceTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public DataStreamSource<Event> translate(
6262
.ifPresent(jar -> FlinkEnvironmentUtils.addJar(env, jar));
6363

6464
// Get source provider
65-
final int sourceParallelism = pipelineConfig.get(PipelineOptions.GLOBAL_PARALLELISM);
65+
final int sourceParallelism = pipelineConfig.get(PipelineOptions.PIPELINE_PARALLELISM);
6666
EventSourceProvider eventSourceProvider = dataSource.getEventSourceProvider();
6767
if (eventSourceProvider instanceof FlinkSourceProvider) {
6868
// Source

flink-cdc-composer/src/test/java/com/ververica/cdc/composer/flink/FlinkPipelineComposerITCase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void testSingleSplitSingleTable() throws Exception {
109109

110110
// Setup pipeline
111111
Configuration pipelineConfig = new Configuration();
112-
pipelineConfig.set(PipelineOptions.GLOBAL_PARALLELISM, 1);
112+
pipelineConfig.set(PipelineOptions.PIPELINE_PARALLELISM, 1);
113113
PipelineDef pipelineDef =
114114
new PipelineDef(
115115
sourceDef,
@@ -163,7 +163,7 @@ void testSingleSplitMultipleTables() throws Exception {
163163

164164
// Setup pipeline
165165
Configuration pipelineConfig = new Configuration();
166-
pipelineConfig.set(PipelineOptions.GLOBAL_PARALLELISM, 1);
166+
pipelineConfig.set(PipelineOptions.PIPELINE_PARALLELISM, 1);
167167
PipelineDef pipelineDef =
168168
new PipelineDef(
169169
sourceDef,
@@ -227,7 +227,7 @@ void testMultiSplitsSingleTable() throws Exception {
227227

228228
// Setup pipeline
229229
Configuration pipelineConfig = new Configuration();
230-
pipelineConfig.set(PipelineOptions.GLOBAL_PARALLELISM, MAX_PARALLELISM);
230+
pipelineConfig.set(PipelineOptions.PIPELINE_PARALLELISM, MAX_PARALLELISM);
231231
PipelineDef pipelineDef =
232232
new PipelineDef(
233233
sourceDef,

0 commit comments

Comments
 (0)