-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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: optimize config compatible module #6403
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 2.x #6403 +/- ##
============================================
+ Coverage 50.19% 50.41% +0.21%
- Complexity 5232 5252 +20
============================================
Files 942 941 -1
Lines 33221 33279 +58
Branches 4022 4035 +13
============================================
+ Hits 16676 16777 +101
+ Misses 14938 14876 -62
- Partials 1607 1626 +19
|
compatible/src/main/java/io/seata/config/ConfigurationChangeEvent.java
Outdated
Show resolved
Hide resolved
9ab3e2f
to
963026f
Compare
# Conflicts: # changes/en-us/2.x.md # changes/zh-cn/2.x.md # compatible/src/main/java/io/seata/core/context/RootContext.java
# Conflicts: # changes/en-us/2.x.md # changes/zh-cn/2.x.md # compatible/src/main/java/io/seata/core/context/RootContext.java
b36c756
to
522563a
Compare
# Conflicts: # changes/en-us/2.x.md
* | ||
* | ||
* | ||
* Notes: used for io.seata SPI interface | ||
*/ |
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.
*/ | |
*/ | |
@Deprecated |
*/ | ||
public interface ConfigurationProvider extends org.apache.seata.config.ConfigurationProvider { | ||
public interface ConfigurationProvider { |
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 interface ConfigurationProvider { | |
@Deprecated | |
public interface ConfigurationProvider { |
* | ||
*/ | ||
public interface ExtConfigurationProvider extends org.apache.seata.config.ExtConfigurationProvider { | ||
public enum ConfigurationChangeType { |
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 enum ConfigurationChangeType { | |
@Deprecated | |
public enum ConfigurationChangeType { |
|
||
import org.apache.seata.common.thread.NamedThreadFactory; | ||
|
||
public interface ConfigurationChangeListener { |
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 interface ConfigurationChangeListener { | |
@Deprecated | |
public interface ConfigurationChangeListener { |
*/ | ||
package io.seata.config; | ||
|
||
public class ConfigurationChangeEvent { |
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 class ConfigurationChangeEvent { | |
@Deprecated | |
public class ConfigurationChangeEvent { |
import org.apache.seata.common.util.DurationUtil; | ||
import org.apache.seata.common.util.StringUtils; | ||
|
||
public abstract class AbstractConfiguration implements Configuration { |
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 abstract class AbstractConfiguration implements Configuration { | |
@Deprecated | |
public abstract class AbstractConfiguration implements Configuration { |
* /apache/shardingsphere/transaction/base/seata/at/SeataATShardingSphereTransactionManager.java | ||
* 2.EnhancedServiceLoader.load(ExtConfigurationProvider.class).provide(configuration) | ||
*/ | ||
public class FileConfiguration extends AbstractConfiguration { |
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 class FileConfiguration extends AbstractConfiguration { | |
@Deprecated | |
public class FileConfiguration extends AbstractConfiguration { |
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.
Based on the conclusions from the previous meeting, Deprecated annotations will be updated uniformly.
config/seata-config-core/src/main/java/org/apache/seata/config/ConfigurationFactory.java
Outdated
Show resolved
Hide resolved
} catch (Exception exx) { | ||
LOGGER.error("failed to load non-spring configuration :{}", exx.getMessage(), exx); | ||
} | ||
return ORIGIN_FILE_INSTANCE; |
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.
这里不应该返回ORIGIN_FILE_INSTANCE,更应该直接抛出异常提示,可以比较明确的判断问题
Here, instead of returning ORIGIN_FILE_INSTANCE, it would be more appropriate to directly throw an exception with a clear error message, allowing for a more straightforward identification of the issue.
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.
fixed
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.
An exception cannot be thrown here because the file mode does not go through SPI. I've broken down the previous logic a bit and extracted the assignment of default values to the outer logic, but overall, it remains consistent with what was there before.
config/seata-config-core/src/main/java/org/apache/seata/config/ConfigurationFactory.java
Outdated
Show resolved
Hide resolved
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
Ⅰ. Describe what this PR did
optimize config compatible module
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews