public static class ByteBufferPool.Bucket
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
_capacity |
private long |
_lastUpdate |
private int |
_maxSize |
private ByteBufferPool |
_pool |
private java.util.Deque<java.nio.ByteBuffer> |
_queue |
private java.util.concurrent.atomic.AtomicInteger |
_size |
Constructor and Description |
---|
Bucket(ByteBufferPool pool,
int capacity,
int maxSize) |
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
acquire() |
java.nio.ByteBuffer |
acquire(boolean direct)
Deprecated.
use
acquire() instead |
void |
clear() |
(package private) void |
clear(java.util.function.Consumer<java.nio.ByteBuffer> memoryFn) |
(package private) long |
getLastUpdate() |
(package private) boolean |
isEmpty() |
private void |
queueOffer(java.nio.ByteBuffer buffer) |
private java.nio.ByteBuffer |
queuePoll() |
void |
release(java.nio.ByteBuffer buffer) |
(package private) int |
size() |
java.lang.String |
toString() |
private final java.util.Deque<java.nio.ByteBuffer> _queue
private final ByteBufferPool _pool
private final int _capacity
private final int _maxSize
private final java.util.concurrent.atomic.AtomicInteger _size
private long _lastUpdate
public Bucket(ByteBufferPool pool, int capacity, int maxSize)
public java.nio.ByteBuffer acquire()
@Deprecated public java.nio.ByteBuffer acquire(boolean direct)
acquire()
insteaddirect
- whether to create a direct buffer when none is availablepublic void release(java.nio.ByteBuffer buffer)
public void clear()
void clear(java.util.function.Consumer<java.nio.ByteBuffer> memoryFn)
private void queueOffer(java.nio.ByteBuffer buffer)
private java.nio.ByteBuffer queuePoll()
boolean isEmpty()
int size()
long getLastUpdate()
public java.lang.String toString()
toString
in class java.lang.Object