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
c0309793
Commit
c0309793
authored
Dec 02, 2024
by
y1sa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复已知问题
parent
4ffd7dd5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
20 deletions
+2
-20
ChangeListener.java
...rc/main/java/com/tbyf/cdcengine2/core/ChangeListener.java
+0
-18
DefaultChangeEventAdapter.java
...a/com/tbyf/cdcengine2/core/DefaultChangeEventAdapter.java
+2
-2
No files found.
core/src/main/java/com/tbyf/cdcengine2/core/ChangeListener.java
deleted
100644 → 0
View file @
4ffd7dd5
package
com
.
tbyf
.
cdcengine2
.
core
;
public
interface
ChangeListener
{
default
boolean
supportsSchema
(
String
schema
)
{
return
true
;
}
default
boolean
supportsTable
(
String
table
)
{
return
true
;
}
default
boolean
supports
(
String
schema
,
String
table
)
{
return
supportsSchema
(
schema
)
&&
supportsTable
(
table
);
}
void
onChange
(
ChangedRecord
record
);
}
core/src/main/java/com/tbyf/cdcengine2/core/DefaultChangeEventAdapter.java
View file @
c0309793
...
@@ -69,7 +69,7 @@ public class DefaultChangeEventAdapter implements ChangeEventAdapter {
...
@@ -69,7 +69,7 @@ public class DefaultChangeEventAdapter implements ChangeEventAdapter {
if
(
field
.
schema
().
type
()
==
Schema
.
Type
.
STRUCT
)
{
if
(
field
.
schema
().
type
()
==
Schema
.
Type
.
STRUCT
)
{
Struct
structValue
=
(
Struct
)
value
;
Struct
structValue
=
(
Struct
)
value
;
// 处理小数类型
// 处理小数类型
if
(
field
.
schema
().
name
().
equals
(
VariableScaleDecimal
.
class
.
getN
ame
()))
{
if
(
VariableScaleDecimal
.
class
.
getName
().
equals
(
field
.
schema
().
n
ame
()))
{
value
=
new
BigDecimal
(
new
BigInteger
(
structValue
.
getBytes
(
VariableScaleDecimal
.
VALUE_FIELD
)),
value
=
new
BigDecimal
(
new
BigInteger
(
structValue
.
getBytes
(
VariableScaleDecimal
.
VALUE_FIELD
)),
structValue
.
getInt32
(
VariableScaleDecimal
.
SCALE_FIELD
));
structValue
.
getInt32
(
VariableScaleDecimal
.
SCALE_FIELD
));
}
}
...
@@ -77,7 +77,7 @@ public class DefaultChangeEventAdapter implements ChangeEventAdapter {
...
@@ -77,7 +77,7 @@ public class DefaultChangeEventAdapter implements ChangeEventAdapter {
if
(
field
.
schema
().
type
()
==
Schema
.
Type
.
INT64
)
{
if
(
field
.
schema
().
type
()
==
Schema
.
Type
.
INT64
)
{
Long
longValue
=
(
Long
)
value
;
Long
longValue
=
(
Long
)
value
;
// 处理时间类型
// 处理时间类型
if
(
field
.
schema
().
name
().
equals
(
Timestamp
.
class
.
getN
ame
()))
{
if
(
Timestamp
.
class
.
getName
().
equals
(
field
.
schema
().
n
ame
()))
{
value
=
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
longValue
),
ZoneOffset
.
UTC
);
value
=
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
longValue
),
ZoneOffset
.
UTC
);
}
}
}
}
...
...
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