Skip to content
Snippets Groups Projects
Unverified Commit 36ebcb81 authored by 陈健斌's avatar 陈健斌 Committed by GitHub
Browse files

optimize: added interface to get current transaction role (#3533)

parent 2576e366
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单 ...@@ -25,7 +25,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#3427](https://github.com/seata/seata/pull/3427)] 添加分布式锁接口 - [[#3427](https://github.com/seata/seata/pull/3427)] 添加分布式锁接口
- [[#3443](https://github.com/seata/seata/pull/3443)] 将`seata-server`的日志发送到`logstash``kafka`中,再存入`ElasticSearch` - [[#3443](https://github.com/seata/seata/pull/3443)] 将`seata-server`的日志发送到`logstash``kafka`中,再存入`ElasticSearch`
- [[#3486](https://github.com/seata/seata/pull/3486)] Metrics增加事务分组属性 - [[#3486](https://github.com/seata/seata/pull/3486)] Metrics增加事务分组属性
### bugfix: ### bugfix:
...@@ -63,6 +63,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单 ...@@ -63,6 +63,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#3415](https://github.com/seata/seata/pull/3415)] 优化 maven clean 插件可清除 distribution 目录 - [[#3415](https://github.com/seata/seata/pull/3415)] 优化 maven clean 插件可清除 distribution 目录
- [[#3316](https://github.com/seata/seata/pull/3316)] 优化读取配置值时,属性bean可能未初始化 - [[#3316](https://github.com/seata/seata/pull/3316)] 优化读取配置值时,属性bean可能未初始化
- [[#3420](https://github.com/seata/seata/pull/3420)] 优化枚举类并添加单元测试 - [[#3420](https://github.com/seata/seata/pull/3420)] 优化枚举类并添加单元测试
- [[#3533](https://github.com/seata/seata/pull/3533)] 添加获取当前对应事务角色接口
- [[#3436](https://github.com/seata/seata/pull/3436)] 优化SQLType类中的错别字 - [[#3436](https://github.com/seata/seata/pull/3436)] 优化SQLType类中的错别字
- [[#3439](https://github.com/seata/seata/pull/3439)] 调整springApplicationContextProvider的顺序以使得他可以在xml的bean之前被调用 - [[#3439](https://github.com/seata/seata/pull/3439)] 调整springApplicationContextProvider的顺序以使得他可以在xml的bean之前被调用
- [[#3156](https://github.com/seata/seata/pull/3156)] 优化SpringProxyUtils.findTargetClass的逻辑 - [[#3156](https://github.com/seata/seata/pull/3156)] 优化SpringProxyUtils.findTargetClass的逻辑
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
- [[#3415](https://github.com/seata/seata/pull/3415)] optimize maven clean plugin to clear the distribution directory - [[#3415](https://github.com/seata/seata/pull/3415)] optimize maven clean plugin to clear the distribution directory
- [[#3316](https://github.com/seata/seata/pull/3316)] optimize the property bean may not be initialized while reading config value - [[#3316](https://github.com/seata/seata/pull/3316)] optimize the property bean may not be initialized while reading config value
- [[#3420](https://github.com/seata/seata/pull/3420)] optimize enumerated classes and add unit tests - [[#3420](https://github.com/seata/seata/pull/3420)] optimize enumerated classes and add unit tests
- [[#3533](https://github.com/seata/seata/pull/3533)] added interface to get current transaction role
- [[#3436](https://github.com/seata/seata/pull/3436)] optimize typo in SQLType class - [[#3436](https://github.com/seata/seata/pull/3436)] optimize typo in SQLType class
- [[#3439](https://github.com/seata/seata/pull/3439)] adjust the order of springApplicationContextProvider - [[#3439](https://github.com/seata/seata/pull/3439)] adjust the order of springApplicationContextProvider
- [[#3156](https://github.com/seata/seata/pull/3156)] optimize the logic of SpringProxyUtils.findTargetClass - [[#3156](https://github.com/seata/seata/pull/3156)] optimize the logic of SpringProxyUtils.findTargetClass
...@@ -77,11 +78,11 @@ ...@@ -77,11 +78,11 @@
### test ### test
- [[#3381](https://github.com/seata/seata/pull/3381)] test case for tmClient - [[#3381](https://github.com/seata/seata/pull/3381)] test case for tmClient
Thanks to these contributors for their code commits. Please report an unintended omission. Thanks to these contributors for their code commits. Please report an unintended omission.
...@@ -107,7 +108,7 @@ ...@@ -107,7 +108,7 @@
- [github-ganyu](https://github.com/github-ganyu) - [github-ganyu](https://github.com/github-ganyu)
- [xuande](https://github.com/xuande) - [xuande](https://github.com/xuande)
- [tanggen](https://github.com/tanggen) - [tanggen](https://github.com/tanggen)
Also, we receive many valuable issues, questions and advices from our community. Thanks for you all. Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
......
...@@ -20,6 +20,7 @@ import io.seata.core.exception.TransactionException; ...@@ -20,6 +20,7 @@ import io.seata.core.exception.TransactionException;
import io.seata.core.model.GlobalStatus; import io.seata.core.model.GlobalStatus;
import io.seata.saga.engine.sequence.SpringJvmUUIDSeqGenerator; import io.seata.saga.engine.sequence.SpringJvmUUIDSeqGenerator;
import io.seata.tm.api.GlobalTransaction; import io.seata.tm.api.GlobalTransaction;
import io.seata.tm.api.GlobalTransactionRole;
import io.seata.tm.api.transaction.SuspendedResourcesHolder; import io.seata.tm.api.transaction.SuspendedResourcesHolder;
/** /**
...@@ -102,4 +103,10 @@ public class MockGlobalTransaction implements GlobalTransaction { ...@@ -102,4 +103,10 @@ public class MockGlobalTransaction implements GlobalTransaction {
public GlobalStatus getLocalStatus() { public GlobalStatus getLocalStatus() {
return status; return status;
} }
@Override
public GlobalTransactionRole getGlobalTransactionRole() {
return null;
}
} }
...@@ -243,6 +243,11 @@ public class DefaultGlobalTransaction implements GlobalTransaction { ...@@ -243,6 +243,11 @@ public class DefaultGlobalTransaction implements GlobalTransaction {
return status; return status;
} }
@Override
public GlobalTransactionRole getGlobalTransactionRole() {
return role;
}
private void assertXIDNotNull() { private void assertXIDNotNull() {
if (xid == null) { if (xid == null) {
throw new IllegalStateException(); throw new IllegalStateException();
......
...@@ -123,4 +123,13 @@ public interface GlobalTransaction { ...@@ -123,4 +123,13 @@ public interface GlobalTransaction {
* @see GlobalStatus * @see GlobalStatus
*/ */
GlobalStatus getLocalStatus(); GlobalStatus getLocalStatus();
/**
* get global transaction role.
*
* @return global transaction Role.
* @see GlobalTransactionRole
*/
GlobalTransactionRole getGlobalTransactionRole();
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment