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/03/08 10:00:26 UTC

[GitHub] [servicecomb-java-chassis] kaister3 opened a new pull request #2284: [SCB-2210]New qpsrepair

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


   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] liubao68 commented on a change in pull request #2284: [SCB-2187]New YAMLConfig

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



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/archaius/sources/ConfigCenterConfigurationSourceImpl.java
##########
@@ -147,5 +160,18 @@ public void handle(String action, Map<String, Object> parseConfigs) {
       }
       LOGGER.info("Config value cache changed: action:{}; item:{}", action, configuration.keySet());
     }
+
+    private void replaceConfig(Map<String, Object> configuration, String fileName) {
+      Object tempConfig = configuration.get(fileName);
+      configuration.remove(fileName);
+      try {
+        Map<String, Object> properties = YAMLUtil.yaml2Properties(
+          new ByteArrayInputStream(tempConfig.toString().replaceAll(":", ": ").getBytes()));
+        configuration.putAll(properties);
+      } catch (ClassCastException e) {

Review comment:
       Avoid ClassCastException, do not catch it. 




----------------------------------------------------------------
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 #2284: [SCB-2187]New YAMLConfig

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



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/archaius/sources/ConfigCenterConfigurationSourceImpl.java
##########
@@ -147,5 +160,18 @@ public void handle(String action, Map<String, Object> parseConfigs) {
       }
       LOGGER.info("Config value cache changed: action:{}; item:{}", action, configuration.keySet());
     }
+
+    private void replaceConfig(Map<String, Object> configuration, String fileName) {
+      Object tempConfig = configuration.get(fileName);
+      configuration.remove(fileName);
+      try {
+        Map<String, Object> properties = YAMLUtil.yaml2Properties(
+          new ByteArrayInputStream(tempConfig.toString().replaceAll(":", ": ").getBytes()));
+        configuration.putAll(properties);
+      } catch (ClassCastException e) {
+        LOGGER.warn("yaml file has incorrect format");
+        e.printStackTrace();

Review comment:
       LOGGER.warn("yaml file has incorrect format", e);
   
   delete e.printStackTrace
   




----------------------------------------------------------------
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 #2284: [SCB-2187]New YAMLConfig

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



##########
File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/archaius/sources/ConfigCenterConfigurationSourceImpl.java
##########
@@ -147,5 +160,18 @@ public void handle(String action, Map<String, Object> parseConfigs) {
       }
       LOGGER.info("Config value cache changed: action:{}; item:{}", action, configuration.keySet());
     }
+
+    private void replaceConfig(Map<String, Object> configuration, String fileName) {
+      Object tempConfig = configuration.get(fileName);
+      configuration.remove(fileName);

Review comment:
       If remove fileName will cause next configuration update won't get the latest value?




----------------------------------------------------------------
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] kaister3 closed pull request #2284: [SCB-2187]New YAMLConfig

Posted by GitBox <gi...@apache.org>.
kaister3 closed pull request #2284:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2284


   


----------------------------------------------------------------
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