2015/07/26 - Apache DirectMemory has been retired.

For more information, please explore the Attic.

public class

SlabByteBufferAllocator

extends AbstractByteBufferAllocator
java.lang.Object
   ↳ org.apache.directmemory.memory.allocator.AbstractByteBufferAllocator
     ↳ org.apache.directmemory.memory.allocator.SlabByteBufferAllocator

Class Overview

Allocator implementation that uses FixedSizeByteBufferAllocatorImpl of different size to allocate best matching's size ByteBuffer

Summary

[Expand]
Inherited Fields
From class org.apache.directmemory.memory.allocator.AbstractByteBufferAllocator
Public Constructors
SlabByteBufferAllocator(int number, Collection<FixedSizeByteBufferAllocatorImpl> slabs, boolean allowAllocationToBiggerSlab)
Constructor.
Public Methods
MemoryBuffer allocate(int size)
void clear()
void close()
void free(MemoryBuffer buffer)
int getCapacity()
[Expand]
Inherited Methods
From class org.apache.directmemory.memory.allocator.AbstractByteBufferAllocator
From class java.lang.Object
From interface java.io.Closeable
From interface org.apache.directmemory.memory.allocator.Allocator

Public Constructors

public SlabByteBufferAllocator (int number, Collection<FixedSizeByteBufferAllocatorImpl> slabs, boolean allowAllocationToBiggerSlab)

Constructor.

Parameters
number : internal allocator identifier
slabs : FixedSizeByteBufferAllocatorImpl to use for allocation
allowAllocationToBiggerSlab : tells if it is allowed to look in a bigger slab to perform the request.

Public Methods

public MemoryBuffer allocate (int size)

public void clear ()

public void close ()

Throws
IOException

public void free (MemoryBuffer buffer)

public int getCapacity ()