Interface Chunk

    • Method Detail

      • allocate

        int allocate​(int len)
        Try to allocate size bytes from the chunk.
        Parameters:
        len - size of bytes to allocate.
        Returns:
        the offset of the successful allocation, or -1 to indicate not-enough-space
      • free

        void free​(int interChunkOffset)
        release the space addressed by interChunkOffset.
        Parameters:
        interChunkOffset - offset of the chunk
      • getChunkId

        int getChunkId()
        Returns:
        Id of this Chunk
      • getChunkCapacity

        int getChunkCapacity()
      • getMemorySegment

        org.apache.flink.core.memory.MemorySegment getMemorySegment​(int chunkOffset)
        Returns:
        This chunk's backing MemorySegment described by chunkOffset.
      • getOffsetInSegment

        int getOffsetInSegment​(int offsetInChunk)
        Parameters:
        offsetInChunk - virtual and global address in chunk
        Returns:
        chunk maybe compose of multi MemorySegments, return the offset in certain one.