Class ParquetDirectByteBufferAllocator

java.lang.Object
org.apache.drill.exec.store.parquet.ParquetDirectByteBufferAllocator
All Implemented Interfaces:
org.apache.parquet.bytes.ByteBufferAllocator

public class ParquetDirectByteBufferAllocator extends Object implements org.apache.parquet.bytes.ByteBufferAllocator
ByteBufferAllocator implementation that uses Drill's BufferAllocator to allocate and release ByteBuffer objects.
To properly release an allocated DrillBuf, this class keeps track of it's corresponding ByteBuffer that was passed to the Parquet library.
  • Constructor Details

    • ParquetDirectByteBufferAllocator

      public ParquetDirectByteBufferAllocator(OperatorContext o)
    • ParquetDirectByteBufferAllocator

      public ParquetDirectByteBufferAllocator(BufferAllocator allocator)
  • Method Details

    • allocate

      public ByteBuffer allocate(int sz)
      Specified by:
      allocate in interface org.apache.parquet.bytes.ByteBufferAllocator
    • release

      public void release(ByteBuffer byteBuffer)
      Specified by:
      release in interface org.apache.parquet.bytes.ByteBufferAllocator
    • isDirect

      public boolean isDirect()
      Specified by:
      isDirect in interface org.apache.parquet.bytes.ByteBufferAllocator