wuchong commented on a change in pull request #14708:
URL: https://github.com/apache/flink/pull/14708#discussion_r563298480



##########
File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/util/LazyMemorySegmentPool.java
##########
@@ -37,37 +34,26 @@
     private static final long PER_REQUEST_MEMORY_SIZE = 16 * 1024 * 1024;
 
     private final Object owner;
-    private final @Nullable MemoryManager memoryManager;
+    private final MemoryManager memoryManager;
     private final ArrayList<MemorySegment> cachePages;
     private final int maxPages;
     private final int perRequestPages;
 
     private int pageUsage;
 
-    public LazyMemorySegmentPool(Object owner, MemoryManager memoryManager, 
long memorySize) {
-        this(
-                owner,
-                memoryManager,
-                (int) memorySize
-                        / (memoryManager == null
-                                ? MemoryManager.DEFAULT_PAGE_SIZE
-                                : memoryManager.getPageSize()));
-    }
-
     public LazyMemorySegmentPool(Object owner, MemoryManager memoryManager, 
int maxPages) {

Review comment:
       The nullable `MemoryManager` is introduced this month, see 
facd51fcf5c78c5f733c203c38e3a093ba8a5218. This is introduced because streaming 
operator can't use MemoryManager at that time, and we have to allocate memory 
from JVM heap. But with FLINK-20860 is resolved, we don't need this hack code 
anymore. 
   
    `BufferDataOverWindowOperator` uses 
`getContainingTask().getEnvironment().getMemoryManager()` to get the 
`MemoryManager` which should never be null in our cases, becuase we will never 
use `DummyEnvironment` in our tests. 




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

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


Reply via email to