Skip to content

Commit

Permalink
Merge branch '2.x' into add_version_console
Browse files Browse the repository at this point in the history
  • Loading branch information
xingfudeshi committed Apr 1, 2024
2 parents e8c56ba + d318409 commit 487df04
Show file tree
Hide file tree
Showing 51 changed files with 364 additions and 245 deletions.
14 changes: 11 additions & 3 deletions changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,22 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6360](https://github.com/apache/incubator-seata/pull/6360)] optimize 401 issues for some links
- [[#6366](https://github.com/apache/incubator-seata/pull/6366)] optimized globaltransaction compatibility issues
- [[#6369](https://github.com/apache/incubator-seata/pull/6369)] optimize arm64 ci
- [[#6386](https://github.com/apache/incubator-seata/pull/6386)] replace `byte-buddy` to JDK proxy in `ConfigurationCache`
- [[#6386](https://github.com/apache/incubator-seata/pull/6386)] replace `byte-buddy` to JDK proxy
in `ConfigurationCache`
- [[#6391](https://github.com/apache/incubator-seata/pull/6091)] forbid duplicate registration of TCC resources
- [[#6393](https://github.com/apache/incubator-seata/pull/6393)] determine the version before sync metadata and add retry mechanism
- [[#6393](https://github.com/apache/incubator-seata/pull/6393)] determine the version before sync metadata and add
retry mechanism
- [[#6387](https://github.com/apache/incubator-seata/pull/6387)] optimize tcc use compatible
- [[#6402](https://github.com/apache/incubator-seata/pull/6402)] optimize rm-datasource use compatible
- [[#6417](https://github.com/apache/incubator-seata/pull/6417)] add version to the console banner
- [[#6419](https://github.com/apache/incubator-seata/pull/6419)] optimize integration-tx-api compatibl

### refactor:
- [[#6269](https://github.com/apache/incubator-seata/pull/6269)] standardize Seata Exception

- [[#6419](https://github.com/apache/incubator-seata/pull/6419)] optimize integration-tx-api compatible
- [[#6405](https://github.com/apache/incubator-seata/pull/6405)] fix kotlin compile failure
- [[#6412](https://github.com/apache/incubator-seata/pull/6412)] optimize core compatible module
- [[#6429](https://github.com/apache/incubator-seata/pull/6429)] remove repetitive words

### security:
- [[#6069](https://github.com/apache/incubator-seata/pull/6069)] Upgrade Guava dependencies to fix security vulnerabilities
Expand All @@ -138,7 +143,10 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6430](https://github.com/apache/incubator-seata/pull/6430)] increase common module unit test coverage

### refactor:

- [[#6280](https://github.com/apache/incubator-seata/pull/6280)] refactor Saga designer using diagram-js
- [[#6269](https://github.com/apache/incubator-seata/pull/6269)] standardize Seata Exception
- [[#6420](https://github.com/apache/incubator-seata/pull/6420)] refactor Configuration Cache

Thanks to these contributors for their code commits. Please report an unintended omission.

Expand Down
10 changes: 6 additions & 4 deletions changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,9 @@
- [[#6402](https://github.com/apache/incubator-seata/pull/6402)] 优化rm-datasource向下兼容
- [[#6417](https://github.com/apache/incubator-seata/pull/6417)] 控制台banner添加版本号
- [[#6419](https://github.com/apache/incubator-seata/pull/6419)] 优化integration-tx-api向下兼容


### refactor:
- [[#6269](https://github.com/apache/incubator-seata/pull/6269)] 统一Seata异常规范
- [[#6405](https://github.com/apache/incubator-seata/pull/6405)] 修复 kotlin 编译失败
- [[#6412](https://github.com/apache/incubator-seata/pull/6412)] 优化 core 兼容模块
- [[#6429](https://github.com/apache/incubator-seata/pull/6429)] 移除重复注释

### security:
- [[#6069](https://github.com/apache/incubator-seata/pull/6069)] 升级Guava依赖版本,修复安全漏洞
Expand All @@ -140,7 +139,10 @@
- [[#6430](https://github.com/apache/incubator-seata/pull/6430)] 增加 common 模块单元测试覆盖率

### refactor:

- [[#6280](https://github.com/apache/incubator-seata/pull/6280)] 使用diagram-js重构Saga设计器
- [[#6269](https://github.com/apache/incubator-seata/pull/6269)] 统一Seata异常规范
- [[#6420](https://github.com/apache/incubator-seata/pull/6420)] 优化配置缓存

非常感谢以下 contributors 的代码贡献。若有无意遗漏,请报告。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

/**
* The type AuthSigner
* Notes: used for io.seata SPI interface
*/
public interface AuthSigner extends org.apache.seata.core.auth.AuthSigner {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/**
* The type Compressor
*
* Notes: used for io.seata SPI interface
*/
public interface Compressor extends org.apache.seata.core.compressor.Compressor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@


/**
*
*
* The interface Context core.
*
* Notes: used for io.seata SPI interface
*/
public interface ContextCore extends org.apache.seata.core.context.ContextCore {
}
13 changes: 5 additions & 8 deletions compatible/src/main/java/io/seata/core/context/RootContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,18 @@
*/
package io.seata.core.context;

import io.seata.core.model.BranchType;
import java.util.Map;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Map;

import io.seata.core.model.BranchType;

/**
* The type Root context.
*/
public class RootContext {

private static org.apache.seata.core.model.BranchType convertApacheSeata(BranchType branchType) {
return org.apache.seata.core.model.BranchType.get(branchType.name());
}

private static BranchType convertIoSeata(org.apache.seata.core.model.BranchType branchType) {
return BranchType.get(branchType.name());
}
Expand All @@ -41,7 +38,7 @@ private static BranchType convertIoSeata(org.apache.seata.core.model.BranchType
* @param defaultBranchType the default branch type
*/
public static void setDefaultBranchType(BranchType defaultBranchType) {
org.apache.seata.core.context.RootContext.setDefaultBranchType(convertApacheSeata(defaultBranchType));
org.apache.seata.core.context.RootContext.setDefaultBranchType(defaultBranchType.convertBranchType());
}

/**
Expand Down Expand Up @@ -148,7 +145,7 @@ public static BranchType getBranchType() {
* @param branchType the branch type
*/
public static void bindBranchType(@Nonnull BranchType branchType) {
org.apache.seata.core.context.RootContext.bindBranchType(convertApacheSeata(branchType));
org.apache.seata.core.context.RootContext.bindBranchType(branchType.convertBranchType());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,25 @@
*/
package io.seata.core.exception;


/**
* The type Transaction exception.
*/
public class TransactionException extends org.apache.seata.core.exception.TransactionException {

private static org.apache.seata.core.exception.TransactionExceptionCode convertApacheSeataTransactionExceptionCode(TransactionExceptionCode transactionExceptionCode) {
return org.apache.seata.core.exception.TransactionExceptionCode.get(transactionExceptionCode.ordinal());
}

public TransactionException(TransactionExceptionCode code) {
super(convertApacheSeataTransactionExceptionCode(code));
super(code.convertTransactionExceptionCode());
}

public TransactionException(TransactionExceptionCode code, Throwable cause) {
super(convertApacheSeataTransactionExceptionCode(code), cause);
super(code.convertTransactionExceptionCode(), cause);
}

public TransactionException(String message) {
super(message);
}

public TransactionException(TransactionExceptionCode code, String message) {
super(convertApacheSeataTransactionExceptionCode(code), message);
super(code.convertTransactionExceptionCode(), message);
}

public TransactionException(Throwable cause) {
Expand All @@ -51,6 +46,6 @@ public TransactionException(String message, Throwable cause) {
}

public TransactionException(TransactionExceptionCode code, String message, Throwable cause) {
super(convertApacheSeataTransactionExceptionCode(code), message, cause);
super(code.convertTransactionExceptionCode(), message, cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,8 @@ public static TransactionExceptionCode get(int ordinal) {
return value;
}

public org.apache.seata.core.exception.TransactionExceptionCode convertTransactionExceptionCode() {
return org.apache.seata.core.exception.TransactionExceptionCode.get(this.ordinal());
}

}
4 changes: 4 additions & 0 deletions compatible/src/main/java/io/seata/core/model/BranchType.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,8 @@ public static BranchType get(String name) {
}
throw new IllegalArgumentException("Unknown BranchType[" + name + "]");
}

public org.apache.seata.core.model.BranchType convertBranchType() {
return org.apache.seata.core.model.BranchType.get(this.name());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,8 @@ public static boolean isTwoPhaseHeuristic(GlobalStatus status) {
}
return false;
}

public org.apache.seata.core.model.GlobalStatus convertGlobalStatus() {
return org.apache.seata.core.model.GlobalStatus.get(this.getCode());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.seata.core.rpc.netty;

/**
* RmNettyRemotingClient
* Notes: used for Apache ShardingSphere integration
*/
public class RmNettyRemotingClient {

private static final org.apache.seata.core.rpc.netty.RmNettyRemotingClient INSTANCE = org.apache.seata.core.rpc.netty.RmNettyRemotingClient.getInstance();

private static class RmNettyRemotingClientInstance {
private static final RmNettyRemotingClient INSTANCE = new RmNettyRemotingClient();
}

private RmNettyRemotingClient() {
}

public static RmNettyRemotingClient getInstance() {
return RmNettyRemotingClientInstance.INSTANCE;
}

public void destroy() {
INSTANCE.destroy();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.seata.core.rpc.netty;

/**
* TmNettyRemotingClient
* Notes: used for Apache ShardingSphere integration
*/
public class TmNettyRemotingClient {
private static final org.apache.seata.core.rpc.netty.TmNettyRemotingClient INSTANCE = org.apache.seata.core.rpc.netty.TmNettyRemotingClient.getInstance();

private static class TmNettyRemotingClientInstance {
private static final TmNettyRemotingClient INSTANCE = new TmNettyRemotingClient();
}

private TmNettyRemotingClient() {
}

public static TmNettyRemotingClient getInstance() {
return TmNettyRemotingClientInstance.INSTANCE;
}

public void destroy() {
INSTANCE.destroy();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/**
* The interface Codec.
*
* Notes: used for io.seata SPI interface
*/
public interface Serializer extends org.apache.seata.core.serializer.Serializer {
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* the database lock store sql interface
*
* @since 1.2.0
* Notes: used for io.seata SPI interface
*/
public interface LockStoreSql extends org.apache.seata.core.store.db.sql.lock.LockStoreSql {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@
*/
package io.seata.core.store.db.sql.log;

/**
* The interface Log store sqls.
* Notes: used for io.seata SPI interface
*/
public interface LogStoreSqls extends org.apache.seata.core.store.db.sql.log.LogStoreSqls {
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ public class DefaultGlobalTransaction implements GlobalTransaction {
* @param role the role
*/
DefaultGlobalTransaction(String xid, GlobalStatus status, GlobalTransactionRole role) {
this.instance = new org.apache.seata.tm.api.DefaultGlobalTransaction(xid, convertApacheSeataGlobalStatus(status), convertApacheSeataGlobalTransactionRole(role));
}

private static org.apache.seata.core.model.GlobalStatus convertApacheSeataGlobalStatus(GlobalStatus globalStatus) {
return org.apache.seata.core.model.GlobalStatus.get(globalStatus.getCode());
this.instance = new org.apache.seata.tm.api.DefaultGlobalTransaction(xid, status.convertGlobalStatus(),
convertApacheSeataGlobalTransactionRole(role));
}

private static GlobalStatus convertIoSeataGlobalStatus(org.apache.seata.core.model.GlobalStatus globalStatus) {
Expand Down Expand Up @@ -147,7 +144,7 @@ public String getXid() {
@Override
public void globalReport(GlobalStatus globalStatus) throws TransactionException {
try {
this.instance.globalReport(convertApacheSeataGlobalStatus(globalStatus));
this.instance.globalReport(globalStatus.convertGlobalStatus());
} catch (org.apache.seata.core.exception.TransactionException e) {
throw new TransactionException(TransactionExceptionCode.valueOf(e.getCode().name()), e.getMessage(), e.getCause());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void testNotSupportDb() {
dataSource.setPassword("password");

Throwable throwable = Assertions.assertThrows(IllegalStateException.class, () -> new DataSourceProxy(dataSource));
assertThat(throwable).hasMessageContaining("AT mode don't support the the dbtype");
assertThat(throwable).hasMessageContaining("AT mode don't support the dbtype");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import java.net.InetSocketAddress;
import java.util.Enumeration;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.Set;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
Expand Down Expand Up @@ -346,15 +346,15 @@ public void onChangeEvent(ConfigurationChangeEvent event) {
for (ConfigurationChangeListener changeListener : entry.getValue()) {
event.setDataId(key).setNewValue(valueNew);
ConfigurationChangeListener listener = ((ConsulListener) changeListener).getTargetListener();
listener.onChangeEvent(event);
listener.onProcessEvent(event);
}
}
}
seataConfig = seataConfigNew;
} else {
// The old config change listener,it would be deleted in next edition
event.setDataId(dataId).setNewValue(value);
listener.onChangeEvent(event);
listener.onProcessEvent(event);
}
}
}
Expand Down
Loading

0 comments on commit 487df04

Please sign in to comment.