-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
feature: Realize the interface of console: get global session and global lock in the db mode #4320
Conversation
1.readme.md添加一下pr记录; |
Codecov Report
@@ Coverage Diff @@
## develop #4320 +/- ##
=============================================
- Coverage 48.44% 48.27% -0.18%
- Complexity 3965 3969 +4
=============================================
Files 733 734 +1
Lines 25163 25277 +114
Branches 3086 3105 +19
=============================================
+ Hits 12191 12202 +11
- Misses 11658 11760 +102
- Partials 1314 1315 +1
|
# Conflicts: # changes/en-us/1.5.0.md
# Conflicts: # changes/1.5.0.md # changes/en-us/1.5.0.md # server/src/main/java/io/seata/server/console/controller/GlobalLockController.java # server/src/main/java/io/seata/server/console/controller/GlobalSessionController.java
This pull request fixes 6 alerts when merging 2f127c6 into 3993984 - view on LGTM.com fixed alerts:
|
server/src/main/java/io/seata/server/console/impl/db/BranchSessionDBServiceImpl.java
Outdated
Show resolved
Hide resolved
default: | ||
throw new NotSupportYetException("PageUtil not support this dbType:" + dbType); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个抽一下是不是好点
public static final List<String> SUPPORT_DB = Arrays.asList("mysql", "h2","postgresql","oceanbase","oracle");
public static String countSql(String sourceSql, String dbType) {
if(SUPPORT_DB.contains(dbType)){
return sourceSql.replaceAll("(?i)(?<=select)(.*)(?=from)", " count(1) ");
}else {
throw new NotSupportYetException("PageUtil not support this dbType:" + dbType);
}
}
server/src/main/java/io/seata/server/console/controller/GlobalSessionController.java
Show resolved
Hide resolved
*/ | ||
public static final String XID_PLACEHOLD = " #xid# "; | ||
public static final String WHERE_PLACEHOLD = " #where# "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些place hold要不要抽个类出来?现在已经有两个类都有 #where# 了
server/src/main/java/io/seata/server/console/impl/db/GlobalSessionDBServiceImpl.java
Outdated
Show resolved
Hide resolved
# Conflicts: # changes/1.5.0.md # changes/en-us/1.5.0.md # server/src/main/java/io/seata/server/console/controller/GlobalLockController.java # server/src/main/java/io/seata/server/console/controller/GlobalSessionController.java
This pull request fixes 6 alerts when merging 9b560f5 into ca8ff3f - view on LGTM.com fixed alerts:
|
server/src/main/java/io/seata/server/console/impl/db/GlobalLockDBServiceImpl.java
Show resolved
Hide resolved
server/src/main/java/io/seata/server/console/impl/db/BranchSessionDBServiceImpl.java
Outdated
Show resolved
Hide resolved
server/src/main/java/io/seata/server/console/impl/db/GlobalSessionDBServiceImpl.java
Outdated
Show resolved
Hide resolved
lock和session里有部分代码可以公用,是否可以考虑抽取一下。 |
# Conflicts: # changes/1.5.0.md # changes/en-us/1.5.0.md # core/src/main/java/io/seata/core/console/result/PageResult.java
This pull request fixes 6 alerts when merging 06f4344 into 4622746 - view on LGTM.com fixed alerts:
|
This pull request fixes 6 alerts when merging eff45fd into 4622746 - view on LGTM.com fixed alerts:
|
This pull request fixes 6 alerts when merging a226d1e into 4622746 - view on LGTM.com fixed alerts:
|
This pull request fixes 6 alerts when merging 20b4de8 into 16f0bfa - view on LGTM.com fixed alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
server/src/main/java/io/seata/server/console/impl/db/GlobalLockDBServiceImpl.java
Outdated
Show resolved
Hide resolved
# Conflicts: # changes/en-us/1.5.0.md
This pull request fixes 6 alerts when merging 23ae12c into 4c88984 - view on LGTM.com fixed alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request fixes 6 alerts when merging d3eb970 into 6fab0e8 - view on LGTM.com fixed alerts:
|
…bal lock in the db mode (apache#4320)
*/ | ||
public static String pageSql(String sourceSql, String dbType, int pageNum, int pageSize) { | ||
switch (dbType) { | ||
case "mysql": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
io.seata.core.constants.DBType
* @return the string | ||
*/ | ||
String getAllLockSQL(String lockTable, String tableName); | ||
String getAllLockSql(String lockTable, String whereCondition); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non compliance with design principles.
Ⅰ. Describe what this PR did
Realize the interface of console: get global session and global lock in the db mode
Ⅱ. Does this pull request fix one issue?
fixes #4256.
fixes #4257.