xushiyan commented on code in PR #6284:
URL: https://github.com/apache/hudi/pull/6284#discussion_r1000140401
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieMemoryConfig.java:
##########
@@ -77,10 +78,20 @@ public class HoodieMemoryConfig extends HoodieConfig {
.defaultValue(16 * 1024 * 1024)
.withDocumentation("Property to control the max memory in bytes for dfs
input stream buffer size");
+ public static final String MEMORY_SPILLABLE_MAP_BASE_PATH =
"hoodie.memory.spillable.map.path";
public static final ConfigProperty<String> SPILLABLE_MAP_BASE_PATH =
ConfigProperty
- .key("hoodie.memory.spillable.map.path")
+ .key(MEMORY_SPILLABLE_MAP_BASE_PATH)
.defaultValue("/tmp/")
- .withDocumentation("Default file path prefix for spillable map");
+ .withInferFunction(cfg -> {
+ // if user doesn't configure it, infer the path from env var
+ // if nothing to infer from, return Option.empty() then it will
fallback to the default /tmp/
+ if (cfg.contains(MEMORY_SPILLABLE_MAP_BASE_PATH)) {
+ return Option.of(cfg.getString(MEMORY_SPILLABLE_MAP_BASE_PATH));
Review Comment:
this check is not needed. infer function is invoked only when user does not
set it
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieMemoryConfig.java:
##########
@@ -77,10 +78,20 @@ public class HoodieMemoryConfig extends HoodieConfig {
.defaultValue(16 * 1024 * 1024)
.withDocumentation("Property to control the max memory in bytes for dfs
input stream buffer size");
+ public static final String MEMORY_SPILLABLE_MAP_BASE_PATH =
"hoodie.memory.spillable.map.path";
public static final ConfigProperty<String> SPILLABLE_MAP_BASE_PATH =
ConfigProperty
- .key("hoodie.memory.spillable.map.path")
+ .key(MEMORY_SPILLABLE_MAP_BASE_PATH)
Review Comment:
no need to extract to constant.
--
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]