Package org.apache.parquet.bytes
Class DirectByteBufferAllocator
- java.lang.Object
-
- org.apache.parquet.bytes.DirectByteBufferAllocator
-
- All Implemented Interfaces:
ByteBufferAllocator
public class DirectByteBufferAllocator extends Object implements ByteBufferAllocator
-
-
Constructor Summary
Constructors Constructor Description DirectByteBufferAllocator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufferallocate(int size)static DirectByteBufferAllocatorgetInstance()booleanisDirect()Indicates if this allocator will produce ByteBuffers backed by direct memory.voidrelease(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 DirectByteBufferAllocator getInstance()
-
allocate
public ByteBuffer allocate(int size)
- Specified by:
allocatein interfaceByteBufferAllocator
-
release
public void release(ByteBuffer b)
Description copied from interface:ByteBufferAllocatorFor RefCounted implementations using direct memory, the release method needs to be called to free references to the allocated memory.- Specified by:
releasein interfaceByteBufferAllocator- Parameters:
b- a ByteBuffer
-
isDirect
public boolean isDirect()
Description copied from interface:ByteBufferAllocatorIndicates if this allocator will produce ByteBuffers backed by direct memory.- Specified by:
isDirectin interfaceByteBufferAllocator- Returns:
- true if direct memory backed buffers will be created by this allocator, else false
-
-