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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to