Deprecated
See ByteBufferPool.
clean() to make
sure that direct allocated buffers can be reused by a future instance.
| Modifier and Type | Class and Description |
|---|---|
| private class | ByteBufferSlicePool.
References Deprecated
Pooled is deprecated or references (maybe indirectly) at least one deprecated element.
|
| pack-priv class | ByteBufferSlicePool.
References Deprecated
AutomaticReference is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private static class | |
| pack-priv static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final BufferAllocator | |
| private final int | |
| private final int | |
| private final List | |
| private static final Queue | |
| private static final int | |
| private final ThreadLocal | |
| private final Set | |
| private final Queue | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | ByteBufferSlicePool(final BufferAllocator<ByteBuffer>
the buffer allocator to use allocator, final int the size of each buffer bufferSize, final int the maximum region size for each backing buffer maxRegionSize, final int the number of buffers to cache on each thread threadLocalQueueSize)Construct a new instance. |
| public | ByteBufferSlicePool(final BufferAllocator<ByteBuffer>
the buffer allocator to use allocator, final int the size of each buffer bufferSize, final int the maximum region size for each backing buffer maxRegionSize)Construct a new instance. |
| public | ByteBufferSlicePool(final int
the size of each buffer bufferSize, final int the maximum region size for each backing buffer maxRegionSize)Construct a new instance, using a direct buffer allocator. |
| Modifier and Type | Method and Description |
|---|---|
| public Pooled | allocate()
Implements org.
References Deprecated
Pooled is deprecated or references (maybe indirectly) at least one deprecated element.
Allocate a resource from the pool. |
| private ByteBufferSlicePool. | |
| public void | |
| private ByteBufferSlicePool. | |
| private void | |
| private void | |
| public int | |
| private ByteBufferSlicePool. | |
| private ByteBufferSlicePool. |
| allocator | back to summary |
|---|---|
| private final BufferAllocator<ByteBuffer> allocator | |
| bufferSize | back to summary |
|---|---|
| private final int bufferSize | |
| buffersPerRegion | back to summary |
|---|---|
| private final int buffersPerRegion | |
| directBuffers | back to summary |
|---|---|
| private final List<ByteBuffer> directBuffers | |
| FREE_DIRECT_BUFFERS | back to summary |
|---|---|
| private static final Queue<ByteBuffer> FREE_DIRECT_BUFFERS | |
| LOCAL_LENGTH | back to summary |
|---|---|
| private static final int LOCAL_LENGTH | |
| localQueueHolder | back to summary |
|---|---|
| private final ThreadLocal<ByteBufferSlicePool. | |
| refSet | back to summary |
|---|---|
| private final Set<ByteBufferSlicePool. | |
| sliceQueue | back to summary |
|---|---|
| private final Queue<ByteBufferSlicePool. | |
| threadLocalQueueSize | back to summary |
|---|---|
| private final int threadLocalQueueSize | |
| ByteBufferSlicePool | back to summary |
|---|---|
| public ByteBufferSlicePool(final BufferAllocator<ByteBuffer> allocator, final int bufferSize, final int maxRegionSize, final int threadLocalQueueSize) Construct a new instance.
| |
| ByteBufferSlicePool | back to summary |
|---|---|
| public ByteBufferSlicePool(final BufferAllocator<ByteBuffer> allocator, final int bufferSize, final int maxRegionSize) Construct a new instance.
| |
| ByteBufferSlicePool | back to summary |
|---|---|
| public ByteBufferSlicePool(final int bufferSize, final int maxRegionSize) Construct a new instance, using a direct buffer allocator.
| |
| allocate | back to summary |
|---|---|
| public Pooled Implements org. Doc from org. References Deprecated
See corresponding docs for further information. Allocate a resource from the pool.
| |
| allocateSlices | back to summary |
|---|---|
| private ByteBufferSlicePool. | |
| clean | back to summary |
|---|---|
| public void clean() Cleans the pool, removing references to any buffers inside it. Should be invoked on pool disposal, when the pool will no longer be used. | |
| createThreadLocalCache | back to summary |
|---|---|
| private ByteBufferSlicePool. | |
| doFree | back to summary |
|---|---|
| private void doFree(ByteBufferSlicePool. | |
| freeThreadLocalCache | back to summary |
|---|---|
| private void freeThreadLocalCache(ByteBufferSlicePool. | |
| getBufferSize | back to summary |
|---|---|
| public int getBufferSize() Return the size of the | |
| sliceAllocatedBuffer | back to summary |
|---|---|
| private ByteBufferSlicePool. | |
| sliceReusedBuffer | back to summary |
|---|---|
| private ByteBufferSlicePool. | |
References Deprecated
Pooled is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv ByteBuffer | |
| private final ByteBufferSlicePool. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public ByteBuffer | |
| public String |
| buffer | back to summary |
|---|---|
| pack-priv ByteBuffer buffer | |
| region | back to summary |
|---|---|
| private final ByteBufferSlicePool. | |
| PooledByteBuffer | back to summary |
|---|---|
| pack-priv PooledByteBuffer(final ByteBufferSlicePool. | |
| close | back to summary |
|---|---|
| public void close() Implements org. Doc from org. Delegates to | |
| discard | back to summary |
|---|---|
| public void discard() Implements org. Doc from org. Discard this resource. Any backing resources corresponding to this pooled resource will be rendered unavailable until the pooled resource has been garbage-collected. | |
| free | back to summary |
|---|---|
| public void free() Implements org. Doc from org. Free this resource for immediate re-use. The resource must not be accessed again after
calling this method; if it is possible that an instance is still in use, you must call | |
| getResource | back to summary |
|---|---|
| public ByteBuffer getResource() Implements org. Doc from org. Get the pooled resource.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
References Deprecated
AutomaticReference is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBufferSlicePool. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected void |
| region | back to summary |
|---|---|
| private final ByteBufferSlicePool. | |
| Ref | back to summary |
|---|---|
| private Ref(final ByteBuffer referent, final ByteBufferSlicePool. | |
| free | back to summary |
|---|---|
| protected void free() Implements abstract org. Doc from org. Free this reference. This method will be called from a dedicated thread or threads so this method should execute as quickly as possible. | |
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBuffer |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv ByteBuffer |
| parent | back to summary |
|---|---|
| private final ByteBuffer parent | |
| Slice | back to summary |
|---|---|
| private Slice(final ByteBuffer parent, final int start, final int size) | |
| slice | back to summary |
|---|---|
| pack-priv ByteBuffer slice() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv final WeakReference | |
| pack-priv final ArrayDeque |
| Access | Constructor and Description |
|---|---|
| pack-priv | ThreadLocalCache(ByteBufferSlicePool pool)
References Deprecated
ByteBufferSlicePool is deprecated or references (maybe indirectly) at least one deprecated element.
|
| outstanding | back to summary |
|---|---|
| pack-priv int outstanding | |
| pool | back to summary |
|---|---|
| pack-priv final WeakReference<ByteBufferSlicePool> pool | |
| queue | back to summary |
|---|---|
| pack-priv final ArrayDeque<ByteBufferSlicePool. | |
| ThreadLocalCache | back to summary |
|---|---|
| pack-priv ThreadLocalCache(ByteBufferSlicePool pool)
References Deprecated
See corresponding docs for further information. | |
| Modifier and Type | Field and Description |
|---|---|
| private final WeakReference |
| Access | Constructor and Description |
|---|---|
| pack-priv | ThreadLocalCacheWrapper(ByteBufferSlicePool pool)
References Deprecated
ByteBufferSlicePool is deprecated or references (maybe indirectly) at least one deprecated element.
|
| Modifier and Type | Method and Description |
|---|---|
| protected ByteBufferSlicePool. | initialValue()
Overrides java. Returns the current thread's "initial value" for this thread-local variable. |
| public void | remove()
Overrides java. Removes the current thread's value for this thread-local variable. |
| pool | back to summary |
|---|---|
| private final WeakReference<ByteBufferSlicePool> pool | |
| ThreadLocalCacheWrapper | back to summary |
|---|---|
| pack-priv ThreadLocalCacheWrapper(ByteBufferSlicePool pool)
References Deprecated
See corresponding docs for further information. | |
| initialValue | back to summary |
|---|---|
| protected ByteBufferSlicePool. Overrides java. Doc from java. Returns the current thread's "initial value" for this
thread-local variable. This method will be invoked the first
time a thread accesses the variable with the
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides java. Doc from java. Removes the current thread's value for this thread-local
variable. If this thread-local variable is subsequently
read by the current thread, its value will be
reinitialized by invoking its | |