Allocator (Hive Storage API 2.1.1-pre-orc API)
Date: 2016-10-19

org.apache.hadoop.hive.common.io

## Interface Allocator

-     public interface Allocator

  An allocator provided externally to storage classes to allocate MemoryBuffer-s.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `Allocator.AllocatorOutOfMemoryException`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `allocateMultiple(MemoryBuffer[] dest, int size)` Allocates multiple buffers of a given size.
    `MemoryBuffer` | `createUnallocated()` Creates an unallocated memory buffer object.
    `void` | `deallocate(MemoryBuffer buffer)` Deallocates a memory buffer.
    `int` | `getMaxAllocation()` Maximum allocation size supported by this allocator.
    `boolean` | `isDirectAlloc()` Whether the allocator uses direct buffers.

- - ### Method Detail

    - #### allocateMultiple

          void allocateMultiple(MemoryBuffer[] dest,
                                int size)
                         throws Allocator.AllocatorOutOfMemoryException

      Allocates multiple buffers of a given size.
      Parameters:
        `dest` - Array where buffers are placed. Objects are reused if already there (see createUnallocated), created otherwise.
        `size` - Allocation size.
      Throws:
        `Allocator.AllocatorOutOfMemoryException` - Cannot allocate.

    - #### createUnallocated

          MemoryBuffer createUnallocated()

      Creates an unallocated memory buffer object. This object can be passed to allocateMultiple to allocate; this is useful if data structures are created for separate buffers that can later be allocated together.

    - #### deallocate

          void deallocate(MemoryBuffer buffer)

      Deallocates a memory buffer.

    - #### isDirectAlloc

          boolean isDirectAlloc()

      Whether the allocator uses direct buffers.

    - #### getMaxAllocation

          int getMaxAllocation()

      Maximum allocation size supported by this allocator.

Copyright © 2016 The Apache Software Foundation. All rights reserved.