Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
61adf489
Unverified
Commit
61adf489
authored
Feb 05, 2024
by
aiwenmo
Committed by
GitHub
Feb 05, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Optimization-3090] CDCSOURCE supports earliest-offset and timestamp scanStartupMode (#3142)
Co-authored-by:
wenmo
<
32723967+wenmo@users.noreply.github.com
>
parent
d54986c5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
6 deletions
+31
-6
docker_build.yaml
.github/workflows/docker_build.yaml
+4
-4
MysqlCDCBuilder.java
...re/src/main/java/org/dinky/cdc/mysql/MysqlCDCBuilder.java
+25
-0
pom.xml
dinky-flink/dinky-flink-1.18/pom.xml
+1
-1
pom.xml
pom.xml
+1
-1
No files found.
.github/workflows/docker_build.yaml
View file @
61adf489
...
@@ -153,7 +153,7 @@ jobs:
...
@@ -153,7 +153,7 @@ jobs:
fail-fast
:
true
fail-fast
:
true
matrix
:
matrix
:
url
:
[
registry.cn-hangzhou.aliyuncs.com
,
docker.io
]
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
:
include
:
-
url
:
registry.cn-hangzhou.aliyuncs.com
-
url
:
registry.cn-hangzhou.aliyuncs.com
namespace
:
dinky
namespace
:
dinky
...
@@ -163,11 +163,11 @@ jobs:
...
@@ -163,11 +163,11 @@ jobs:
FLINK_BIG_VERSION
:
1.14
FLINK_BIG_VERSION
:
1.14
-
FLINK_VERSION
:
1.15.4
-
FLINK_VERSION
:
1.15.4
FLINK_BIG_VERSION
:
1.15
FLINK_BIG_VERSION
:
1.15
-
FLINK_VERSION
:
1.16.
2
-
FLINK_VERSION
:
1.16.
3
FLINK_BIG_VERSION
:
1.16
FLINK_BIG_VERSION
:
1.16
-
FLINK_VERSION
:
1.17.
1
-
FLINK_VERSION
:
1.17.
2
FLINK_BIG_VERSION
:
1.17
FLINK_BIG_VERSION
:
1.17
-
FLINK_VERSION
:
1.18.
0
-
FLINK_VERSION
:
1.18.
1
FLINK_BIG_VERSION
:
1.18
FLINK_BIG_VERSION
:
1.18
steps
:
steps
:
-
uses
:
actions/checkout@v3
-
uses
:
actions/checkout@v3
...
...
dinky-cdc/dinky-cdc-core/src/main/java/org/dinky/cdc/mysql/MysqlCDCBuilder.java
View file @
61adf489
...
@@ -75,6 +75,10 @@ public class MysqlCDCBuilder extends AbstractCDCBuilder {
...
@@ -75,6 +75,10 @@ public class MysqlCDCBuilder extends AbstractCDCBuilder {
String
distributionFactorUpper
=
source
.
get
(
"chunk-key.even-distribution.factor.lower-bound"
);
String
distributionFactorUpper
=
source
.
get
(
"chunk-key.even-distribution.factor.lower-bound"
);
String
scanNewlyAddedTableEnabled
=
source
.
get
(
"scan.newly-added-table.enabled"
);
String
scanNewlyAddedTableEnabled
=
source
.
get
(
"scan.newly-added-table.enabled"
);
String
schemaChanges
=
source
.
get
(
"schema.changes"
);
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
();
Properties
debeziumProperties
=
new
Properties
();
...
@@ -125,9 +129,30 @@ public class MysqlCDCBuilder extends AbstractCDCBuilder {
...
@@ -125,9 +129,30 @@ public class MysqlCDCBuilder extends AbstractCDCBuilder {
case
"initial"
:
case
"initial"
:
sourceBuilder
.
startupOptions
(
StartupOptions
.
initial
());
sourceBuilder
.
startupOptions
(
StartupOptions
.
initial
());
break
;
break
;
case
"earliest-offset"
:
sourceBuilder
.
startupOptions
(
StartupOptions
.
earliest
());
break
;
case
"latest-offset"
:
case
"latest-offset"
:
sourceBuilder
.
startupOptions
(
StartupOptions
.
latest
());
sourceBuilder
.
startupOptions
(
StartupOptions
.
latest
());
break
;
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
:
default
:
}
}
}
else
{
}
else
{
...
...
dinky-flink/dinky-flink-1.18/pom.xml
View file @
61adf489
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<properties>
<properties>
<commons.version>
1.3.1
</commons.version>
<commons.version>
1.3.1
</commons.version>
<flink.shaded.version>
17.0
</flink.shaded.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>
<flinkcdc.version>
3.0.1
</flinkcdc.version>
</properties>
</properties>
...
...
pom.xml
View file @
61adf489
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
<druid-starter>
1.2.8
</druid-starter>
<druid-starter>
1.2.8
</druid-starter>
<easy.rules.version>
4.1.0
</easy.rules.version>
<easy.rules.version>
4.1.0
</easy.rules.version>
<fastjson2.version>
2.0.41
</fastjson2.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>
<guava.version>
32.1.3-jre
</guava.version>
<h2database.version>
1.4.200
</h2database.version>
<h2database.version>
1.4.200
</h2database.version>
<hamcrest.version>
1.3
</hamcrest.version>
<hamcrest.version>
1.3
</hamcrest.version>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment