You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/04/22 13:37:41 UTC

[GitHub] [servicecomb-java-chassis] develpoerX opened a new pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

develpoerX opened a new pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358


   …is printed automatically according to the component type
   
   Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
    - [ ] Each commit in the pull request should have a meaningful subject line and body.
    - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [ ] Run `mvn clean install -Pit` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619738176



##########
File path: service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/collect/ServiceCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.serviceregistry.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ServiceCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_SERVICE_CENTER = "ServiceCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_SERVICE_CENTER)) {
+      SystemBootstrapInfo sc = new SystemBootstrapInfo();
+      String[] urls = configuration.getStringArray("servicecomb.service.registry.address");
+      if (urls == null || urls.length == 0) {
+        urls = new String[]{"http://127.0.0.1:30100"};
+      }
+      sc.setAccessURL(Arrays.asList(urls));
+      return sc;
+    }
+    return null;

Review comment:
       same as above




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619738132



##########
File path: dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/collect/KieClientInformationCollector.java
##########
@@ -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 org.apache.servicecomb.config.kie.collect;
+
+import org.apache.servicecomb.core.bootup.BootUpInformationCollector;
+import org.apache.servicecomb.deployment.Deployment;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+
+public class KieClientInformationCollector implements BootUpInformationCollector {
+  @Override
+  public String collect() {
+    return "Kie Center: " + getCenterInfo(Deployment.getSystemBootStrapInfo("KieCenter"));
+  }
+
+  @Override
+  public int getOrder() {
+    return 2;
+  }
+
+  private String getCenterInfo(SystemBootstrapInfo systemBootstrapInfo) {
+    if (systemBootstrapInfo == null) {
+      return ("not exist");
+    }
+    return systemBootstrapInfo.getAccessURL().toString();

Review comment:
       same as above
   
   use ternary operator




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619738163



##########
File path: huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorDefaultDeploymentProvider.java
##########
@@ -31,23 +31,21 @@
 
   @Override
   public int getOrder() {
-    return 2;
+    return 3;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE:
-        String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
-        if (msAddresses == null || msAddresses.length == 0) {
-          return null;
-        }
-        SystemBootstrapInfo ms = new SystemBootstrapInfo();
-        ms.setAccessURL(Arrays.asList(msAddresses));
-        return ms;
-      default:
+    if (systemKey.contentEquals(MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE)) {
+      String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
+      if (msAddresses == null || msAddresses.length == 0) {
         return null;
+      }
+      SystemBootstrapInfo ms = new SystemBootstrapInfo();
+      ms.setAccessURL(Arrays.asList(msAddresses));
+      return ms;
     }
+    return null;

Review comment:
       same as above




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] codecov-commenter edited a comment on pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#issuecomment-825560996


   # [Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2358](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2720bdf) into [master](https://codecov.io/gh/apache/servicecomb-java-chassis/commit/45be2941689bb354d9bfe372ebacfd286fbe2f4f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (45be294) will **decrease** coverage by `0.23%`.
   > The diff coverage is `44.87%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/graphs/tree.svg?width=650&height=150&src=pr&token=KXfDcr9rX2&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2358      +/-   ##
   ============================================
   - Coverage     80.49%   80.26%   -0.24%     
     Complexity     1375     1375              
   ============================================
     Files          1547     1558      +11     
     Lines         41244    41470     +226     
     Branches       3475     3481       +6     
   ============================================
   + Hits          33201    33286      +85     
   - Misses         6537     6675     +138     
   - Partials       1506     1509       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...icecomb/http/client/common/WebSocketTransport.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9odHRwLWNsaWVudC1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2h0dHAvY2xpZW50L2NvbW1vbi9XZWJTb2NrZXRUcmFuc3BvcnQuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...che/servicecomb/http/client/task/AbstractTask.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9odHRwLWNsaWVudC1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2h0dHAvY2xpZW50L3Rhc2svQWJzdHJhY3RUYXNrLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...vicecomb/service/center/client/AddressManager.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9BZGRyZXNzTWFuYWdlci5qYXZh) | `45.00% <0.00%> (+2.14%)` | `0.00 <0.00> (ø)` | |
   | [...icecomb/service/center/client/DiscoveryEvents.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9EaXNjb3ZlcnlFdmVudHMuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [.../service/center/client/ServiceCenterDiscovery.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9TZXJ2aWNlQ2VudGVyRGlzY292ZXJ5LmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...rvice/center/client/ServiceCenterRegistration.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9TZXJ2aWNlQ2VudGVyUmVnaXN0cmF0aW9uLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...comb/service/center/client/ServiceCenterWatch.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9TZXJ2aWNlQ2VudGVyV2F0Y2guamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...vice/center/client/model/MicroserviceInstance.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9tb2RlbC9NaWNyb3NlcnZpY2VJbnN0YW5jZS5qYXZh) | `90.00% <0.00%> (-10.00%)` | `0.00 <0.00> (ø)` | |
   | [...ervicecomb/common/rest/AbstractRestInvocation.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL2NvbW1vbi1yZXN0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZXJ2aWNlY29tYi9jb21tb24vcmVzdC9BYnN0cmFjdFJlc3RJbnZvY2F0aW9uLmphdmE=) | `87.03% <ø> (ø)` | `0.00 <0.00> (ø)` | |
   | [...cecomb/common/rest/RestProducerInvocationFlow.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL2NvbW1vbi1yZXN0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZXJ2aWNlY29tYi9jb21tb24vcmVzdC9SZXN0UHJvZHVjZXJJbnZvY2F0aW9uRmxvdy5qYXZh) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | ... and [55 more](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [31bc3f1...2720bdf](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r620774135



##########
File path: service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/collect/ServiceCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.serviceregistry.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ServiceCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_SERVICE_CENTER = "ServiceCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_SERVICE_CENTER)) {
+      SystemBootstrapInfo sc = new SystemBootstrapInfo();
+      String[] urls = configuration.getStringArray("servicecomb.service.registry.address");
+      if (urls == null || urls.length == 0) {
+        urls = new String[]{"http://127.0.0.1:30100"};
+      }
+      sc.setAccessURL(Arrays.asList(urls));
+      return sc;
+    }
+    return null;

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619737658



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterConfig.java
##########
@@ -102,18 +102,18 @@ public String getToken() {
   public String getApiVersion() {
     return finalConfig.getString(URI_API_VERSION, "v3");
   }
-  
+
   @SuppressWarnings("unchecked")
   public List<String> getFileSources() {
-	Object property = finalConfig.getProperty(FILE_SOURCE);
-	if (property instanceof String) {
-	  List<String> result = new ArrayList<>();
-	  result.add((String) property);
-	  return result;
-	} else if (property instanceof List) {
-	  return (List<String>) property;
-	}
-	return new ArrayList<>();
+    Object property = finalConfig.getProperty(FILE_SOURCE);
+    if (property instanceof String) {
+      List<String> result = new ArrayList<>();
+      result.add((String) property);
+      return result;
+    } else if (property instanceof List) {

Review comment:
       "else" is redundant after "return"




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r620787709



##########
File path: dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/collect/KieClientInformationCollector.java
##########
@@ -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 org.apache.servicecomb.config.kie.collect;
+
+import org.apache.servicecomb.core.bootup.BootUpInformationCollector;
+import org.apache.servicecomb.deployment.Deployment;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+
+public class KieClientInformationCollector implements BootUpInformationCollector {
+  @Override
+  public String collect() {
+    return "Kie Center: " + getCenterInfo(Deployment.getSystemBootStrapInfo("KieCenter"));
+  }
+
+  @Override
+  public int getOrder() {
+    return 2;
+  }
+
+  private String getCenterInfo(SystemBootstrapInfo systemBootstrapInfo) {
+    if (systemBootstrapInfo == null) {
+      return ("not exist");
+    }
+    return systemBootstrapInfo.getAccessURL().toString();

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619737707



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterConfig.java
##########
@@ -102,18 +102,18 @@ public String getToken() {
   public String getApiVersion() {
     return finalConfig.getString(URI_API_VERSION, "v3");
   }
-  
+
   @SuppressWarnings("unchecked")
   public List<String> getFileSources() {
-	Object property = finalConfig.getProperty(FILE_SOURCE);
-	if (property instanceof String) {
-	  List<String> result = new ArrayList<>();
-	  result.add((String) property);
-	  return result;
-	} else if (property instanceof List) {
-	  return (List<String>) property;
-	}
-	return new ArrayList<>();
+    Object property = finalConfig.getProperty(FILE_SOURCE);
+    if (property instanceof String) {
+      List<String> result = new ArrayList<>();
+      result.add((String) property);
+      return result;
+    } else if (property instanceof List) {
+      return (List<String>) property;
+    }
+    return new ArrayList<>();

Review comment:
       `return Collections.EMPTY_LIST` is better




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619737218



##########
File path: huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorDefaultDeploymentProvider.java
##########
@@ -31,23 +31,21 @@
 
   @Override
   public int getOrder() {
-    return 2;
+    return 3;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE:
-        String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
-        if (msAddresses == null || msAddresses.length == 0) {
-          return null;
-        }
-        SystemBootstrapInfo ms = new SystemBootstrapInfo();
-        ms.setAccessURL(Arrays.asList(msAddresses));
-        return ms;
-      default:
+    if (systemKey.contentEquals(MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE)) {
+      String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
+      if (msAddresses == null || msAddresses.length == 0) {

Review comment:
       use ArrayUtils.isEmpty(msAddresses)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619738028



##########
File path: dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/collect/KieCenterDefaultDeploymentProvider.java
##########
@@ -15,44 +15,37 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.deployment;
-
-import java.util.Arrays;
+package org.apache.servicecomb.config.kie.collect;
 
+import com.google.common.annotations.VisibleForTesting;
 import org.apache.commons.configuration.AbstractConfiguration;
 import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
 
-import com.google.common.annotations.VisibleForTesting;
+import java.util.Arrays;
+
+public class KieCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_KIE_CENTER = "KieCenter";
 
-public class DefaultDeploymentProvider implements DeploymentProvider {
   private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case SYSTEM_KEY_SERVICE_CENTER:
-        SystemBootstrapInfo sc = new SystemBootstrapInfo();
-        String[] urls = configuration.getStringArray("servicecomb.service.registry.address");
-        if (urls == null || urls.length == 0) {
-          urls = new String[] {"http://127.0.0.1:30100"};
-        }
-        sc.setAccessURL(Arrays.asList(urls));
-        return sc;
-      case SYSTEM_KEY_CONFIG_CENTER:
-        String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
-        if (ccAddresses == null || ccAddresses.length == 0) {
+    if (systemKey.contentEquals(SYSTEM_KEY_KIE_CENTER)) {
+      String[] kieAddresses = configuration.getStringArray("servicecomb.kie.serverUri");
+      if (kieAddresses == null || kieAddresses.length == 0) {
           return null;
-        }
-        SystemBootstrapInfo cc = new SystemBootstrapInfo();
-        cc.setAccessURL(Arrays.asList(ccAddresses));
-        return cc;
-      default:
-        return null;
+      }
+      SystemBootstrapInfo kie = new SystemBootstrapInfo();
+      kie.setAccessURL(Arrays.asList(kieAddresses));
+      return kie;
     }
+    return null;

Review comment:
       same as above




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r620786668



##########
File path: huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorDefaultDeploymentProvider.java
##########
@@ -31,23 +31,21 @@
 
   @Override
   public int getOrder() {
-    return 2;
+    return 3;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE:
-        String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
-        if (msAddresses == null || msAddresses.length == 0) {
-          return null;
-        }
-        SystemBootstrapInfo ms = new SystemBootstrapInfo();
-        ms.setAccessURL(Arrays.asList(msAddresses));
-        return ms;
-      default:
+    if (systemKey.contentEquals(MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE)) {
+      String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
+      if (msAddresses == null || msAddresses.length == 0) {
         return null;
+      }
+      SystemBootstrapInfo ms = new SystemBootstrapInfo();
+      ms.setAccessURL(Arrays.asList(msAddresses));
+      return ms;
     }
+    return null;

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
liubao68 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619736041



##########
File path: huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorDefaultDeploymentProvider.java
##########
@@ -31,23 +31,21 @@
 
   @Override
   public int getOrder() {
-    return 2;
+    return 3;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE:
-        String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
-        if (msAddresses == null || msAddresses.length == 0) {
-          return null;
-        }
-        SystemBootstrapInfo ms = new SystemBootstrapInfo();
-        ms.setAccessURL(Arrays.asList(msAddresses));
-        return ms;
-      default:
+    if (systemKey.contentEquals(MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE)) {

Review comment:
       same as above




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r620765658



##########
File path: deployment/src/test/java/org/apache/servicecomb/deployment/CustomDeploymentProvider.java
##########
@@ -17,23 +17,32 @@
 
 package org.apache.servicecomb.deployment;
 
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+
 import java.util.Arrays;
 
 public class CustomDeploymentProvider implements DeploymentProvider {
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
   @Override
   public int getOrder() {
     return 0;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER:
-        SystemBootstrapInfo cc = new SystemBootstrapInfo();
-        cc.setAccessURL(Arrays.asList("http://lcalhost/custom"));
-        return cc;
-      default:
-        return null;
+    if (systemKey.contentEquals("TestCenter")) {
+      SystemBootstrapInfo cc = new SystemBootstrapInfo();
+      cc.setAccessURL(Arrays.asList("http://lcalhost/custom"));

Review comment:
       done

##########
File path: deployment/src/test/java/org/apache/servicecomb/deployment/TestDeployment.java
##########
@@ -31,45 +31,9 @@ public void tearDown() {
 
   @Test
   public void testConfiguration() {
-    DefaultDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
-    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(DeploymentProvider.SYSTEM_KEY_SERVICE_CENTER);
-    Assert.assertEquals(info.getAccessURL().get(0), "http://127.0.0.1:30100");
-    info = Deployment.getSystemBootStrapInfo(DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER);
+    CustomDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
+    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo("TestCenter");
     Assert.assertEquals(info.getAccessURL().get(0), "http://lcalhost/custom");

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619737169



##########
File path: dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/collect/KieCenterDefaultDeploymentProvider.java
##########
@@ -15,44 +15,37 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.deployment;
-
-import java.util.Arrays;
+package org.apache.servicecomb.config.kie.collect;
 
+import com.google.common.annotations.VisibleForTesting;
 import org.apache.commons.configuration.AbstractConfiguration;
 import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
 
-import com.google.common.annotations.VisibleForTesting;
+import java.util.Arrays;
+
+public class KieCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_KIE_CENTER = "KieCenter";
 
-public class DefaultDeploymentProvider implements DeploymentProvider {
   private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case SYSTEM_KEY_SERVICE_CENTER:
-        SystemBootstrapInfo sc = new SystemBootstrapInfo();
-        String[] urls = configuration.getStringArray("servicecomb.service.registry.address");
-        if (urls == null || urls.length == 0) {
-          urls = new String[] {"http://127.0.0.1:30100"};
-        }
-        sc.setAccessURL(Arrays.asList(urls));
-        return sc;
-      case SYSTEM_KEY_CONFIG_CENTER:
-        String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
-        if (ccAddresses == null || ccAddresses.length == 0) {
+    if (systemKey.contentEquals(SYSTEM_KEY_KIE_CENTER)) {
+      String[] kieAddresses = configuration.getStringArray("servicecomb.kie.serverUri");
+      if (kieAddresses == null || kieAddresses.length == 0) {

Review comment:
       use ArrayUtils.isEmpty(kieAddresses)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619737416



##########
File path: deployment/src/test/java/org/apache/servicecomb/deployment/CustomDeploymentProvider.java
##########
@@ -17,23 +17,32 @@
 
 package org.apache.servicecomb.deployment;
 
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+
 import java.util.Arrays;
 
 public class CustomDeploymentProvider implements DeploymentProvider {
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
   @Override
   public int getOrder() {
     return 0;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER:
-        SystemBootstrapInfo cc = new SystemBootstrapInfo();
-        cc.setAccessURL(Arrays.asList("http://lcalhost/custom"));
-        return cc;
-      default:
-        return null;
+    if (systemKey.contentEquals("TestCenter")) {
+      SystemBootstrapInfo cc = new SystemBootstrapInfo();
+      cc.setAccessURL(Arrays.asList("http://lcalhost/custom"));
+      return cc;
     }
+    return null;

Review comment:
       ```java
   if (!systemKey.contentEquals("TestCenter")) {
     return null;
   }
   xxx
   xxx
   ```
   seems to be better




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619737475



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/archaius/sources/ConfigCenterConfigurationSourceImpl.java
##########
@@ -65,7 +64,7 @@ public int getOrder() {
 
   @Override
   public boolean isValidSource(Configuration localConfiguration) {
-    if (Deployment.getSystemBootStrapInfo(DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER) == null) {
+    if (Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER) == null) {

Review comment:
       return Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER) != null




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] codecov-commenter commented on pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#issuecomment-825560996


   # [Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2358](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8f85665) into [master](https://codecov.io/gh/apache/servicecomb-java-chassis/commit/45be2941689bb354d9bfe372ebacfd286fbe2f4f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (45be294) will **decrease** coverage by `0.19%`.
   > The diff coverage is `44.76%`.
   
   > :exclamation: Current head 8f85665 differs from pull request most recent head 7d2f281. Consider uploading reports for the commit 7d2f281 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/graphs/tree.svg?width=650&height=150&src=pr&token=KXfDcr9rX2&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2358      +/-   ##
   ============================================
   - Coverage     80.49%   80.30%   -0.20%     
     Complexity     1375     1375              
   ============================================
     Files          1547     1557      +10     
     Lines         41244    41464     +220     
     Branches       3475     3481       +6     
   ============================================
   + Hits          33201    33299      +98     
   - Misses         6537     6658     +121     
   - Partials       1506     1507       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...icecomb/http/client/common/WebSocketTransport.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9odHRwLWNsaWVudC1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2h0dHAvY2xpZW50L2NvbW1vbi9XZWJTb2NrZXRUcmFuc3BvcnQuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...che/servicecomb/http/client/task/AbstractTask.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9odHRwLWNsaWVudC1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2h0dHAvY2xpZW50L3Rhc2svQWJzdHJhY3RUYXNrLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...vicecomb/service/center/client/AddressManager.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9BZGRyZXNzTWFuYWdlci5qYXZh) | `45.00% <0.00%> (+2.14%)` | `0.00 <0.00> (ø)` | |
   | [...icecomb/service/center/client/DiscoveryEvents.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9EaXNjb3ZlcnlFdmVudHMuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [.../service/center/client/ServiceCenterDiscovery.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9TZXJ2aWNlQ2VudGVyRGlzY292ZXJ5LmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...rvice/center/client/ServiceCenterRegistration.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9TZXJ2aWNlQ2VudGVyUmVnaXN0cmF0aW9uLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...comb/service/center/client/ServiceCenterWatch.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9TZXJ2aWNlQ2VudGVyV2F0Y2guamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...vice/center/client/model/MicroserviceInstance.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9tb2RlbC9NaWNyb3NlcnZpY2VJbnN0YW5jZS5qYXZh) | `90.00% <0.00%> (-10.00%)` | `0.00 <0.00> (ø)` | |
   | [...ervicecomb/common/rest/AbstractRestInvocation.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL2NvbW1vbi1yZXN0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZXJ2aWNlY29tYi9jb21tb24vcmVzdC9BYnN0cmFjdFJlc3RJbnZvY2F0aW9uLmphdmE=) | `87.03% <ø> (ø)` | `0.00 <0.00> (ø)` | |
   | [...cecomb/common/rest/RestProducerInvocationFlow.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL2NvbW1vbi1yZXN0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZXJ2aWNlY29tYi9jb21tb24vcmVzdC9SZXN0UHJvZHVjZXJJbnZvY2F0aW9uRmxvdy5qYXZh) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | ... and [57 more](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [31bc3f1...7d2f281](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] codecov-commenter edited a comment on pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#issuecomment-825560996


   # [Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2358](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (dc9a025) into [master](https://codecov.io/gh/apache/servicecomb-java-chassis/commit/45be2941689bb354d9bfe372ebacfd286fbe2f4f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (45be294) will **decrease** coverage by `0.21%`.
   > The diff coverage is `44.76%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/graphs/tree.svg?width=650&height=150&src=pr&token=KXfDcr9rX2&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2358      +/-   ##
   ============================================
   - Coverage     80.49%   80.28%   -0.22%     
     Complexity     1375     1375              
   ============================================
     Files          1547     1557      +10     
     Lines         41244    41464     +220     
     Branches       3475     3481       +6     
   ============================================
   + Hits          33201    33289      +88     
   - Misses         6537     6666     +129     
   - Partials       1506     1509       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...icecomb/http/client/common/WebSocketTransport.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9odHRwLWNsaWVudC1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2h0dHAvY2xpZW50L2NvbW1vbi9XZWJTb2NrZXRUcmFuc3BvcnQuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...che/servicecomb/http/client/task/AbstractTask.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9odHRwLWNsaWVudC1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2h0dHAvY2xpZW50L3Rhc2svQWJzdHJhY3RUYXNrLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...vicecomb/service/center/client/AddressManager.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9BZGRyZXNzTWFuYWdlci5qYXZh) | `45.00% <0.00%> (+2.14%)` | `0.00 <0.00> (ø)` | |
   | [...icecomb/service/center/client/DiscoveryEvents.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9EaXNjb3ZlcnlFdmVudHMuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [.../service/center/client/ServiceCenterDiscovery.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9TZXJ2aWNlQ2VudGVyRGlzY292ZXJ5LmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...rvice/center/client/ServiceCenterRegistration.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9TZXJ2aWNlQ2VudGVyUmVnaXN0cmF0aW9uLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...comb/service/center/client/ServiceCenterWatch.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9TZXJ2aWNlQ2VudGVyV2F0Y2guamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...vice/center/client/model/MicroserviceInstance.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9tb2RlbC9NaWNyb3NlcnZpY2VJbnN0YW5jZS5qYXZh) | `90.00% <0.00%> (-10.00%)` | `0.00 <0.00> (ø)` | |
   | [...ervicecomb/common/rest/AbstractRestInvocation.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL2NvbW1vbi1yZXN0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZXJ2aWNlY29tYi9jb21tb24vcmVzdC9BYnN0cmFjdFJlc3RJbnZvY2F0aW9uLmphdmE=) | `87.03% <ø> (ø)` | `0.00 <0.00> (ø)` | |
   | [...cecomb/common/rest/RestProducerInvocationFlow.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL2NvbW1vbi1yZXN0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZXJ2aWNlY29tYi9jb21tb24vcmVzdC9SZXN0UHJvZHVjZXJJbnZvY2F0aW9uRmxvdy5qYXZh) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | ... and [58 more](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [31bc3f1...dc9a025](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
liubao68 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619735924



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.config.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ConfigCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_CONFIG_CENTER = "ConfigCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_CONFIG_CENTER)) {

Review comment:
       use SYSTEM_KEY_CONFIG_CENTER.equals(systemKey)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r620786600



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterInformationCollector.java
##########
@@ -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 org.apache.servicecomb.config.collect;
+
+import org.apache.servicecomb.core.bootup.BootUpInformationCollector;
+import org.apache.servicecomb.deployment.Deployment;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+
+public class ConfigCenterInformationCollector implements BootUpInformationCollector {
+  @Override
+  public String collect() {
+    return "Config Center: " + getCenterInfo(Deployment.getSystemBootStrapInfo("ConfigCenter"));
+  }
+
+  @Override
+  public int getOrder() {
+    return 1;
+  }
+
+  private String getCenterInfo(SystemBootstrapInfo systemBootstrapInfo) {
+    if (systemBootstrapInfo == null) {

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619736299



##########
File path: deployment/src/test/java/org/apache/servicecomb/deployment/CustomDeploymentProvider.java
##########
@@ -17,23 +17,32 @@
 
 package org.apache.servicecomb.deployment;
 
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+
 import java.util.Arrays;
 
 public class CustomDeploymentProvider implements DeploymentProvider {
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
   @Override
   public int getOrder() {
     return 0;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER:
-        SystemBootstrapInfo cc = new SystemBootstrapInfo();
-        cc.setAccessURL(Arrays.asList("http://lcalhost/custom"));
-        return cc;
-      default:
-        return null;
+    if (systemKey.contentEquals("TestCenter")) {
+      SystemBootstrapInfo cc = new SystemBootstrapInfo();
+      cc.setAccessURL(Arrays.asList("http://lcalhost/custom"));

Review comment:
       typo

##########
File path: deployment/src/test/java/org/apache/servicecomb/deployment/TestDeployment.java
##########
@@ -31,45 +31,9 @@ public void tearDown() {
 
   @Test
   public void testConfiguration() {
-    DefaultDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
-    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(DeploymentProvider.SYSTEM_KEY_SERVICE_CENTER);
-    Assert.assertEquals(info.getAccessURL().get(0), "http://127.0.0.1:30100");
-    info = Deployment.getSystemBootStrapInfo(DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER);
+    CustomDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
+    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo("TestCenter");
     Assert.assertEquals(info.getAccessURL().get(0), "http://lcalhost/custom");

Review comment:
       typo "lcalhost"

##########
File path: service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/collect/ServiceCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.serviceregistry.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ServiceCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_SERVICE_CENTER = "ServiceCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_SERVICE_CENTER)) {
+      SystemBootstrapInfo sc = new SystemBootstrapInfo();
+      String[] urls = configuration.getStringArray("servicecomb.service.registry.address");
+      if (urls == null || urls.length == 0) {

Review comment:
       use ArrayUtils.isEmpty(urls)

##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.config.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ConfigCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_CONFIG_CENTER = "ConfigCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_CONFIG_CENTER)) {
+      String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
+      if (ccAddresses == null || ccAddresses.length == 0) {

Review comment:
       use ArrayUtils.isEmpty(ccAddresses)

##########
File path: dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/collect/KieCenterDefaultDeploymentProvider.java
##########
@@ -15,44 +15,37 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.deployment;
-
-import java.util.Arrays;
+package org.apache.servicecomb.config.kie.collect;
 
+import com.google.common.annotations.VisibleForTesting;
 import org.apache.commons.configuration.AbstractConfiguration;
 import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
 
-import com.google.common.annotations.VisibleForTesting;
+import java.util.Arrays;
+
+public class KieCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_KIE_CENTER = "KieCenter";
 
-public class DefaultDeploymentProvider implements DeploymentProvider {
   private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case SYSTEM_KEY_SERVICE_CENTER:
-        SystemBootstrapInfo sc = new SystemBootstrapInfo();
-        String[] urls = configuration.getStringArray("servicecomb.service.registry.address");
-        if (urls == null || urls.length == 0) {
-          urls = new String[] {"http://127.0.0.1:30100"};
-        }
-        sc.setAccessURL(Arrays.asList(urls));
-        return sc;
-      case SYSTEM_KEY_CONFIG_CENTER:
-        String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
-        if (ccAddresses == null || ccAddresses.length == 0) {
+    if (systemKey.contentEquals(SYSTEM_KEY_KIE_CENTER)) {
+      String[] kieAddresses = configuration.getStringArray("servicecomb.kie.serverUri");
+      if (kieAddresses == null || kieAddresses.length == 0) {

Review comment:
       use ArrayUtils.isEmpty(kieAddresses)

##########
File path: huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorDefaultDeploymentProvider.java
##########
@@ -31,23 +31,21 @@
 
   @Override
   public int getOrder() {
-    return 2;
+    return 3;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE:
-        String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
-        if (msAddresses == null || msAddresses.length == 0) {
-          return null;
-        }
-        SystemBootstrapInfo ms = new SystemBootstrapInfo();
-        ms.setAccessURL(Arrays.asList(msAddresses));
-        return ms;
-      default:
+    if (systemKey.contentEquals(MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE)) {
+      String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
+      if (msAddresses == null || msAddresses.length == 0) {

Review comment:
       use ArrayUtils.isEmpty(msAddresses)

##########
File path: deployment/src/test/java/org/apache/servicecomb/deployment/CustomDeploymentProvider.java
##########
@@ -17,23 +17,32 @@
 
 package org.apache.servicecomb.deployment;
 
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+
 import java.util.Arrays;
 
 public class CustomDeploymentProvider implements DeploymentProvider {
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
   @Override
   public int getOrder() {
     return 0;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER:
-        SystemBootstrapInfo cc = new SystemBootstrapInfo();
-        cc.setAccessURL(Arrays.asList("http://lcalhost/custom"));
-        return cc;
-      default:
-        return null;
+    if (systemKey.contentEquals("TestCenter")) {
+      SystemBootstrapInfo cc = new SystemBootstrapInfo();
+      cc.setAccessURL(Arrays.asList("http://lcalhost/custom"));
+      return cc;
     }
+    return null;

Review comment:
       ```java
   if (!systemKey.contentEquals("TestCenter")) {
     return null;
   }
   xxx
   xxx
   ```
   seems to be better

##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/archaius/sources/ConfigCenterConfigurationSourceImpl.java
##########
@@ -65,7 +64,7 @@ public int getOrder() {
 
   @Override
   public boolean isValidSource(Configuration localConfiguration) {
-    if (Deployment.getSystemBootStrapInfo(DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER) == null) {
+    if (Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER) == null) {

Review comment:
       return Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER) != null

##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/archaius/sources/ConfigCenterConfigurationSourceImpl.java
##########
@@ -65,7 +64,7 @@ public int getOrder() {
 
   @Override
   public boolean isValidSource(Configuration localConfiguration) {
-    if (Deployment.getSystemBootStrapInfo(DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER) == null) {
+    if (Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER) == null) {

Review comment:
       ```java
   return Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER) != null;
   ```
   seems to be better

##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterConfig.java
##########
@@ -102,18 +102,18 @@ public String getToken() {
   public String getApiVersion() {
     return finalConfig.getString(URI_API_VERSION, "v3");
   }
-  
+
   @SuppressWarnings("unchecked")
   public List<String> getFileSources() {
-	Object property = finalConfig.getProperty(FILE_SOURCE);
-	if (property instanceof String) {
-	  List<String> result = new ArrayList<>();
-	  result.add((String) property);
-	  return result;
-	} else if (property instanceof List) {
-	  return (List<String>) property;
-	}
-	return new ArrayList<>();
+    Object property = finalConfig.getProperty(FILE_SOURCE);
+    if (property instanceof String) {
+      List<String> result = new ArrayList<>();
+      result.add((String) property);
+      return result;
+    } else if (property instanceof List) {

Review comment:
       "else" is redundant after "return"

##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterConfig.java
##########
@@ -102,18 +102,18 @@ public String getToken() {
   public String getApiVersion() {
     return finalConfig.getString(URI_API_VERSION, "v3");
   }
-  
+
   @SuppressWarnings("unchecked")
   public List<String> getFileSources() {
-	Object property = finalConfig.getProperty(FILE_SOURCE);
-	if (property instanceof String) {
-	  List<String> result = new ArrayList<>();
-	  result.add((String) property);
-	  return result;
-	} else if (property instanceof List) {
-	  return (List<String>) property;
-	}
-	return new ArrayList<>();
+    Object property = finalConfig.getProperty(FILE_SOURCE);
+    if (property instanceof String) {
+      List<String> result = new ArrayList<>();
+      result.add((String) property);
+      return result;
+    } else if (property instanceof List) {
+      return (List<String>) property;
+    }
+    return new ArrayList<>();

Review comment:
       `return Collections.EMPTY_LIST` is better

##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.config.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ConfigCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_CONFIG_CENTER = "ConfigCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_CONFIG_CENTER)) {
+      String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
+      if (ccAddresses == null || ccAddresses.length == 0) {
+        return null;
+      }
+      SystemBootstrapInfo cc = new SystemBootstrapInfo();
+      cc.setAccessURL(Arrays.asList(ccAddresses));
+      return cc;
+    }
+    return null;

Review comment:
       ```java
   if (aaa){
     return null;
   }
   xxx;
   xxx;
   xxx;
   ```
   seems to be better

##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterInformationCollector.java
##########
@@ -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 org.apache.servicecomb.config.collect;
+
+import org.apache.servicecomb.core.bootup.BootUpInformationCollector;
+import org.apache.servicecomb.deployment.Deployment;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+
+public class ConfigCenterInformationCollector implements BootUpInformationCollector {
+  @Override
+  public String collect() {
+    return "Config Center: " + getCenterInfo(Deployment.getSystemBootStrapInfo("ConfigCenter"));
+  }
+
+  @Override
+  public int getOrder() {
+    return 1;
+  }
+
+  private String getCenterInfo(SystemBootstrapInfo systemBootstrapInfo) {
+    if (systemBootstrapInfo == null) {

Review comment:
       `return Objects.isNull(systemBootstrapInfo)?"not exist":systemBootstrapInfo.getAccessURL().toString();`

##########
File path: dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/collect/KieCenterDefaultDeploymentProvider.java
##########
@@ -15,44 +15,37 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.deployment;
-
-import java.util.Arrays;
+package org.apache.servicecomb.config.kie.collect;
 
+import com.google.common.annotations.VisibleForTesting;
 import org.apache.commons.configuration.AbstractConfiguration;
 import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
 
-import com.google.common.annotations.VisibleForTesting;
+import java.util.Arrays;
+
+public class KieCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_KIE_CENTER = "KieCenter";
 
-public class DefaultDeploymentProvider implements DeploymentProvider {
   private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case SYSTEM_KEY_SERVICE_CENTER:
-        SystemBootstrapInfo sc = new SystemBootstrapInfo();
-        String[] urls = configuration.getStringArray("servicecomb.service.registry.address");
-        if (urls == null || urls.length == 0) {
-          urls = new String[] {"http://127.0.0.1:30100"};
-        }
-        sc.setAccessURL(Arrays.asList(urls));
-        return sc;
-      case SYSTEM_KEY_CONFIG_CENTER:
-        String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
-        if (ccAddresses == null || ccAddresses.length == 0) {
+    if (systemKey.contentEquals(SYSTEM_KEY_KIE_CENTER)) {
+      String[] kieAddresses = configuration.getStringArray("servicecomb.kie.serverUri");
+      if (kieAddresses == null || kieAddresses.length == 0) {
           return null;
-        }
-        SystemBootstrapInfo cc = new SystemBootstrapInfo();
-        cc.setAccessURL(Arrays.asList(ccAddresses));
-        return cc;
-      default:
-        return null;
+      }
+      SystemBootstrapInfo kie = new SystemBootstrapInfo();
+      kie.setAccessURL(Arrays.asList(kieAddresses));
+      return kie;
     }
+    return null;

Review comment:
       same as above

##########
File path: dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/collect/KieClientInformationCollector.java
##########
@@ -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 org.apache.servicecomb.config.kie.collect;
+
+import org.apache.servicecomb.core.bootup.BootUpInformationCollector;
+import org.apache.servicecomb.deployment.Deployment;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+
+public class KieClientInformationCollector implements BootUpInformationCollector {
+  @Override
+  public String collect() {
+    return "Kie Center: " + getCenterInfo(Deployment.getSystemBootStrapInfo("KieCenter"));
+  }
+
+  @Override
+  public int getOrder() {
+    return 2;
+  }
+
+  private String getCenterInfo(SystemBootstrapInfo systemBootstrapInfo) {
+    if (systemBootstrapInfo == null) {
+      return ("not exist");
+    }
+    return systemBootstrapInfo.getAccessURL().toString();

Review comment:
       same as above
   
   use ternary operator

##########
File path: huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorDefaultDeploymentProvider.java
##########
@@ -31,23 +31,21 @@
 
   @Override
   public int getOrder() {
-    return 2;
+    return 3;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE:
-        String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
-        if (msAddresses == null || msAddresses.length == 0) {
-          return null;
-        }
-        SystemBootstrapInfo ms = new SystemBootstrapInfo();
-        ms.setAccessURL(Arrays.asList(msAddresses));
-        return ms;
-      default:
+    if (systemKey.contentEquals(MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE)) {
+      String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
+      if (msAddresses == null || msAddresses.length == 0) {
         return null;
+      }
+      SystemBootstrapInfo ms = new SystemBootstrapInfo();
+      ms.setAccessURL(Arrays.asList(msAddresses));
+      return ms;
     }
+    return null;

Review comment:
       same as above

##########
File path: service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/collect/ServiceCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.serviceregistry.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ServiceCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_SERVICE_CENTER = "ServiceCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_SERVICE_CENTER)) {
+      SystemBootstrapInfo sc = new SystemBootstrapInfo();
+      String[] urls = configuration.getStringArray("servicecomb.service.registry.address");
+      if (urls == null || urls.length == 0) {
+        urls = new String[]{"http://127.0.0.1:30100"};
+      }
+      sc.setAccessURL(Arrays.asList(urls));
+      return sc;
+    }
+    return null;

Review comment:
       same as above




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619737785



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.config.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ConfigCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_CONFIG_CENTER = "ConfigCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_CONFIG_CENTER)) {
+      String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
+      if (ccAddresses == null || ccAddresses.length == 0) {
+        return null;
+      }
+      SystemBootstrapInfo cc = new SystemBootstrapInfo();
+      cc.setAccessURL(Arrays.asList(ccAddresses));
+      return cc;
+    }
+    return null;

Review comment:
       ```java
   if (aaa){
     return null;
   }
   xxx;
   xxx;
   xxx;
   ```
   seems to be better




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619738480



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterInformationCollector.java
##########
@@ -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 org.apache.servicecomb.config.collect;
+
+import org.apache.servicecomb.core.bootup.BootUpInformationCollector;
+import org.apache.servicecomb.deployment.Deployment;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+
+public class ConfigCenterInformationCollector implements BootUpInformationCollector {
+  @Override
+  public String collect() {
+    return "Config Center: " + getCenterInfo(Deployment.getSystemBootStrapInfo("ConfigCenter"));
+  }
+
+  @Override
+  public int getOrder() {
+    return 1;
+  }
+
+  private String getCenterInfo(SystemBootstrapInfo systemBootstrapInfo) {
+    if (systemBootstrapInfo == null) {

Review comment:
       Does this compound statement comply with the clean code specification?

##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.config.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ConfigCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_CONFIG_CENTER = "ConfigCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_CONFIG_CENTER)) {
+      String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
+      if (ccAddresses == null || ccAddresses.length == 0) {
+        return null;
+      }
+      SystemBootstrapInfo cc = new SystemBootstrapInfo();
+      cc.setAccessURL(Arrays.asList(ccAddresses));
+      return cc;
+    }
+    return null;

Review comment:
       ok。




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619737127



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.config.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ConfigCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_CONFIG_CENTER = "ConfigCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_CONFIG_CENTER)) {
+      String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
+      if (ccAddresses == null || ccAddresses.length == 0) {

Review comment:
       use ArrayUtils.isEmpty(ccAddresses)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619736605



##########
File path: deployment/src/test/java/org/apache/servicecomb/deployment/TestDeployment.java
##########
@@ -31,45 +31,9 @@ public void tearDown() {
 
   @Test
   public void testConfiguration() {
-    DefaultDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
-    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo(DeploymentProvider.SYSTEM_KEY_SERVICE_CENTER);
-    Assert.assertEquals(info.getAccessURL().get(0), "http://127.0.0.1:30100");
-    info = Deployment.getSystemBootStrapInfo(DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER);
+    CustomDeploymentProvider.setConfiguration(ConfigUtil.createLocalConfig());
+    SystemBootstrapInfo info = Deployment.getSystemBootStrapInfo("TestCenter");
     Assert.assertEquals(info.getAccessURL().get(0), "http://lcalhost/custom");

Review comment:
       typo "lcalhost"




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r620780691



##########
File path: dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/collect/KieCenterDefaultDeploymentProvider.java
##########
@@ -15,44 +15,37 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.deployment;
-
-import java.util.Arrays;
+package org.apache.servicecomb.config.kie.collect;
 
+import com.google.common.annotations.VisibleForTesting;
 import org.apache.commons.configuration.AbstractConfiguration;
 import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
 
-import com.google.common.annotations.VisibleForTesting;
+import java.util.Arrays;
+
+public class KieCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_KIE_CENTER = "KieCenter";
 
-public class DefaultDeploymentProvider implements DeploymentProvider {
   private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case SYSTEM_KEY_SERVICE_CENTER:
-        SystemBootstrapInfo sc = new SystemBootstrapInfo();
-        String[] urls = configuration.getStringArray("servicecomb.service.registry.address");
-        if (urls == null || urls.length == 0) {
-          urls = new String[] {"http://127.0.0.1:30100"};
-        }
-        sc.setAccessURL(Arrays.asList(urls));
-        return sc;
-      case SYSTEM_KEY_CONFIG_CENTER:
-        String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
-        if (ccAddresses == null || ccAddresses.length == 0) {
+    if (systemKey.contentEquals(SYSTEM_KEY_KIE_CENTER)) {
+      String[] kieAddresses = configuration.getStringArray("servicecomb.kie.serverUri");
+      if (kieAddresses == null || kieAddresses.length == 0) {
           return null;
-        }
-        SystemBootstrapInfo cc = new SystemBootstrapInfo();
-        cc.setAccessURL(Arrays.asList(ccAddresses));
-        return cc;
-      default:
-        return null;
+      }
+      SystemBootstrapInfo kie = new SystemBootstrapInfo();
+      kie.setAccessURL(Arrays.asList(kieAddresses));
+      return kie;
     }
+    return null;

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r620773452



##########
File path: deployment/src/test/java/org/apache/servicecomb/deployment/CustomDeploymentProvider.java
##########
@@ -17,23 +17,32 @@
 
 package org.apache.servicecomb.deployment;
 
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+
 import java.util.Arrays;
 
 public class CustomDeploymentProvider implements DeploymentProvider {
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
   @Override
   public int getOrder() {
     return 0;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER:
-        SystemBootstrapInfo cc = new SystemBootstrapInfo();
-        cc.setAccessURL(Arrays.asList("http://lcalhost/custom"));
-        return cc;
-      default:
-        return null;
+    if (systemKey.contentEquals("TestCenter")) {
+      SystemBootstrapInfo cc = new SystemBootstrapInfo();
+      cc.setAccessURL(Arrays.asList("http://lcalhost/custom"));
+      return cc;
     }
+    return null;

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] codecov-commenter edited a comment on pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#issuecomment-825560996


   # [Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2358](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (dc9a025) into [master](https://codecov.io/gh/apache/servicecomb-java-chassis/commit/45be2941689bb354d9bfe372ebacfd286fbe2f4f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (45be294) will **decrease** coverage by `0.21%`.
   > The diff coverage is `44.76%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/graphs/tree.svg?width=650&height=150&src=pr&token=KXfDcr9rX2&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2358      +/-   ##
   ============================================
   - Coverage     80.49%   80.28%   -0.22%     
     Complexity     1375     1375              
   ============================================
     Files          1547     1557      +10     
     Lines         41244    41464     +220     
     Branches       3475     3481       +6     
   ============================================
   + Hits          33201    33289      +88     
   - Misses         6537     6666     +129     
   - Partials       1506     1509       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...icecomb/http/client/common/WebSocketTransport.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9odHRwLWNsaWVudC1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2h0dHAvY2xpZW50L2NvbW1vbi9XZWJTb2NrZXRUcmFuc3BvcnQuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...che/servicecomb/http/client/task/AbstractTask.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9odHRwLWNsaWVudC1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2h0dHAvY2xpZW50L3Rhc2svQWJzdHJhY3RUYXNrLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...vicecomb/service/center/client/AddressManager.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9BZGRyZXNzTWFuYWdlci5qYXZh) | `45.00% <0.00%> (+2.14%)` | `0.00 <0.00> (ø)` | |
   | [...icecomb/service/center/client/DiscoveryEvents.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9EaXNjb3ZlcnlFdmVudHMuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [.../service/center/client/ServiceCenterDiscovery.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9TZXJ2aWNlQ2VudGVyRGlzY292ZXJ5LmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...rvice/center/client/ServiceCenterRegistration.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9TZXJ2aWNlQ2VudGVyUmVnaXN0cmF0aW9uLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...comb/service/center/client/ServiceCenterWatch.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9TZXJ2aWNlQ2VudGVyV2F0Y2guamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...vice/center/client/model/MicroserviceInstance.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50cy9zZXJ2aWNlLWNlbnRlci1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3NlcnZpY2UvY2VudGVyL2NsaWVudC9tb2RlbC9NaWNyb3NlcnZpY2VJbnN0YW5jZS5qYXZh) | `90.00% <0.00%> (-10.00%)` | `0.00 <0.00> (ø)` | |
   | [...ervicecomb/common/rest/AbstractRestInvocation.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL2NvbW1vbi1yZXN0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZXJ2aWNlY29tYi9jb21tb24vcmVzdC9BYnN0cmFjdFJlc3RJbnZvY2F0aW9uLmphdmE=) | `87.03% <ø> (ø)` | `0.00 <0.00> (ø)` | |
   | [...cecomb/common/rest/RestProducerInvocationFlow.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL2NvbW1vbi1yZXN0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZXJ2aWNlY29tYi9jb21tb24vcmVzdC9SZXN0UHJvZHVjZXJJbnZvY2F0aW9uRmxvdy5qYXZh) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | ... and [58 more](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [31bc3f1...dc9a025](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2358?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r620773805



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.config.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ConfigCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_CONFIG_CENTER = "ConfigCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_CONFIG_CENTER)) {
+      String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
+      if (ccAddresses == null || ccAddresses.length == 0) {
+        return null;
+      }
+      SystemBootstrapInfo cc = new SystemBootstrapInfo();
+      cc.setAccessURL(Arrays.asList(ccAddresses));
+      return cc;
+    }
+    return null;

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619738480



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterInformationCollector.java
##########
@@ -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 org.apache.servicecomb.config.collect;
+
+import org.apache.servicecomb.core.bootup.BootUpInformationCollector;
+import org.apache.servicecomb.deployment.Deployment;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+
+public class ConfigCenterInformationCollector implements BootUpInformationCollector {
+  @Override
+  public String collect() {
+    return "Config Center: " + getCenterInfo(Deployment.getSystemBootStrapInfo("ConfigCenter"));
+  }
+
+  @Override
+  public int getOrder() {
+    return 1;
+  }
+
+  private String getCenterInfo(SystemBootstrapInfo systemBootstrapInfo) {
+    if (systemBootstrapInfo == null) {

Review comment:
       Does this compound statement comply with the clean code specification?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619736960



##########
File path: service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/collect/ServiceCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.serviceregistry.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ServiceCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_SERVICE_CENTER = "ServiceCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_SERVICE_CENTER)) {
+      SystemBootstrapInfo sc = new SystemBootstrapInfo();
+      String[] urls = configuration.getStringArray("servicecomb.service.registry.address");
+      if (urls == null || urls.length == 0) {

Review comment:
       use ArrayUtils.isEmpty(urls)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619738617



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.config.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ConfigCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_CONFIG_CENTER = "ConfigCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_CONFIG_CENTER)) {
+      String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
+      if (ccAddresses == null || ccAddresses.length == 0) {
+        return null;
+      }
+      SystemBootstrapInfo cc = new SystemBootstrapInfo();
+      cc.setAccessURL(Arrays.asList(ccAddresses));
+      return cc;
+    }
+    return null;

Review comment:
       ok。




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619737975



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterInformationCollector.java
##########
@@ -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 org.apache.servicecomb.config.collect;
+
+import org.apache.servicecomb.core.bootup.BootUpInformationCollector;
+import org.apache.servicecomb.deployment.Deployment;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+
+public class ConfigCenterInformationCollector implements BootUpInformationCollector {
+  @Override
+  public String collect() {
+    return "Config Center: " + getCenterInfo(Deployment.getSystemBootStrapInfo("ConfigCenter"));
+  }
+
+  @Override
+  public int getOrder() {
+    return 1;
+  }
+
+  private String getCenterInfo(SystemBootstrapInfo systemBootstrapInfo) {
+    if (systemBootstrapInfo == null) {

Review comment:
       `return Objects.isNull(systemBootstrapInfo)?"not exist":systemBootstrapInfo.getAccessURL().toString();`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r620764147



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.config.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ConfigCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_CONFIG_CENTER = "ConfigCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_CONFIG_CENTER)) {

Review comment:
       done

##########
File path: dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/collect/KieCenterDefaultDeploymentProvider.java
##########
@@ -15,44 +15,37 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.deployment;
-
-import java.util.Arrays;
+package org.apache.servicecomb.config.kie.collect;
 
+import com.google.common.annotations.VisibleForTesting;
 import org.apache.commons.configuration.AbstractConfiguration;
 import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
 
-import com.google.common.annotations.VisibleForTesting;
+import java.util.Arrays;
+
+public class KieCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_KIE_CENTER = "KieCenter";
 
-public class DefaultDeploymentProvider implements DeploymentProvider {
   private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case SYSTEM_KEY_SERVICE_CENTER:
-        SystemBootstrapInfo sc = new SystemBootstrapInfo();
-        String[] urls = configuration.getStringArray("servicecomb.service.registry.address");
-        if (urls == null || urls.length == 0) {
-          urls = new String[] {"http://127.0.0.1:30100"};
-        }
-        sc.setAccessURL(Arrays.asList(urls));
-        return sc;
-      case SYSTEM_KEY_CONFIG_CENTER:
-        String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
-        if (ccAddresses == null || ccAddresses.length == 0) {
+    if (systemKey.contentEquals(SYSTEM_KEY_KIE_CENTER)) {

Review comment:
       done

##########
File path: huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorDefaultDeploymentProvider.java
##########
@@ -31,23 +31,21 @@
 
   @Override
   public int getOrder() {
-    return 2;
+    return 3;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE:
-        String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
-        if (msAddresses == null || msAddresses.length == 0) {
-          return null;
-        }
-        SystemBootstrapInfo ms = new SystemBootstrapInfo();
-        ms.setAccessURL(Arrays.asList(msAddresses));
-        return ms;
-      default:
+    if (systemKey.contentEquals(MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE)) {

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r620787580



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterConfig.java
##########
@@ -102,18 +102,18 @@ public String getToken() {
   public String getApiVersion() {
     return finalConfig.getString(URI_API_VERSION, "v3");
   }
-  
+
   @SuppressWarnings("unchecked")
   public List<String> getFileSources() {
-	Object property = finalConfig.getProperty(FILE_SOURCE);
-	if (property instanceof String) {
-	  List<String> result = new ArrayList<>();
-	  result.add((String) property);
-	  return result;
-	} else if (property instanceof List) {
-	  return (List<String>) property;
-	}
-	return new ArrayList<>();
+    Object property = finalConfig.getProperty(FILE_SOURCE);
+    if (property instanceof String) {
+      List<String> result = new ArrayList<>();
+      result.add((String) property);
+      return result;
+    } else if (property instanceof List) {
+      return (List<String>) property;
+    }
+    return new ArrayList<>();

Review comment:
       done
   

##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterConfig.java
##########
@@ -102,18 +102,18 @@ public String getToken() {
   public String getApiVersion() {
     return finalConfig.getString(URI_API_VERSION, "v3");
   }
-  
+
   @SuppressWarnings("unchecked")
   public List<String> getFileSources() {
-	Object property = finalConfig.getProperty(FILE_SOURCE);
-	if (property instanceof String) {
-	  List<String> result = new ArrayList<>();
-	  result.add((String) property);
-	  return result;
-	} else if (property instanceof List) {
-	  return (List<String>) property;
-	}
-	return new ArrayList<>();
+    Object property = finalConfig.getProperty(FILE_SOURCE);
+    if (property instanceof String) {
+      List<String> result = new ArrayList<>();
+      result.add((String) property);
+      return result;
+    } else if (property instanceof List) {

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619737475



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/archaius/sources/ConfigCenterConfigurationSourceImpl.java
##########
@@ -65,7 +64,7 @@ public int getOrder() {
 
   @Override
   public boolean isValidSource(Configuration localConfiguration) {
-    if (Deployment.getSystemBootStrapInfo(DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER) == null) {
+    if (Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER) == null) {

Review comment:
       ```java
   return Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER) != null;
   ```
   seems to be better




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r620773313



##########
File path: huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorDefaultDeploymentProvider.java
##########
@@ -31,23 +31,21 @@
 
   @Override
   public int getOrder() {
-    return 2;
+    return 3;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE:
-        String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
-        if (msAddresses == null || msAddresses.length == 0) {
-          return null;
-        }
-        SystemBootstrapInfo ms = new SystemBootstrapInfo();
-        ms.setAccessURL(Arrays.asList(msAddresses));
-        return ms;
-      default:
+    if (systemKey.contentEquals(MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE)) {
+      String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
+      if (msAddresses == null || msAddresses.length == 0) {

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 merged pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
liubao68 merged pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] AngLi2 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
AngLi2 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619736299



##########
File path: deployment/src/test/java/org/apache/servicecomb/deployment/CustomDeploymentProvider.java
##########
@@ -17,23 +17,32 @@
 
 package org.apache.servicecomb.deployment;
 
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+
 import java.util.Arrays;
 
 public class CustomDeploymentProvider implements DeploymentProvider {
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
   @Override
   public int getOrder() {
     return 0;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER:
-        SystemBootstrapInfo cc = new SystemBootstrapInfo();
-        cc.setAccessURL(Arrays.asList("http://lcalhost/custom"));
-        return cc;
-      default:
-        return null;
+    if (systemKey.contentEquals("TestCenter")) {
+      SystemBootstrapInfo cc = new SystemBootstrapInfo();
+      cc.setAccessURL(Arrays.asList("http://lcalhost/custom"));

Review comment:
       typo




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
liubao68 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619735924



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/collect/ConfigCenterDefaultDeploymentProvider.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.servicecomb.config.collect;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.commons.configuration.AbstractConfiguration;
+import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
+
+import java.util.Arrays;
+
+public class ConfigCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_CONFIG_CENTER = "ConfigCenter";
+
+  private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
+
+  @Override
+  public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
+    if (systemKey.contentEquals(SYSTEM_KEY_CONFIG_CENTER)) {

Review comment:
       use SYSTEM_KEY_CONFIG_CENTER.equals(systemKey)

##########
File path: dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/collect/KieCenterDefaultDeploymentProvider.java
##########
@@ -15,44 +15,37 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.deployment;
-
-import java.util.Arrays;
+package org.apache.servicecomb.config.kie.collect;
 
+import com.google.common.annotations.VisibleForTesting;
 import org.apache.commons.configuration.AbstractConfiguration;
 import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
 
-import com.google.common.annotations.VisibleForTesting;
+import java.util.Arrays;
+
+public class KieCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_KIE_CENTER = "KieCenter";
 
-public class DefaultDeploymentProvider implements DeploymentProvider {
   private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case SYSTEM_KEY_SERVICE_CENTER:
-        SystemBootstrapInfo sc = new SystemBootstrapInfo();
-        String[] urls = configuration.getStringArray("servicecomb.service.registry.address");
-        if (urls == null || urls.length == 0) {
-          urls = new String[] {"http://127.0.0.1:30100"};
-        }
-        sc.setAccessURL(Arrays.asList(urls));
-        return sc;
-      case SYSTEM_KEY_CONFIG_CENTER:
-        String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
-        if (ccAddresses == null || ccAddresses.length == 0) {
+    if (systemKey.contentEquals(SYSTEM_KEY_KIE_CENTER)) {

Review comment:
       same as above

##########
File path: huawei-cloud/dashboard/src/main/java/org/apache/servicecomb/huaweicloud/dashboard/monitor/MonitorDefaultDeploymentProvider.java
##########
@@ -31,23 +31,21 @@
 
   @Override
   public int getOrder() {
-    return 2;
+    return 3;
   }
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE:
-        String[] msAddresses = configuration.getStringArray(MonitorConstant.MONITOR_URI);
-        if (msAddresses == null || msAddresses.length == 0) {
-          return null;
-        }
-        SystemBootstrapInfo ms = new SystemBootstrapInfo();
-        ms.setAccessURL(Arrays.asList(msAddresses));
-        return ms;
-      default:
+    if (systemKey.contentEquals(MonitorConstant.SYSTEM_KEY_DASHBOARD_SERVICE)) {

Review comment:
       same as above




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
liubao68 commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r619735987



##########
File path: dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/collect/KieCenterDefaultDeploymentProvider.java
##########
@@ -15,44 +15,37 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.deployment;
-
-import java.util.Arrays;
+package org.apache.servicecomb.config.kie.collect;
 
+import com.google.common.annotations.VisibleForTesting;
 import org.apache.commons.configuration.AbstractConfiguration;
 import org.apache.servicecomb.config.ConfigUtil;
+import org.apache.servicecomb.deployment.DeploymentProvider;
+import org.apache.servicecomb.deployment.SystemBootstrapInfo;
 
-import com.google.common.annotations.VisibleForTesting;
+import java.util.Arrays;
+
+public class KieCenterDefaultDeploymentProvider implements DeploymentProvider {
+  public static final String SYSTEM_KEY_KIE_CENTER = "KieCenter";
 
-public class DefaultDeploymentProvider implements DeploymentProvider {
   private static AbstractConfiguration configuration = ConfigUtil.createLocalConfig();
 
   @Override
   public SystemBootstrapInfo getSystemBootStrapInfo(String systemKey) {
-    switch (systemKey) {
-      case SYSTEM_KEY_SERVICE_CENTER:
-        SystemBootstrapInfo sc = new SystemBootstrapInfo();
-        String[] urls = configuration.getStringArray("servicecomb.service.registry.address");
-        if (urls == null || urls.length == 0) {
-          urls = new String[] {"http://127.0.0.1:30100"};
-        }
-        sc.setAccessURL(Arrays.asList(urls));
-        return sc;
-      case SYSTEM_KEY_CONFIG_CENTER:
-        String[] ccAddresses = configuration.getStringArray("servicecomb.config.client.serverUri");
-        if (ccAddresses == null || ccAddresses.length == 0) {
+    if (systemKey.contentEquals(SYSTEM_KEY_KIE_CENTER)) {

Review comment:
       same as above




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#issuecomment-824850767


   I have test this modify. it works well. And I have modify some old codes to rebuild them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2358: SCB-2256 The address of the config center of the service startup log is printed automatically according to the component type

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2358:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2358#discussion_r620786833



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/archaius/sources/ConfigCenterConfigurationSourceImpl.java
##########
@@ -65,7 +64,7 @@ public int getOrder() {
 
   @Override
   public boolean isValidSource(Configuration localConfiguration) {
-    if (Deployment.getSystemBootStrapInfo(DeploymentProvider.SYSTEM_KEY_CONFIG_CENTER) == null) {
+    if (Deployment.getSystemBootStrapInfo(ConfigCenterDefaultDeploymentProvider.SYSTEM_KEY_CONFIG_CENTER) == null) {

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org