Top Description Constructors Methods
com.amazon.ion.impl.bin

pack-priv abstract Class BlockAllocator

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable
Known Direct Subclasses
com.amazon.ion.impl.bin.PooledBlockAllocatorProvider.PooledBlockAllocator
Imports
java.io.Closeable

Creates Block instances of fixed size. Instances are constructed by a BlockAllocatorProvider And are usable to allocate Block instances by the caller until close() is called.

A user must call Block#close() on all blocks allocated from this allocator, before invoking close().

Implementations are not thread-safe.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public abstract Block
allocateBlock()

Allocates a Block instance to the caller.

public abstract void
close()

Redeclares java.io.Closeable.close.

Releases the allocator back to the BlockAllocatorProvider from whence it came.

public abstract int
getBlockSize()

Returns the fixed block size of the allocator.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BlockAllocatorback to summary
pack-priv BlockAllocator()

Method Detail

allocateBlockback to summary
public abstract Block allocateBlock()

Allocates a Block instance to the caller. The caller owns the block until Block#close() is called--once Block#close() is called, an implementation may re-allocate it to another caller.

closeback to summary
public abstract void close()

Redeclares java.io.Closeable.close.

Releases the allocator back to the BlockAllocatorProvider from whence it came. This is used to allow underlying resources to be reclaimed and/or released properly.

getBlockSizeback to summary
public abstract int getBlockSize()

Returns the fixed block size of the allocator.