Top Description Fields Constructors Methods
org.xerial.snappy.pool

public final Class QuiescentBufferPool

extends Object
implements BufferPool
Class Inheritance
All Implemented Interfaces
org.xerial.snappy.pool.BufferPool
Imports
java.nio.ByteBuffer

A BufferPool implementation which does no pooling. New instances will be created for each call to allocate.
Author
Brett Okken

Field Summary

Modifier and TypeField and Description
private static final QuiescentBufferPool

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public byte[]
allocateArray(int
The minimum size array required. Must be >= 0.
size
)

Implements org.xerial.snappy.pool.BufferPool.allocateArray.

Creates a new byte[] of size.

public ByteBuffer
allocateDirect(int
The minimum size buffer required. Must be >= 0.
size
)

Implements org.xerial.snappy.pool.BufferPool.allocateDirect.

Allocates a direct ByteBuffer of size.

public static BufferPool

Returns:

Instance of BufferPool which does no caching/reuse of instances.
getInstance
()

public void
releaseArray(byte[]
Instance to return to pool. Must not be null. Must not be returned more than 1 time. Must not be used by caller after return.
buffer
)

Implements org.xerial.snappy.pool.BufferPool.releaseArray.

Does nothing.

public void
releaseDirect(ByteBuffer
Instance to return to pool. Must not be null. Must not be returned more than 1 time. Must not be used by caller after return.
buffer
)

Implements org.xerial.snappy.pool.BufferPool.releaseDirect.

Aggressively releases native resources associated with buffer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
private static final QuiescentBufferPool INSTANCE

Constructor Detail

QuiescentBufferPoolback to summary
private QuiescentBufferPool()

Method Detail

allocateArrayback to summary
public byte[] allocateArray(int size)

Implements org.xerial.snappy.pool.BufferPool.allocateArray.

Creates a new byte[] of size.

Parameters
size:int

Doc from org.xerial.snappy.pool.BufferPool.allocateArray.

The minimum size array required. Must be >= 0.

Returns:byte[]

Doc from org.xerial.snappy.pool.BufferPool.allocateArray.

A byte[] with length of at least size.

Annotations
@Override
allocateDirectback to summary
public ByteBuffer allocateDirect(int size)

Implements org.xerial.snappy.pool.BufferPool.allocateDirect.

Allocates a direct ByteBuffer of size.

Parameters
size:int

Doc from org.xerial.snappy.pool.BufferPool.allocateDirect.

The minimum size buffer required. Must be >= 0.

Returns:ByteBuffer

Doc from org.xerial.snappy.pool.BufferPool.allocateDirect.

A ByteBuffer of size or greater capacity.

Annotations
@Override
getInstanceback to summary
public static BufferPool getInstance()
Returns:BufferPool

Instance of BufferPool which does no caching/reuse of instances.

releaseArrayback to summary
public void releaseArray(byte[] buffer)

Implements org.xerial.snappy.pool.BufferPool.releaseArray.

Does nothing.

Parameters
buffer:byte[]

Doc from org.xerial.snappy.pool.BufferPool.releaseArray.

Instance to return to pool. Must not be null. Must not be returned more than 1 time. Must not be used by caller after return.

Annotations
@Override
releaseDirectback to summary
public void releaseDirect(ByteBuffer buffer)

Implements org.xerial.snappy.pool.BufferPool.releaseDirect.

Aggressively releases native resources associated with buffer.

Parameters
buffer:ByteBuffer

Doc from org.xerial.snappy.pool.BufferPool.releaseDirect.

Instance to return to pool. Must not be null. Must not be returned more than 1 time. Must not be used by caller after return.

Annotations
@Override