Skip to content

[SCB-2367] optimize microservice.yaml load log#2688

Merged
liubao68 merged 7 commits intoapache:masterfrom
david6969xin:branch_master_2657
Feb 8, 2022
Merged

[SCB-2367] optimize microservice.yaml load log#2688
liubao68 merged 7 commits intoapache:masterfrom
david6969xin:branch_master_2657

Conversation

@david6969xin
Copy link
Copy Markdown
Contributor

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue 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.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 7, 2022

Codecov Report

Merging #2688 (a4223b1) into master (c1cb738) will decrease coverage by 0.52%.
The diff coverage is 83.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2688      +/-   ##
============================================
- Coverage     77.76%   77.23%   -0.53%     
+ Complexity     1430     1413      -17     
============================================
  Files          1598     1608      +10     
  Lines         42774    42980     +206     
  Branches       3610     3644      +34     
============================================
- Hits          33262    33195      -67     
- Misses         7998     8262     +264     
- Partials       1514     1523       +9     
Impacted Files Coverage Δ
...fig/archaius/sources/MicroserviceConfigLoader.java 75.86% <50.00%> (+0.86%) ⬆️
...n/java/org/apache/servicecomb/config/YAMLUtil.java 83.33% <100.00%> (+1.51%) ⬆️
...enter/client/model/QueryConfigurationsRequest.java 0.00% <0.00%> (-100.00%) ⬇️
...rvicecomb/config/center/client/AddressManager.java 0.00% <0.00%> (-68.75%) ⬇️
...ecomb/http/client/common/HttpTransportFactory.java 0.00% <0.00%> (-65.39%) ⬇️
...comb/config/center/client/ConfigCenterManager.java 0.00% <0.00%> (-65.39%) ⬇️
...che/servicecomb/http/client/task/AbstractTask.java 0.00% <0.00%> (-59.58%) ⬇️
...ig/center/client/exception/OperationException.java 0.00% <0.00%> (-50.00%) ⬇️
...ecomb/config/center/client/ConfigCenterClient.java 0.00% <0.00%> (-44.24%) ⬇️
...vicecomb/http/client/common/HttpConfiguration.java 0.00% <0.00%> (-40.00%) ⬇️
... and 56 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c1cb738...a4223b1. Read the comment docs.

@david6969xin david6969xin changed the title [#2657] optimize microservice.yaml load log [SCB-2367] optimize microservice.yaml load log Jan 7, 2022
} catch (IOException e) {
throw new ServiceCombException("Failed to load microservice config", e);
} catch (Exception e) {
throw new ServiceCombException("Failed to load microservice configFile " + configFileFromClasspath + " and " + e.getMessage());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw new ServiceCombException("Failed to load microservice configFile " + configFileFromClasspath, e);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

for (Map.Entry<String, Object> entry : propertieMap.entrySet()) {
if (entry.getValue() instanceof Map) {
result.putAll(retrieveItems(prefix + entry.getKey(), (Map<String, Object>) entry.getValue()));
result.putAll(retrieveItems(prefix + entry.getKey(), (Map<String, Object>) entry.getValue()));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

}
result.put(key, entry.getValue());
}else {
throw new IllegalArgumentException("value config error");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw new IllegalArgumentException("Find invalid configuration item. Prefix is " + prefix);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}
return flag;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  private static boolean isValidMap(Map<Object, Object> data) {
    for (Map.Entry<Object, Object> entry : data.entrySet()) {
      Object key = entry.getKey();
      Object value = entry.getValue();
      if (key instanceof String) {
        if (value instanceof Map) {
          return isValidMap((Map<Object, Object>) value);
        } 
        continue;        
      }
      return false;
    }
   return true;
  }

@liubao68
Copy link
Copy Markdown
Contributor

liubao68 commented Feb 8, 2022

retrigger ci

@liubao68 liubao68 closed this Feb 8, 2022
@liubao68 liubao68 reopened this Feb 8, 2022
@liubao68 liubao68 merged commit 4e264be into apache:master Feb 8, 2022
@david6969xin david6969xin deleted the branch_master_2657 branch March 30, 2022 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants