Class LazyMemorySegmentPool
- java.lang.Object
-
- org.apache.flink.table.runtime.util.LazyMemorySegmentPool
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.flink.core.memory.MemorySegmentSource
,MemorySegmentPool
public class LazyMemorySegmentPool extends Object implements MemorySegmentPool, Closeable
MemorySegmentPool
that lazy allocate memory pages fromMemoryManager
.
-
-
Constructor Summary
Constructors Constructor Description LazyMemorySegmentPool(Object owner, org.apache.flink.runtime.memory.MemoryManager memoryManager, int maxPages)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.apache.flink.core.memory.MemorySegment>
allocateSegments(int required)
void
cleanCache()
void
close()
int
freePages()
org.apache.flink.core.memory.MemorySegment
nextSegment()
int
pageSize()
Get the page size of each page this pool holds.void
returnAll(List<org.apache.flink.core.memory.MemorySegment> memory)
Return all pages back into this pool.void
returnPage(org.apache.flink.core.memory.MemorySegment segment)
-
-
-
Constructor Detail
-
LazyMemorySegmentPool
public LazyMemorySegmentPool(Object owner, org.apache.flink.runtime.memory.MemoryManager memoryManager, int maxPages)
-
-
Method Detail
-
pageSize
public int pageSize()
Description copied from interface:MemorySegmentPool
Get the page size of each page this pool holds.- Specified by:
pageSize
in interfaceMemorySegmentPool
- Returns:
- the page size
-
returnAll
public void returnAll(List<org.apache.flink.core.memory.MemorySegment> memory)
Description copied from interface:MemorySegmentPool
Return all pages back into this pool.- Specified by:
returnAll
in interfaceMemorySegmentPool
- Parameters:
memory
- the pages which want to be returned.
-
returnPage
public void returnPage(org.apache.flink.core.memory.MemorySegment segment)
-
nextSegment
public org.apache.flink.core.memory.MemorySegment nextSegment()
- Specified by:
nextSegment
in interfaceorg.apache.flink.core.memory.MemorySegmentSource
-
allocateSegments
public List<org.apache.flink.core.memory.MemorySegment> allocateSegments(int required)
-
freePages
public int freePages()
- Specified by:
freePages
in interfaceMemorySegmentPool
- Returns:
- Free page number.
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
cleanCache
public void cleanCache()
-
-