Package org.eclipse.jetty.io
Class ByteBufferPool.Bucket
- java.lang.Object
-
- org.eclipse.jetty.io.ByteBufferPool.Bucket
-
- Enclosing interface:
- ByteBufferPool
public static class ByteBufferPool.Bucket extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private int
_capacity
private java.util.concurrent.atomic.AtomicLong
_lastUpdate
private int
_maxSize
private ByteBufferPool
_pool
private java.util.Queue<java.nio.ByteBuffer>
_queue
private java.util.concurrent.atomic.AtomicInteger
_size
-
Constructor Summary
Constructors Constructor Description Bucket(ByteBufferPool pool, int capacity, int maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.nio.ByteBuffer
acquire()
java.nio.ByteBuffer
acquire(boolean direct)
Deprecated.useacquire()
insteadvoid
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()
-
-
-
Field Detail
-
_queue
private final java.util.Queue<java.nio.ByteBuffer> _queue
-
_pool
private final ByteBufferPool _pool
-
_capacity
private final int _capacity
-
_maxSize
private final int _maxSize
-
_size
private final java.util.concurrent.atomic.AtomicInteger _size
-
_lastUpdate
private final java.util.concurrent.atomic.AtomicLong _lastUpdate
-
-
Constructor Detail
-
Bucket
public Bucket(ByteBufferPool pool, int capacity, int maxSize)
-
-
Method Detail
-
acquire
public java.nio.ByteBuffer acquire()
-
acquire
@Deprecated public java.nio.ByteBuffer acquire(boolean direct)
Deprecated.useacquire()
instead- Parameters:
direct
- whether to create a direct buffer when none is available- Returns:
- a ByteBuffer
-
release
public void release(java.nio.ByteBuffer buffer)
-
clear
public void clear()
-
clear
void clear(java.util.function.Consumer<java.nio.ByteBuffer> memoryFn)
-
queueOffer
private void queueOffer(java.nio.ByteBuffer buffer)
-
queuePoll
private java.nio.ByteBuffer queuePoll()
-
isEmpty
boolean isEmpty()
-
size
int size()
-
getLastUpdate
long getLastUpdate()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-