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

optimize: Refactor configuration #5285

Draft
wants to merge 76 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
a457da1
重构 `config` 模块。
wangliang181230 Jan 31, 2023
f246d4f
添加一个默认配置源读取的实现。
wangliang181230 Jan 31, 2023
06183f0
添加默认值从Property object中读取的默认值配置源实现。
wangliang181230 Jan 31, 2023
9e5cd48
优化代码。重命名部分类。
wangliang181230 Jan 31, 2023
5a357d7
解决部分问题,优化部分日志。
wangliang181230 Jan 31, 2023
e9f1c61
配置监听相关的功能开发。使 DefaultConfiguration 成为一个可以协调 配置源 和 监听者 的存在。
wangliang181230 Feb 1, 2023
f1104c8
小调整。
wangliang181230 Feb 1, 2023
cd4cd10
调整日志,引用jsr305
wangliang181230 Feb 1, 2023
ba6720a
移除依赖byte-buddy
wangliang181230 Feb 1, 2023
b1fd06d
1)拆分 DefaultConfiguration 为 CacheableConfiguration 和 SeataConfiguration.
wangliang181230 Feb 1, 2023
8442010
Merge remote-tracking branch 'upstream/develop' into refactor-configu…
wangliang181230 Feb 1, 2023
9a0c67a
日志调整。
wangliang181230 Feb 1, 2023
8c23ca9
1)添加接口方法:Initialize.isInitialized();
wangliang181230 Feb 1, 2023
2aecc36
调整接口和实现关系。
wangliang181230 Feb 2, 2023
c560de2
重构代码。
wangliang181230 Feb 2, 2023
3289405
小调整。
wangliang181230 Feb 2, 2023
77a9097
Merge remote-tracking branch 'upstream/develop' into refactor-configu…
wangliang181230 Feb 2, 2023
d7a96c9
小调整。
wangliang181230 Feb 2, 2023
4a54804
小调整。
wangliang181230 Feb 2, 2023
c4c22d6
fix style
wangliang181230 Feb 2, 2023
11af492
修复配置值为blank时的问题。
wangliang181230 Feb 2, 2023
c98b7d7
重构缓存层。简化缓存嵌套层次。
wangliang181230 Feb 2, 2023
c3a8957
小调整。
wangliang181230 Feb 2, 2023
0c838b3
小调整。
wangliang181230 Feb 2, 2023
8ce480c
小调整。
wangliang181230 Feb 2, 2023
62aa862
小调整。
wangliang181230 Feb 2, 2023
995e81a
小调整。
wangliang181230 Feb 2, 2023
ad2449b
小调整。
wangliang181230 Feb 2, 2023
2c841ed
小调整。
wangliang181230 Feb 2, 2023
fba092f
小调整。
wangliang181230 Feb 2, 2023
68765a2
开发 ScheduledUpdateConfigSource及其抽象类,用于SystemPropertyConfigSource
wangliang181230 Feb 3, 2023
04f4863
BUG修复。
wangliang181230 Feb 3, 2023
26c8923
优化 AbstractScheduledUpdateConfigSource,考虑要先初始化 latestConfigCacheMap
wangliang181230 Feb 3, 2023
d2c109a
fix style
wangliang181230 Feb 3, 2023
dd7bb40
Merge remote-tracking branch 'upstream/develop' into refactor-configu…
wangliang181230 Feb 3, 2023
8dd782e
Merge remote-tracking branch 'upstream/develop' into temp
wangliang181230 Feb 3, 2023
137549e
Merge branch 'temp' into refactor-configuration
wangliang181230 Feb 3, 2023
7d84d11
优化!目前还存在一个问题,接收配置变更后,实际的配置值未获取,需要获取。另外,配置源的优先级有待处理。
wangliang181230 Feb 3, 2023
e8aa97e
revert build.yml
wangliang181230 Feb 3, 2023
8d66e35
revert build.yml
wangliang181230 Feb 3, 2023
18fa8a0
优化部分代码。
wangliang181230 Feb 6, 2023
0c11a2a
小调整。
wangliang181230 Feb 6, 2023
0588c28
1)ConfigSource 增加 getOrder() 方法,用于排序。
wangliang181230 Feb 6, 2023
60ce740
修复BUG
wangliang181230 Feb 6, 2023
669fae8
添加 ConfigCacheChangeEvent
wangliang181230 Feb 6, 2023
87d97ec
Merge branch 'develop' into refactor-configuration
wangliang181230 Feb 6, 2023
4094cef
1)初步拆分 Configuration 接口;
wangliang181230 Feb 6, 2023
ee495e8
小调整。
wangliang181230 Feb 6, 2023
7d9d68f
小调整。
wangliang181230 Feb 6, 2023
e7d7810
将 AbstractConfiguration 的方法转换到 Configuration 中。
wangliang181230 Feb 6, 2023
37200de
引入jsr305
wangliang181230 Feb 6, 2023
6f4bd76
小调整。
wangliang181230 Feb 6, 2023
08f7bd9
小调整。
wangliang181230 Feb 6, 2023
aeb5fa8
小调整。
wangliang181230 Feb 6, 2023
60f16ed
异常信息小调整。
wangliang181230 Feb 7, 2023
813a8a5
异常信息小调整。
wangliang181230 Feb 7, 2023
15be692
优化代码。
wangliang181230 Feb 7, 2023
b75558e
优化代码。
wangliang181230 Feb 7, 2023
ef0810d
重命名方法。
wangliang181230 Feb 7, 2023
ade15a5
重命名方法。
wangliang181230 Feb 7, 2023
bd5617c
优化。
wangliang181230 Feb 7, 2023
8d84abf
小调整。
wangliang181230 Feb 7, 2023
980a86a
小调整。
wangliang181230 Feb 7, 2023
193e547
小调整。
wangliang181230 Feb 7, 2023
c772a7f
Merge branch 'develop' into rename-method-getConfig-to-getString
wangliang181230 Feb 7, 2023
c3ffb28
Merge branch 'develop' into rename-method-getConfig-to-getString
wangliang181230 Feb 7, 2023
418c9d5
Merge branch 'develop' into refactor-configuration
wangliang181230 Feb 7, 2023
6f3bf61
Merge branch 'develop' into rename-method-getConfig-to-getString
wangliang181230 Feb 9, 2023
078917e
Merge branch 'develop' into refactor-configuration
wangliang181230 Feb 9, 2023
5c90321
移除DefaultConfigManager。合并到ConfigSourceManager中。
wangliang181230 Feb 9, 2023
aad817f
Merge remote-tracking branch 'origin/rename-method-getConfig-to-getSt…
wangliang181230 Feb 9, 2023
972beda
fix style
wangliang181230 Feb 9, 2023
a99bb30
Merge remote-tracking branch 'upstream/develop' into refactor-configu…
wangliang181230 Mar 16, 2023
8b31419
remove import
wangliang181230 Mar 16, 2023
561b1ed
optimize test
wangliang181230 Mar 16, 2023
73bb724
Merge branch 'develop' into refactor-configuration
xingfudeshi Jun 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions common/src/main/java/io/seata/common/DefaultValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package io.seata.common;

import java.time.Duration;

/**
* @author [email protected]
*/
Expand Down Expand Up @@ -168,17 +166,17 @@ public interface DefaultValues {
/**
* the constant DEFAULT_RPC_RM_REQUEST_TIMEOUT
*/
long DEFAULT_RPC_RM_REQUEST_TIMEOUT = Duration.ofSeconds(15).toMillis();
long DEFAULT_RPC_RM_REQUEST_TIMEOUT = 15 * 1000L;

/**
* the constant DEFAULT_RPC_TM_REQUEST_TIMEOUT
*/
long DEFAULT_RPC_TM_REQUEST_TIMEOUT = Duration.ofSeconds(30).toMillis();
long DEFAULT_RPC_TM_REQUEST_TIMEOUT = 30 * 1000L;

/**
* the constant DEFAULT_RPC_TC_REQUEST_TIMEOUT
*/
long DEFAULT_RPC_TC_REQUEST_TIMEOUT = Duration.ofSeconds(15).toMillis();
long DEFAULT_RPC_TC_REQUEST_TIMEOUT = 15 * 1000L;

/**
* the constant DEFAULT_XAER_NOTA_RETRY_TIMEOUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
* @author slievrly
*/
public enum FrameworkErrorCode {

/**
* The Config not found error.
*/
ConfigNotFoundError("0001", "Config not found", "Please check your configuration"),

/**
* The Config invalid error.
*/
ConfigInvalidError("0002", "Config is invalid", "Please check your configuration"),

/**
* 0001 ~ 0099 Configuration related errors
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright 1999-2019 Seata.io Group.
*
* Licensed 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.common.executor;

/**
* The type Abstract initialize.
*
* @author wang.liang
*/
public abstract class AbstractInitialize implements Initialize {

/**
* Whether initialized
*/
private volatile boolean initialized = false;


//region # Override Initialize

@Override
public boolean isInitialized() {
return initialized;
}

protected void setInitialized(boolean initialized) {
this.initialized = initialized;
}

//endregion # Override Initialize
}
38 changes: 38 additions & 0 deletions common/src/main/java/io/seata/common/executor/Cacheable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 1999-2019 Seata.io Group.
*
* Licensed 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.common.executor;

/**
* The interface Cacheable.
*
* @author wang.liang
*/
public interface Cacheable {

/**
* Remove cache by key.
*
* @param key the cache key
* @return the removed cache.
*/
Object removeCache(String key);

/**
* Clean the caches.
*/
void cleanCaches();
}

27 changes: 27 additions & 0 deletions common/src/main/java/io/seata/common/executor/Cleanable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 1999-2019 Seata.io Group.
*
* Licensed 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.common.executor;

/**
* The interface Cleanable
*
* @author wang.liang
*/
public interface Cleanable {

void clean();

}
7 changes: 7 additions & 0 deletions common/src/main/java/io/seata/common/executor/Initialize.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ public interface Initialize {
*/
void init();

/**
* whether initialized
*
* @return the boolean
*/
boolean isInitialized();

}
Loading