-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDDS-976: Parse network topology from yaml file #661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
| * @throws IllegalArgumentException xml file content is logically invalid | ||
| */ | ||
| private NodeSchemaLoadResult loadSchemaFromYaml(File schemaFile) { | ||
| LOG.info("Loading network topology layer schema file " + schemaFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: can we use parameterized log4j like below
LOG.info("Loading network topology layer schema file {}", schemaFile);
| NodeSchemaLoadResult finalSchema; | ||
|
|
||
| try { | ||
| FileInputStream fileInputStream = new FileInputStream(schemaFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use try-with-resource to ensure the FileInputStream is closed properly even Exception is thrown on line 210?
| NodeSchemaLoadResult result; | ||
| try { | ||
| result = NodeSchemaLoader.getInstance().loadSchemaFromFile(schemaFile); | ||
| if (schemaFileType.compareTo("yaml") == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the schema type string case insensitive?
| if (schemaFileType.compareTo("yaml") == 0) { | ||
| result = NodeSchemaLoader.getInstance().loadSchemaFromYaml(schemaFile); | ||
| } else { | ||
| result = NodeSchemaLoader.getInstance().loadSchemaFromFile(schemaFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change this to loadSchemaFromXml?
|
Thanks @cjjnjust for working on this. Patch LGTM overall, just few minor issues commented inline. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
Thanks @cjjnjust for the update. Some of the unit test failures seem related, can you check/fix them? |
|
@xiaoyuyao , I checked failed tests, it looks like not related to PR, it seems all errors are caused by |
|
+1, I will merge/commit the patch shortly. I manually retested the failed tests and they don't repro on my box. |
…e Chen. (apache#661) Signed-off-by: Xiaoyu Yao <[email protected]>
- Add consistent content for the front-page - Introduce navigation for the overall website - Links not updated yet Author: Jagadish <[email protected]> Reviewers: Jagadish <[email protected]> Closes apache#661 from vjagadish1989/samza-1910
This is a early stage patch to support load HDFS schema from a YAML file.
It should need more unit tests.