danny0405 commented on code in PR #18319:
URL: https://github.com/apache/hudi/pull/18319#discussion_r2937988292
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/buffer/MemorySegmentPoolFactory.java:
##########
@@ -22,17 +22,34 @@
import org.apache.hudi.configuration.FlinkOptions;
import org.apache.flink.configuration.Configuration;
+import org.apache.flink.runtime.memory.MemoryManager;
+import org.apache.flink.table.runtime.util.LazyMemorySegmentPool;
import org.apache.flink.table.runtime.util.MemorySegmentPool;
+import java.util.function.Supplier;
+
/**
- * Factory to create {@code MemorySegmentPool}, currently only heap based
memory pool {@code HeapMemorySegmentPool}
- * is supported.
- *
- * <p> todo support memory segment pool based on flink managed memory,
currently support heap pool only, see HUDI-9189.
+ * Factory to create {@code MemorySegmentPool} instances.
+ * <p>
+ * Supports two types of memory pools:
+ * <ul>
+ * <li>Heap-based memory pool ({@code HeapMemorySegmentPool}) - uses JVM
heap memory</li>
+ * <li>Flink managed memory pool ({@code LazyMemorySegmentPool}) - uses
Flink's managed memory</li>
+ * </ul>
*/
public class MemorySegmentPoolFactory {
- public static MemorySegmentPool createMemorySegmentPool(Configuration conf) {
- return createMemorySegmentPools(conf, 1)[0];
+ private final Object owner;
+ private final MemoryManager memoryManager;
Review Comment:
mark the `memoryManager` as nullable or make it an Option.
--
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]