Package org.eclipse.jetty.io
Class AbstractByteBufferPool
- java.lang.Object
-
- org.eclipse.jetty.io.AbstractByteBufferPool
-
- All Implemented Interfaces:
ByteBufferPool
- Direct Known Subclasses:
ArrayByteBufferPool
,MappedByteBufferPool
@ManagedObject abstract class AbstractByteBufferPool extends java.lang.Object implements ByteBufferPool
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.ByteBufferPool
ByteBufferPool.Bucket, ByteBufferPool.Lease
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicLong
_directMemory
private int
_factor
private java.util.concurrent.atomic.AtomicLong
_heapMemory
private long
_maxDirectMemory
private long
_maxHeapMemory
private int
_maxQueueLength
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractByteBufferPool(int factor, int maxQueueLength, long maxHeapMemory, long maxDirectMemory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
protected void
decrementMemory(java.nio.ByteBuffer buffer)
protected int
getCapacityFactor()
long
getDirectMemory()
long
getHeapMemory()
protected int
getMaxQueueLength()
long
getMemory(boolean direct)
protected void
incrementMemory(java.nio.ByteBuffer buffer)
protected void
releaseExcessMemory(boolean direct, java.util.function.Consumer<java.lang.Boolean> clearFn)
private void
updateMemory(java.nio.ByteBuffer buffer, boolean addOrSub)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.io.ByteBufferPool
acquire, newByteBuffer, release, remove
-
-
-
-
Field Detail
-
_factor
private final int _factor
-
_maxQueueLength
private final int _maxQueueLength
-
_maxHeapMemory
private final long _maxHeapMemory
-
_heapMemory
private final java.util.concurrent.atomic.AtomicLong _heapMemory
-
_maxDirectMemory
private final long _maxDirectMemory
-
_directMemory
private final java.util.concurrent.atomic.AtomicLong _directMemory
-
-
Method Detail
-
getCapacityFactor
protected int getCapacityFactor()
-
getMaxQueueLength
protected int getMaxQueueLength()
-
decrementMemory
protected void decrementMemory(java.nio.ByteBuffer buffer)
-
incrementMemory
protected void incrementMemory(java.nio.ByteBuffer buffer)
-
updateMemory
private void updateMemory(java.nio.ByteBuffer buffer, boolean addOrSub)
-
releaseExcessMemory
protected void releaseExcessMemory(boolean direct, java.util.function.Consumer<java.lang.Boolean> clearFn)
-
getDirectMemory
@ManagedAttribute("The bytes retained by direct ByteBuffers") public long getDirectMemory()
-
getHeapMemory
@ManagedAttribute("The bytes retained by heap ByteBuffers") public long getHeapMemory()
-
getMemory
public long getMemory(boolean direct)
-
clear
@ManagedOperation(value="Clears this ByteBufferPool", impact="ACTION") public void clear()
-
-