danny0405 commented on code in PR #13616:
URL: https://github.com/apache/hudi/pull/13616#discussion_r2229846090
##########
hudi-common/src/main/java/org/apache/hudi/common/util/ConfigUtils.java:
##########
@@ -642,4 +642,42 @@ public static HoodieConfig
getReaderConfigs(StorageConfiguration<?> storageConf)
public static TypedProperties loadGlobalProperties() {
return ((PropertiesConfig)
ReflectionUtils.loadClass("org.apache.hudi.common.config.DFSPropertiesConfiguration")).getGlobalProperties();
}
+
+ /**
+ * Extract all properties whose keys start with a given prefix.
+ * E.g., if the prefix is "a.b.c", and the props contain:
+ * "a.b.c.K1=V1", "a.b.c.K2=V2", "a.b.c.K3=V3".
+ * Then the output is:
+ * Map(K1->V1, K2->V2, K3->V3).
+ */
+ public static Map<String, String> extractWithPrefix(TypedProperties props,
String prefix) {
+ if (props == null || props.isEmpty()) {
+ return new HashMap<>();
Review Comment:
Collections.emptyMap() ?
--
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]