public interface Chunk
ByteBuffer
.
For example: a Chunk of 1G size may be backed by one MappedByteBuffer
from a
memory-mapped 1G file, or multiple HeapByteBuffer
/DirectByteBuffer
.
Modifier and Type | Method and Description |
---|---|
int |
allocate(int len)
Try to allocate size bytes from the chunk.
|
void |
free(int interChunkOffset)
release the space addressed by interChunkOffset.
|
int |
getChunkCapacity() |
int |
getChunkId() |
MemorySegment |
getMemorySegment(int chunkOffset) |
int |
getOffsetInSegment(int offsetInChunk) |
int allocate(int len)
len
- size of bytes to allocate.void free(int interChunkOffset)
interChunkOffset
- offset of the chunkint getChunkId()
int getChunkCapacity()
MemorySegment getMemorySegment(int chunkOffset)
int getOffsetInSegment(int offsetInChunk)
offsetInChunk
- virtual and global address in chunkMemorySegment
s, return the offset in certain
one.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.