yihua commented on code in PR #5987:
URL: https://github.com/apache/hudi/pull/5987#discussion_r910500003
##########
hudi-common/src/main/java/org/apache/hudi/common/config/DFSPropertiesConfiguration.java:
##########
@@ -90,11 +91,24 @@ public DFSPropertiesConfiguration() {
}
/**
- * Load global props from hudi-defaults.conf which is under
CONF_FILE_DIR_ENV_NAME.
+ * Load global props from hudi-defaults.conf which is under class loader or
CONF_FILE_DIR_ENV_NAME.
* @return Typed Properties
*/
public static TypedProperties loadGlobalProps() {
DFSPropertiesConfiguration conf = new DFSPropertiesConfiguration();
+
+ // First try loading the external config file from class loader
+ URL configFile =
Thread.currentThread().getContextClassLoader().getResource(DEFAULT_PROPERTIES_FILE);
+ if (configFile != null) {
+ try (BufferedReader br = new BufferedReader(new
InputStreamReader(configFile.openStream()))) {
+ conf.addPropsFromStream(br);
+ return conf.getProps();
+ } catch (IOException ioe) {
+ throw new HoodieIOException(
Review Comment:
Got it, makes sense. So the read of configs only happens when the external
Hudi config file is present.
--
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]