zhedoubushishi commented on a change in pull request #2833:
URL: https://github.com/apache/hudi/pull/2833#discussion_r631481196
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/config/DefaultHoodieConfig.java
##########
@@ -44,8 +56,93 @@ public static void setDefaultOnCondition(Properties props,
boolean condition, De
}
}
+ public static <T> void set(Properties props, ConfigOption<T> cfg, String
val) {
+ props.setProperty(cfg.key(), val);
+ }
+
+ public static <T> void setDefaultValue(Properties props, ConfigOption<T>
configOption) {
+ if (!contains(props, configOption)) {
+ Option<String> inferValue = Option.empty();
+ if (configOption.getInferFunc() != null) {
+ inferValue = (Option<String>) configOption.getInferFunc().apply(props);
+ }
+ props.setProperty(configOption.key(), inferValue.isPresent() ?
inferValue.get() : configOption.defaultValue().toString());
+ }
+ }
+
+ public static <T> void setDefaultValue(Map<String, String> props,
ConfigOption<T> configOption) {
+ if (!contains(props, configOption)) {
+ Option<String> inferValue = Option.empty();
+ if (configOption.getInferFunc() != null) {
+ inferValue = (Option<String>) configOption.getInferFunc().apply(props);
+ }
+ props.put(configOption.key(), inferValue.isPresent() ? inferValue.get()
: configOption.defaultValue().toString());
+ }
+ }
Review comment:
I found this method is never used. Removed.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]