You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/03/05 11:22:44 UTC

[GitHub] [hudi] danny0405 commented on a change in pull request #4911: [HUDI-3460] Add reader merge memory option for flink

danny0405 commented on a change in pull request #4911:
URL: https://github.com/apache/hudi/pull/4911#discussion_r820085510



##########
File path: hudi-flink/src/main/java/org/apache/hudi/util/StreamerUtil.java
##########
@@ -509,4 +511,19 @@ public static String getLastCompletedInstant(HoodieTableMetaClient metaClient) {
   public static boolean haveSuccessfulCommits(HoodieTableMetaClient metaClient) {
     return !metaClient.getCommitsTimeline().filterCompletedInstants().empty();
   }
+
+  /**
+   * Returns the max compaction memory in bytes with given conf.
+   */
+  public static long getMaxCompactionMemoryInBytes(Configuration conf) {
+    if (conf.contains(FlinkOptions.COMPACTION_MAX_MEMORY)) {
+      return conf.get(FlinkOptions.COMPACTION_MAX_MEMORY) * 1024 * 1024;
+    }
+    return (long)Math
+        .ceil(conf.getDouble(FlinkOptions.COMPACTION_MEMORY_FRACTION_PROP)
+            * TaskExecutorProcessUtils.processSpecFromConfig(
+                TaskExecutorProcessUtils.getConfigurationMapLegacyTaskManagerHeapSizeToConfigOption(
+                    conf, TaskManagerOptions.TOTAL_PROCESS_MEMORY))
+                .getManagedMemorySize().getBytes());

Review comment:
       @cuibo01  Hello, The `HoodieDataSourceITCase` is failing locally in IDEA after this configuration, can you take a look ?
   
   Seems caused by the fine-grained resource config option missed !




-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org