slfan1989 commented on code in PR #4167:
URL: https://github.com/apache/amoro/pull/4167#discussion_r3068914843


##########
amoro-format-iceberg/src/main/java/org/apache/amoro/io/writer/SortedPosDeleteWriter.java:
##########
@@ -49,6 +50,25 @@
  */
 public class SortedPosDeleteWriter<T> implements Closeable {
   private static final long DEFAULT_RECORDS_NUM_THRESHOLD = Long.MAX_VALUE;
+  private static final Runtime RUNTIME = Runtime.getRuntime();
+  private static final HeapUsageProvider RUNTIME_HEAP_USAGE =
+      new HeapUsageProvider() {
+        @Override
+        public long maxMemory() {
+          return RUNTIME.maxMemory();
+        }
+
+        @Override
+        public long usedMemory() {
+          return RUNTIME.totalMemory() - RUNTIME.freeMemory();
+        }
+      };
+
+  interface HeapUsageProvider {

Review Comment:
   > English Version
   
   Intentionally package-private. This keeps the API surface minimal. If future 
use cases require cross-package customization (e.g., Spark module), we can 
promote it to public at that time. Current design is appropriate for the 
immediate needs.
   
   > Chinese Version
   
   保持 package-private 可以限制 API 暴露面。如果将来出现跨包使用场景(如 Spark 模块自定义实现),那个时候再改为 public 
应该就可以了。



-- 
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