Skip to content

Commit

Permalink
Merge branch '2.x' into feature_support_shentong_database
Browse files Browse the repository at this point in the history
  • Loading branch information
funky-eyes authored Oct 8, 2024
2 parents 21a5b4a + 4bd9557 commit 45d379b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 31 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Build Status](https://github.com/apache/incubator-seata/workflows/build/badge.svg?branch=develop)](https://github.com/apache/incubator-seata/actions)
[![codecov](https://codecov.io/gh/apache/incubator-seata/graph/badge.svg?token=tbmHt2ZfxO)](https://codecov.io/gh/apache/incubator-seata)
[![license](https://img.shields.io/github/license/apache/incubator-seata.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![maven](https://img.shields.io/maven-central/v/io.apache/incubator-seata-parent?versionSuffix=2.0.0)](https://search.maven.org/search?q=io.seata)
[![maven](https://img.shields.io/maven-central/v/org.apache.seata/seata-all?versionSuffix=2.1.0)](https://central.sonatype.com/search?q=org.apache.seata%3Aseata-all)

## What is Seata?

Expand Down Expand Up @@ -82,24 +82,24 @@ For more details about principle and design, please go to [Seata wiki page](http

## Maven dependency

Depending on the scenario, choose one of the two dependencies: `io.seata:seata-all` or `io.seata:seata-spring-boot-starter`.
Depending on the scenario, choose one of the two dependencies: `org.apache.seata:seata-all` or `org.apache.seata:seata-spring-boot-starter`.
```xml
<properties>
<seata.version>2.0.0</seata.version>
<seata.version>2.1.0</seata.version>
</properties>

<dependencies>
<!--dependencies for non-SpringBoot application framework-->
<dependency>
<groupId>io.seata</groupId>
<groupId>org.apache.seata</groupId>
<artifactId>seata-all</artifactId>
<version>${seata.version}</version>
</dependency>

<!--If your project base on `Spring Boot`, you can directly use the following dependencies-->
<!--Notice: `seata-spring-boot-starter` has already included `seata-all` dependency-->
<dependency>
<groupId>io.seata</groupId>
<groupId>org.apache.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
<version>${seata.version}</version>
</dependency>
Expand Down Expand Up @@ -142,7 +142,7 @@ Contributors are welcomed to join the Seata project. Please check [CONTRIBUTING]
* [Seata Website](https://github.com/apache/incubator-seata.github.io) - Seata official website
* [Seata GoLang](https://github.com/apache/incubator-seata-go) - Seata GoLang client and server
* [Seata Samples](https://github.com/apache/incubator-seata-samples) - Samples for Seata
* [Seata GoLang Simples](https://github.com/apache/incubator-seata-go-samples) - Samples for Seata GoLang
* [Seata GoLang Samples](https://github.com/apache/incubator-seata-go-samples) - Samples for Seata GoLang
* [Seata K8s](https://github.com/apache/incubator-seata-k8s) - Seata integration with k8s
* [Seata CLI](https://github.com/apache/incubator-seata-ctl) - CLI tool for Seata

Expand Down
6 changes: 4 additions & 2 deletions changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6881](https://github.com/apache/incubator-seata/pull/6881)]support grpc

### bugfix:

- [[#6899](https://github.com/apache/incubator-seata/pull/6899)] fix file.conf read failed after package
- [[#6890](https://github.com/apache/incubator-seata/pull/6890)] fix designerJson to standardJson: subStateMachine compensateState cannot be recognized

### optimize:
- [[#6826](https://github.com/apache/incubator-seata/pull/6826)] remove the branch registration operation of the XA read-only transaction
Expand All @@ -18,6 +19,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6892](https://github.com/apache/incubator-seata/pull/6892)] upgrade npmjs version
- [[#6889](https://github.com/apache/incubator-seata/pull/6889)] Correct word spelling errors
- [[#6898](https://github.com/apache/incubator-seata/pull/6898)] upgrade npmjs version in saga module
- [[#6902](https://github.com/apache/incubator-seata/pull/6900)] optimize readme docs


### refactor:
Expand All @@ -36,8 +38,8 @@ Thanks to these contributors for their code commits. Please report an unintended
- [dk2k](https://github.com/dk2k)
- [MaoMaoandSnail](https://github.com/MaoMaoandSnail)
- [yougecn](https://github.com/yougecn)
- [xjlgod](https://github.com/xjlgod)
- [PleaseGiveMeTheCoke](https://github.com/PleaseGiveMeTheCoke)



Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
7 changes: 5 additions & 2 deletions changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
[[#6881](https://github.com/apache/incubator-seata/pull/6881)]全链路支持grpc

### bugfix:

- [[#6899](https://github.com/apache/incubator-seata/pull/6899)] 修复file.conf打包后的读取
- [[#6890](https://github.com/apache/incubator-seata/pull/6890)] 修复saga设计json转标准json过程中: 子状态机补偿节点无法被识别

### optimize:
- [[#6826](https://github.com/apache/incubator-seata/pull/6826)] 移除只读XA事务的分支注册操作
Expand All @@ -17,7 +18,8 @@
- [[#6883](https://github.com/apache/incubator-seata/pull/6874)] 删除代码中无用对象的创建
- [[#6892](https://github.com/apache/incubator-seata/pull/6892)] 升级 npmjs 版本
- [[#6889](https://github.com/apache/incubator-seata/pull/6889)] 修正单词拼写错误
- [[#6898](https://github.com/apache/incubator-seata/pull/6898)] 升级 saga 模块 npmjs 版本
- [[#6898](https://github.com/apache/incubator-seata/pull/6898)] 升级 saga 模块 npmjs 版本
- [[#6902](https://github.com/apache/incubator-seata/pull/6900)] 优化 readme 文档

### refactor:

Expand All @@ -36,6 +38,7 @@
- [dk2k](https://github.com/dk2k)
- [MaoMaoandSnail](https://github.com/MaoMaoandSnail)
- [yougecn](https://github.com/yougecn)
- [xjlgod](https://github.com/xjlgod)
- [PleaseGiveMeTheCoke](https://github.com/PleaseGiveMeTheCoke)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,22 @@
*/
package org.apache.seata.config;

import org.apache.commons.lang.ObjectUtils;
import org.apache.seata.common.thread.NamedThreadFactory;
import org.apache.seata.common.util.CollectionUtils;
import org.apache.seata.common.util.StringUtils;
import org.apache.seata.config.ConfigFuture.ConfigOperation;
import org.apache.seata.config.file.FileConfig;

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
Expand All @@ -32,15 +41,8 @@
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import org.apache.seata.common.thread.NamedThreadFactory;
import org.apache.seata.common.util.CollectionUtils;
import org.apache.seata.common.util.StringUtils;
import org.apache.seata.config.ConfigFuture.ConfigOperation;
import org.apache.seata.config.file.FileConfig;
import org.apache.commons.lang.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* The type FileConfiguration.
*
Expand Down Expand Up @@ -134,7 +136,6 @@ private File getConfigFile(String name) {
boolean filePathCustom = name.startsWith(SYS_FILE_RESOURCE_PREFIX);
String filePath = filePathCustom ? name.substring(SYS_FILE_RESOURCE_PREFIX.length()) : name;
String decodedPath = URLDecoder.decode(filePath, StandardCharsets.UTF_8.name());

File targetFile = getFileFromFileSystem(decodedPath);
if (targetFile != null) {
return targetFile;
Expand All @@ -157,21 +158,18 @@ private File getFileFromFileSystem(String decodedPath) {

// run with jar file and not package third lib into jar file, this.getClass().getClassLoader() will be null
URL resourceUrl = this.getClass().getClassLoader().getResource("");
String[] tryPaths = null;
// try to get log dir (spring.config.additional-location) after package and run sh or bat in bin dir
String configLocation = System.getProperty("spring.config.additional-location");
List<String> tryPathsList = new ArrayList<>();
tryPathsList.add(decodedPath);
if (resourceUrl != null) {
tryPaths = new String[]{
// first: project dir
resourceUrl.getPath() + decodedPath,
// second: system path
decodedPath
};
} else {
tryPaths = new String[]{
decodedPath
};
tryPathsList.add(resourceUrl.getPath() + decodedPath);
}
if (configLocation != null) {
tryPathsList.add(configLocation + decodedPath);
}


String[] tryPaths = tryPathsList.toArray(new String[0]);
for (String tryPath : tryPaths) {
File targetFile = new File(tryPath);
if (targetFile.exists()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private static void transformEdge(Map<String, Object> machineJsonObject, List<Ob
machineJsonObject.put("StartState", targetStateId);
//Make sure 'StartState' is before 'States'
machineJsonObject.put("States", machineJsonObject.remove("States"));
} else if ("ServiceTask".equals(sourceType)) {
} else if ("ServiceTask".equals(sourceType) || "SubStateMachine".equals(sourceType)) {
if (targetNode != null && "Compensation".equals(targetNode.get("stateType"))) {
sourceState.put("CompensateState", targetStateId);
} else {
Expand Down

0 comments on commit 45d379b

Please sign in to comment.