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

[Optimization-3090] CDCSOURCE supports earliest-offset and timestamp scanStartupMode #3142

Merged
merged 1 commit into from
Feb 5, 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
8 changes: 4 additions & 4 deletions .github/workflows/docker_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
fail-fast: true
matrix:
url: [ registry.cn-hangzhou.aliyuncs.com ,docker.io ]
FLINK_VERSION: [1.14.6 , 1.15.2 , 1.16.0, 1.17.0, 1.18.0]
FLINK_VERSION: [1.14.6 , 1.15.4 , 1.16.3, 1.17.2, 1.18.1]
include:
- url: registry.cn-hangzhou.aliyuncs.com
namespace: dinky
Expand All @@ -163,11 +163,11 @@ jobs:
FLINK_BIG_VERSION: 1.14
- FLINK_VERSION: 1.15.4
FLINK_BIG_VERSION: 1.15
- FLINK_VERSION: 1.16.2
- FLINK_VERSION: 1.16.3
FLINK_BIG_VERSION: 1.16
- FLINK_VERSION : 1.17.1
- FLINK_VERSION : 1.17.2
FLINK_BIG_VERSION: 1.17
- FLINK_VERSION: 1.18.0
- FLINK_VERSION: 1.18.1
FLINK_BIG_VERSION: 1.18
steps:
- uses: actions/checkout@v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public DataStreamSource<String> build(StreamExecutionEnvironment env) {
String distributionFactorUpper = source.get("chunk-key.even-distribution.factor.lower-bound");
String scanNewlyAddedTableEnabled = source.get("scan.newly-added-table.enabled");
String schemaChanges = source.get("schema.changes");
String scanStartupSpecificOffsetFile = source.get("scan.startup.specific-offset.file");
String scanStartupSpecificOffsetPos = source.get("scan.startup.specific-offset.pos");
String scanStartupSpecificOffsetGtidSet = source.get("scan.startup.specific-offset.gtid-set");
String scanStartupTimestampMillis = source.get("scan.startup.timestamp-millis");

// 为部分转换添加默认值
Properties debeziumProperties = new Properties();
Expand Down Expand Up @@ -125,9 +129,30 @@ public DataStreamSource<String> build(StreamExecutionEnvironment env) {
case "initial":
sourceBuilder.startupOptions(StartupOptions.initial());
break;
case "earliest-offset":
sourceBuilder.startupOptions(StartupOptions.earliest());
break;
case "latest-offset":
sourceBuilder.startupOptions(StartupOptions.latest());
break;
case "specific-offset":
if (Asserts.isAllNotNullString(scanStartupSpecificOffsetFile, scanStartupSpecificOffsetPos)) {
sourceBuilder.startupOptions(StartupOptions.specificOffset(
scanStartupSpecificOffsetFile, Long.valueOf(scanStartupSpecificOffsetPos)));
} else if (Asserts.isNotNullString(scanStartupSpecificOffsetGtidSet)) {
sourceBuilder.startupOptions(StartupOptions.specificOffset(scanStartupSpecificOffsetGtidSet));
} else {
throw new RuntimeException("No specific offset parameter specified.");
}
break;
case "timestamp":
if (Asserts.isNotNullString(scanStartupTimestampMillis)) {
sourceBuilder.startupOptions(
StartupOptions.timestamp(Long.valueOf(scanStartupTimestampMillis)));
} else {
throw new RuntimeException("No timestamp parameter specified.");
}
break;
default:
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion dinky-flink/dinky-flink-1.18/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<properties>
<commons.version>1.3.1</commons.version>
<flink.shaded.version>17.0</flink.shaded.version>
<flink.version>1.18.0</flink.version>
<flink.version>1.18.1</flink.version>
<flinkcdc.version>3.0.1</flinkcdc.version>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<druid-starter>1.2.8</druid-starter>
<easy.rules.version>4.1.0</easy.rules.version>
<fastjson2.version>2.0.41</fastjson2.version>
<flink.version>1.18.0</flink.version>
<flink.version>1.18.1</flink.version>
<guava.version>32.1.3-jre</guava.version>
<h2database.version>1.4.200</h2database.version>
<hamcrest.version>1.3</hamcrest.version>
Expand Down
Loading