[
https://issues.apache.org/jira/browse/SCB-755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16547524#comment-16547524
]
ASF GitHub Bot commented on SCB-755:
------------------------------------
liubao68 commented on a change in pull request #818: [SCB-755] 755 Duplicate
copy cse config to Servicecomb config
URL:
https://github.com/apache/incubator-servicecomb-java-chassis/pull/818#discussion_r203287198
##########
File path:
foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigUtil.java
##########
@@ -161,31 +162,42 @@ public static AbstractConfiguration
convertEnvVariable(AbstractConfiguration sou
return source;
}
- //inject a copy of servicecomb.xxx for cse.xxx
+ //主要是为了兼容老的版本
private static void duplicateCseConfigToServicecomb(AbstractConfiguration
source) {
- Iterator<String> keys = source.getKeys();
- while (keys.hasNext()) {
- String key = keys.next();
- if (!key.startsWith(CONFIG_CSE_PREFIX)) {
- continue;
- }
+ duplicateCseConfigToServicecombWithSourceName(source, DEFAULT_SOURCE_NAME);
+ }
+
- String servicecombKey = CONFIG_SERVICECOMB_PREFIX +
key.substring(key.indexOf(".") + 1);
- if (!source.containsKey(servicecombKey)) {
- source.addProperty(servicecombKey, source.getProperty(key));
- } else {
- LOGGER
- .warn(
- "Key {} with an ambiguous item {} exists, it's recommended to
use only one of them.",
- key, servicecombKey);
+ //inject a copy of servicecomb.xxx for cse.xxx
+ private static void
duplicateCseConfigToServicecombWithSourceName(AbstractConfiguration
source,String sourceName) {
Review comment:
This parameter is better to use boolean to indicate if need to duplicate
(yaml file has already duplicated, so no need to duplicate)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [SCB-755] 755 Duplicate copy cse config to Servicecomb config
> -------------------------------------------------------------
>
> Key: SCB-755
> URL: https://issues.apache.org/jira/browse/SCB-755
> Project: Apache ServiceComb
> Issue Type: Improvement
> Components: Java-Chassis
> Reporter: 何一乐
> Priority: Minor
>
> [main ] WARN Key cse.tcc.transaction.redis.host with an ambiguous
> item servicecomb.tcc.transaction.redis.host exists, it's recommended to use
> only one of them.
> [org.apache.servicecomb.config.ConfigUtil.duplicateCseConfigToServicecomb(ConfigUtil.java:178)]
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)