zhedoubushishi commented on a change in pull request #3416:
URL: https://github.com/apache/hudi/pull/3416#discussion_r747985677
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/config/DFSPropertiesConfiguration.java
##########
@@ -117,7 +142,50 @@ public void addProperties(BufferedReader reader) throws
IOException {
}
}
- public TypedProperties getConfig() {
- return props;
+ public static TypedProperties getGlobalProps() {
+ final TypedProperties globalProps = new TypedProperties();
+ globalProps.putAll(HUDI_CONF_PROPS);
+ return globalProps;
+ }
+
+ public TypedProperties getProps() {
+ return getProps(false);
+ }
+
+ public TypedProperties getProps(boolean includeHudiConf) {
+ if (includeHudiConf) {
+ TypedProperties mergedProps = new TypedProperties();
+ mergedProps.putAll(HUDI_CONF_PROPS);
+ mergedProps.putAll(props);
+ return mergedProps;
+ } else {
+ return props;
+ }
+ }
+
+ private static Path getDefaultConfPath() {
+ String confDir = System.getenv(CONF_FILE_DIR_ENV_NAME);
+ if (confDir == null) {
+ LOG.warn("Cannot find " + CONF_FILE_DIR_ENV_NAME + ", please set it as
the dir of " + DEFAULT_PROPERTIES_FILE);
+ return null;
+ }
+ return new Path("file://" + confDir + File.separator +
DEFAULT_PROPERTIES_FILE);
+ }
+
+ private String[] splitProperty(String line) {
+ line = line.replaceAll("\\s+"," ");
+ String delimiter = line.contains("=") ? "=" : " ";
+ int ind = line.indexOf(delimiter);
+ String k = line.substring(0, ind).trim();
+ String v = line.substring(ind + 1).trim();
+ return new String[] {k, v};
+ }
+
+ private boolean isValidLine(String line) {
Review comment:
We have some test cases here:
https://github.com/apache/hudi/blob/master/hudi-common/src/test/java/org/apache/hudi/common/util/TestDFSPropertiesConfiguration.java#L59-L72.
Is it enough or I can add more?
--
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]