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

refactor: Replace tableMetaCache and undoLogManager with SPI #2055

Merged
merged 21 commits into from
Jan 19, 2020

Conversation

ph3636
Copy link
Contributor

@ph3636 ph3636 commented Dec 18, 2019

Ⅰ. Describe what this PR did

Replace with SPI

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-io
Copy link

codecov-io commented Dec 18, 2019

Codecov Report

Merging #2055 into develop will decrease coverage by 0.19%.
The diff coverage is 34.05%.

Impacted file tree graph

@@             Coverage Diff              @@
##             develop    #2055     +/-   ##
============================================
- Coverage      54.52%   54.32%   -0.2%     
- Complexity      2471     2492     +21     
============================================
  Files            446      454      +8     
  Lines          14717    14880    +163     
  Branches        1729     1753     +24     
============================================
+ Hits            8024     8084     +60     
- Misses          5937     6025     +88     
- Partials         756      771     +15
Impacted Files Coverage Δ Complexity Δ
...o/seata/saga/statelang/domain/DomainConstants.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...ava/io/seata/core/constants/ConfigurationKeys.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...g/annotation/datasource/DataSourceProxyHolder.java 0% <ø> (ø) 0 <0> (ø) ⬇️
.../seata/integration/http/HttpAutoConfiguration.java 0% <0%> (ø) 0 <0> (?)
...ation/datasource/AutoDataSourceProxyRegistrar.java 0% <0%> (ø) 0 <0> (?)
...n/datasource/SeataDataSourceBeanPostProcessor.java 0% <0%> (ø) 0 <0> (?)
...src/main/java/io/seata/server/ParameterParser.java 44.68% <0%> (-2.13%) 11 <1> (ø)
...in/java/io/seata/integration/http/XidResource.java 0% <0%> (ø) 0 <0> (?)
...ration/http/TransactionPropagationIntercepter.java 0% <0%> (ø) 0 <0> (?)
...integration/http/HttpHandlerExceptionResolver.java 0% <0%> (ø) 0 <0> (?)
... and 18 more

@zjinlei
Copy link
Contributor

zjinlei commented Dec 18, 2019

Thanks!
Coming soon 1.0, priority review after 1.0.

@zjinlei
Copy link
Contributor

zjinlei commented Dec 18, 2019

I hope you can join the seata development team, i8vx5rv is my DingTalk ID, please add friends.

@ph3636
Copy link
Contributor Author

ph3636 commented Dec 18, 2019

thanks, My pleasure

# Conflicts:
#	rm-datasource/src/main/java/io/seata/rm/datasource/AbstractConnectionProxy.java
#	rm-datasource/src/main/java/io/seata/rm/datasource/sql/struct/cache/MysqlTableMetaCache.java
#	rm-datasource/src/main/java/io/seata/rm/datasource/sql/struct/cache/OracleTableMetaCache.java
#	rm-datasource/src/main/java/io/seata/rm/datasource/undo/AbstractUndoLogManager.java
Copy link
Contributor

@zjinlei zjinlei left a comment

Choose a reason for hiding this comment

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

LGTM

@zjinlei zjinlei changed the title Refactor:Replace with SPI Refactor:Replace tableMetaCache and undoLogManager with SPI Dec 30, 2019
@zjinlei zjinlei changed the title Refactor:Replace tableMetaCache and undoLogManager with SPI refactor: Replace tableMetaCache and undoLogManager with SPI Dec 30, 2019
@zjinlei zjinlei added this to the 1.1.0 milestone Jan 2, 2020
ph3636 and others added 11 commits January 7, 2020 19:14
# Conflicts:
#	rm-datasource/src/main/java/io/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java
#	rm-datasource/src/main/java/io/seata/rm/datasource/undo/UndoExecutorFactory.java
#	rm-datasource/src/main/java/io/seata/rm/datasource/undo/UndoLogManagerFactory.java
#	rm-datasource/src/main/java/io/seata/rm/datasource/undo/oracle/OracleUndoLogManager.java
#	sqlparser/seata-sqlparser-druid/src/main/java/io/seata/sqlparser/druid/MySqlOperateRecognizerHolder.java
#	sqlparser/seata-sqlparser-druid/src/main/java/io/seata/sqlparser/druid/oracle/OracleOperateRecognizerHolder.java
# Conflicts:
#	sqlparser/seata-sqlparser-druid/src/main/java/io/seata/sqlparser/druid/mysql/MySQLOperateRecognizerHolder.java
@@ -288,7 +281,7 @@ public void undo(DataSourceProxy dataSourceProxy, String xid, long branchId) thr
Collections.reverse(sqlUndoLogs);
}
for (SQLUndoLog sqlUndoLog : sqlUndoLogs) {
TableMeta tableMeta = TableMetaCacheFactory.getTableMetaCache(dataSourceProxy).getTableMeta(
TableMeta tableMeta = TableMetaCacheFactory.getTableMetaCache(dataSourceProxy.getDbType()).getTableMeta(
Copy link
Member

Choose a reason for hiding this comment

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

dataSourceProxy.getDbType() return SqlParser.getDbType, but in other places is returned we define constants, whether there is the risk of inconsistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, there is a problem. It has been corrected

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

@slievrly slievrly merged commit eef2971 into apache:develop Jan 19, 2020
booogu pushed a commit to booogu/seata that referenced this pull request Feb 12, 2020
@ph3636 ph3636 deleted the ReplaceWithSPI branch March 9, 2020 04:00
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.

None yet

4 participants