Zouxxyy commented on code in PR #6652:
URL: https://github.com/apache/hudi/pull/6652#discussion_r972869009
##########
hudi-common/src/test/java/org/apache/hudi/common/util/TestDFSPropertiesConfiguration.java:
##########
@@ -173,7 +173,9 @@ public void testNoGlobalConfFileConfigured() {
ENVIRONMENT_VARIABLES.clear(DFSPropertiesConfiguration.CONF_FILE_DIR_ENV_NAME);
// Should not throw any exception when no external configuration file
configured
DFSPropertiesConfiguration.refreshGlobalProps();
- assertEquals(0, DFSPropertiesConfiguration.getGlobalProps().size());
+ DFSPropertiesConfiguration defaultDfsPropertiesConfiguration = new
DFSPropertiesConfiguration();
+
defaultDfsPropertiesConfiguration.addPropsFromFile(DFSPropertiesConfiguration.DEFAULT_PATH);
+ assertEquals(defaultDfsPropertiesConfiguration.getProps().size(),
DFSPropertiesConfiguration.getGlobalProps().size());
Review Comment:
> so the logic should be count the configs from hudi-defaults.conf at the
default path if exists, or make it 0 if not exists. @Zouxxyy can you make
change for this please? then we should be good to land
hudi uses it's own method to read props instead of Apache commons
PropertiesConfiguration, just like this
```java
public void addPropsFromStream(BufferedReader reader) throws IOException {
try {
reader.lines().forEach(line -> {
if (!isValidLine(line)) {
return;
}
String[] split = splitProperty(line);
if (line.startsWith("include=") || line.startsWith("include =")) {
Path includeFilePath = new Path(currentFilePath.getParent(),
split[1]);
addPropsFromFile(includeFilePath);
} else {
hoodieConfig.setValue(split[0], split[1]);
}
});
} finally {
reader.close();
}
}
```
currently there is no static method to get prop directly from a path
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]