[SCB-2187]read yaml from config center#2268
Closed
kaister3 wants to merge 11 commits intoapache:masterfrom
Closed
Conversation
liubao68
reviewed
Mar 2, 2021
| } else { | ||
| TestMgr.check(18, RegistrationManager.INSTANCE.getMicroservice().getPaths().size()); | ||
| } | ||
| TestMgr.check(18, RegistrationManager.INSTANCE.getMicroservice().getPaths().size()); |
Contributor
There was a problem hiding this comment.
Not correct, change 17 -> 18, 18 -> 19. Because this project is shared in demo-spring-boot-transport
Contributor
Author
There was a problem hiding this comment.
no wonder it fails in demo-spring-boot-transport test cases -_-''
liubao68
reviewed
Mar 2, 2021
| config: | ||
| client: | ||
| # serverUri: http://127.0.0.1:30113 | ||
| serverUri: http://127.0.0.1:30113 |
Contributor
There was a problem hiding this comment.
Because intergartion tests do not install config center, so you can not submit this test case now.
liubao68
reviewed
Mar 2, 2021
|
|
||
| try { | ||
| fileSourceList = configCenterClient.getFileSources(); | ||
| } catch (NullPointerException e) { |
Contributor
There was a problem hiding this comment.
- use IDE formatter in etc folder to format code
- do not catch NullPointerException, figure out when NullPointerException is thrown, and add null check .
liubao68
reviewed
Mar 2, 2021
|
|
||
| fileSourceList.forEach(fileName -> { | ||
| if (configuration.containsKey(fileName)) { | ||
| System.out.println("read yaml file: " + fileName); |
modify test case to fit spring-boot tests
delete test case
reformat codestyle
remove capture for NullPointerException
liubao68
reviewed
Mar 8, 2021
|
|
||
| private void replaceConfig(Map<String, Object> configuration, String fileName) { | ||
| Object tempConfig = configuration.get(fileName); | ||
| configuration.remove(fileName); |
Contributor
There was a problem hiding this comment.
Seems remove fileName will cause update contents will not availale.
liubao68
reviewed
Mar 8, 2021
| configuration.putAll(properties); | ||
| } catch (ClassCastException e) { | ||
| LOGGER.warn("yaml file has incorrect format"); | ||
| e.printStackTrace(); |
Contributor
There was a problem hiding this comment.
- remove
e.printStackTrace();, usingLOGGER.warn("yaml file has incorrect format", e); - when will
ClassCastExceptionthrown? seems this catch statement will never happen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow this checklist to help us incorporate your contribution quickly and easily:
[SCB-XXX] Fixes bug in ApproximateQuantiles, where you replaceSCB-XXXwith the appropriate JIRA issue.mvn clean install -Pitto make sure basic checks pass. A more thorough check will be performed on your pull request automatically.