Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cdc-engine2
Overview
Overview
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
黄营
cdc-engine2
Commits
b5077bd8
Commit
b5077bd8
authored
Dec 02, 2024
by
y1sa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复已知问题
parent
1cfb6b60
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
AbstractCdcEngine.java
...main/java/com/tbyf/cdcengine2/core/AbstractCdcEngine.java
+13
-0
BaseCdcEngineProperties.java
...ava/com/tbyf/cdcengine2/core/BaseCdcEngineProperties.java
+9
-0
No files found.
core/src/main/java/com/tbyf/cdcengine2/core/AbstractCdcEngine.java
View file @
b5077bd8
...
@@ -8,6 +8,8 @@ import org.slf4j.Logger;
...
@@ -8,6 +8,8 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Properties
;
import
java.util.Properties
;
...
@@ -45,7 +47,18 @@ public abstract class AbstractCdcEngine<T extends AbstractCdcEngine<T>> {
...
@@ -45,7 +47,18 @@ public abstract class AbstractCdcEngine<T extends AbstractCdcEngine<T>> {
private
Runnable
errorHandler
;
private
Runnable
errorHandler
;
private
static
void
safeDelete
(
String
file
)
{
try
{
Files
.
delete
(
Paths
.
get
(
file
));
}
catch
(
IOException
e
)
{
}
}
public
AbstractCdcEngine
(
BaseCdcEngineProperties
props
)
{
public
AbstractCdcEngine
(
BaseCdcEngineProperties
props
)
{
if
(
props
.
isDeleteCdcFile
())
{
safeDelete
(
props
.
getNamespace
()
+
"_his.dat"
);
safeDelete
(
props
.
getNamespace
()
+
"_off.dat"
);
}
debeziumProps
.
setProperty
(
Constants
.
DATABASE_HISTORY_FILE_FILENAME_PROP
,
props
.
getNamespace
()
+
"_his.dat"
);
debeziumProps
.
setProperty
(
Constants
.
DATABASE_HISTORY_FILE_FILENAME_PROP
,
props
.
getNamespace
()
+
"_his.dat"
);
debeziumProps
.
setProperty
(
Constants
.
OFFSET_STORAGE_FILE_FILENAME_PROP
,
props
.
getNamespace
()
+
"_off.dat"
);
debeziumProps
.
setProperty
(
Constants
.
OFFSET_STORAGE_FILE_FILENAME_PROP
,
props
.
getNamespace
()
+
"_off.dat"
);
debeziumProps
.
setProperty
(
"snapshot.mode"
,
"schema_only"
);
debeziumProps
.
setProperty
(
"snapshot.mode"
,
"schema_only"
);
...
...
core/src/main/java/com/tbyf/cdcengine2/core/BaseCdcEngineProperties.java
View file @
b5077bd8
...
@@ -7,6 +7,15 @@ public class BaseCdcEngineProperties {
...
@@ -7,6 +7,15 @@ public class BaseCdcEngineProperties {
private
int
port
;
private
int
port
;
private
String
username
;
private
String
username
;
private
String
password
;
private
String
password
;
private
boolean
deleteCdcFile
=
true
;
public
boolean
isDeleteCdcFile
()
{
return
deleteCdcFile
;
}
public
void
setDeleteCdcFile
(
boolean
deleteCdcFile
)
{
this
.
deleteCdcFile
=
deleteCdcFile
;
}
public
String
getNamespace
()
{
public
String
getNamespace
()
{
return
namespace
;
return
namespace
;
...
...
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