Removed deprecations after merge.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2019-02-28 15:45:10 +01:00
parent 234d3e224b
commit 0b20312bcc
3 changed files with 3 additions and 21 deletions

View File

@ -131,7 +131,7 @@ public class ArrayByteBufferPool extends AbstractByteBufferPool
private Bucket newBucket(int key) private Bucket newBucket(int key)
{ {
return new Bucket(this, key * getCapacityFactor(), getMaxQueueLength()); return new Bucket(key * getCapacityFactor(), getMaxQueueLength());
} }
@Override @Override

View File

@ -135,15 +135,13 @@ public interface ByteBufferPool
public static class Bucket public static class Bucket
{ {
private final Deque<ByteBuffer> _queue = new ConcurrentLinkedDeque<>(); private final Deque<ByteBuffer> _queue = new ConcurrentLinkedDeque<>();
private final ByteBufferPool _pool;
private final int _capacity; private final int _capacity;
private final int _maxSize; private final int _maxSize;
private final AtomicInteger _size; private final AtomicInteger _size;
private long _lastUpdate = System.nanoTime(); private long _lastUpdate = System.nanoTime();
public Bucket(ByteBufferPool pool, int capacity, int maxSize) public Bucket(int capacity, int maxSize)
{ {
_pool = pool;
_capacity = capacity; _capacity = capacity;
_maxSize = maxSize; _maxSize = maxSize;
_size = maxSize > 0 ? new AtomicInteger() : null; _size = maxSize > 0 ? new AtomicInteger() : null;
@ -159,22 +157,6 @@ public interface ByteBufferPool
return buffer; return buffer;
} }
/**
* @param direct whether to create a direct buffer when none is available
* @return a ByteBuffer
* @deprecated use {@link #acquire()} instead
*/
@Deprecated
public ByteBuffer acquire(boolean direct)
{
ByteBuffer buffer = queuePoll();
if (buffer == null)
return _pool.newByteBuffer(_capacity, direct);
if (_size != null)
_size.decrementAndGet();
return buffer;
}
public void release(ByteBuffer buffer) public void release(ByteBuffer buffer)
{ {
_lastUpdate = System.nanoTime(); _lastUpdate = System.nanoTime();

View File

@ -100,7 +100,7 @@ public class MappedByteBufferPool extends AbstractByteBufferPool
private Bucket newBucket(int key) private Bucket newBucket(int key)
{ {
return new Bucket(this, key * getCapacityFactor(), getMaxQueueLength()); return new Bucket(key * getCapacityFactor(), getMaxQueueLength());
} }
@Override @Override