Package org.apache.parquet.bytes
Class HeapByteBufferAllocator
- java.lang.Object
-
- org.apache.parquet.bytes.HeapByteBufferAllocator
-
- All Implemented Interfaces:
ByteBufferAllocator
public class HeapByteBufferAllocator extends Object implements ByteBufferAllocator
-
-
Constructor Summary
Constructors Constructor Description HeapByteBufferAllocator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBuffer
allocate(int size)
static HeapByteBufferAllocator
getInstance()
boolean
isDirect()
Indicates if this allocator will produce ByteBuffers backed by direct memory.void
release(ByteBuffer b)
For RefCounted implementations using direct memory, the release method needs to be called to free references to the allocated memory.
-
-
-
Method Detail
-
getInstance
public static final HeapByteBufferAllocator getInstance()
-
allocate
public ByteBuffer allocate(int size)
- Specified by:
allocate
in interfaceByteBufferAllocator
-
release
public void release(ByteBuffer b)
Description copied from interface:ByteBufferAllocator
For RefCounted implementations using direct memory, the release method needs to be called to free references to the allocated memory.- Specified by:
release
in interfaceByteBufferAllocator
- Parameters:
b
- a ByteBuffer
-
isDirect
public boolean isDirect()
Description copied from interface:ByteBufferAllocator
Indicates if this allocator will produce ByteBuffers backed by direct memory.- Specified by:
isDirect
in interfaceByteBufferAllocator
- Returns:
- true if direct memory backed buffers will be created by this allocator, else false
-
-