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

add jackson serialization #1133

Merged
merged 13 commits into from
Jun 5, 2019
Merged

add jackson serialization #1133

merged 13 commits into from
Jun 5, 2019

Conversation

jsbxyyx
Copy link
Member

@jsbxyyx jsbxyyx commented May 30, 2019

fix: #1116

@codecov-io
Copy link

codecov-io commented May 30, 2019

Codecov Report

Merging #1133 into develop will decrease coverage by <.01%.
The diff coverage is 37.73%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1133      +/-   ##
=============================================
- Coverage      41.93%   41.92%   -0.01%     
- Complexity      1385     1390       +5     
=============================================
  Files            246      247       +1     
  Lines          10248    10282      +34     
  Branches        1343     1346       +3     
=============================================
+ Hits            4297     4311      +14     
- Misses          5387     5408      +21     
+ Partials         564      563       -1
Impacted Files Coverage Δ Complexity Δ
.../datasource/undo/parser/FastjsonUndoLogParser.java 71.42% <0%> (ø) 3 <0> (ø) ⬇️
...va/io/seata/rm/datasource/undo/UndoLogManager.java 21.59% <18.18%> (+0.66%) 9 <1> (+1) ⬆️
...m/datasource/undo/parser/JacksonUndoLogParser.java 55.55% <55.55%> (ø) 4 <4> (?)
.../java/io/seata/rm/datasource/DataCompareUtils.java 72.3% <7.14%> (-11.91%) 24 <0> (ø)
...o/seata/rm/datasource/sql/struct/TableRecords.java 73.77% <77.77%> (+0.08%) 13 <1> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5afa229...63f6cbb. Read the comment docs.

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check sql type: timestamp date int(11) later

@zhangthen
Copy link
Contributor

There was a PR (#1125 ) about adding protostuff as the serializer of UndoLogParser. JSON is inefficient, is it necessary to add a jackson serialization ?

import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;
import java.sql.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forbid to use *

@@ -57,14 +55,6 @@ public static boolean isFieldEquals(Field f0, Field f1) {
if (f1.getValue() == null) {
return false;
} else {
int f0Type = f0.getType();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to temporarily keep fastjson, can you make a judgment?

# Conflicts:
#	rm-datasource/src/main/java/io/seata/rm/datasource/undo/UndoLogParserFactory.java
#	rm-datasource/src/main/resources/META-INF/services/io.seata.rm.datasource.undo.UndoLogParser
#	rm-datasource/src/test/java/io/seata/rm/datasource/undo/UndoLogParserFactoryTest.java
#	rm-datasource/src/test/java/io/seata/rm/datasource/undo/UndoLogParserProviderTest.java
@slievrly
Copy link
Member

slievrly commented Jun 4, 2019

Functional Verification: bigint(11), date, time, timestamp check ok.
CREATE TABLE test_jackson (
id int(11) NOT NULL AUTO_INCREMENT,
int_test bigint(11) DEFAULT NULL,
date_test date DEFAULT NULL,
time_test time DEFAULT NULL,
timespan_test timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8


@Override
public String getName() {
return "jackson";
Copy link
Member

@slievrly slievrly Jun 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constant like fastjson

@@ -187,6 +192,8 @@ public static void undo(DataSourceProxy dataSourceProxy, String xid, long branch
sqlUndoLog);
undoExecutor.executeOn(conn);
}
// remove serializer name
SERIALIZER_LOCAL.remove();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better add in finally block?

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@CoffeeLatte007 CoffeeLatte007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@slievrly slievrly merged commit b7bc37f into apache:develop Jun 5, 2019
nick-tan pushed a commit to nick-tan/seata that referenced this pull request Jul 12, 2019
@wangliang181230 wangliang181230 added this to the 0.7.* milestone Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mysql field type is datetime afterRecords not equals currentRecords
8 participants