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 from MemoryManager.
  • Constructor Details

    • LazyMemorySegmentPool

      public LazyMemorySegmentPool(Object owner, org.apache.flink.runtime.memory.MemoryManager memoryManager, int maxPages)
  • Method Details

    • pageSize

      public int pageSize()
      Description copied from interface: MemorySegmentPool
      Get the page size of each page this pool holds.
      Specified by:
      pageSize in interface MemorySegmentPool
      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 interface MemorySegmentPool
      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 interface org.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 interface MemorySegmentPool
      Returns:
      Free page number.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • cleanCache

      public void cleanCache()