Package org.eclipse.jetty.io
Class AbstractByteBufferPool
java.lang.Object
org.eclipse.jetty.io.AbstractByteBufferPool
- All Implemented Interfaces:
ByteBufferPool
- Direct Known Subclasses:
ArrayByteBufferPool
,MappedByteBufferPool
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.ByteBufferPool
ByteBufferPool.Bucket, ByteBufferPool.Lease
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicLong
private final int
private final AtomicLong
private final long
private final long
private final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractByteBufferPool
(int factor, int maxQueueLength, long maxHeapMemory, long maxDirectMemory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
protected void
decrementMemory
(ByteBuffer buffer) protected int
long
long
protected int
long
getMemory
(boolean direct) protected void
incrementMemory
(ByteBuffer buffer) protected void
releaseExcessMemory
(boolean direct, Consumer<Boolean> clearFn) private void
updateMemory
(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 Details
-
_factor
private final int _factor -
_maxQueueLength
private final int _maxQueueLength -
_maxHeapMemory
private final long _maxHeapMemory -
_heapMemory
-
_maxDirectMemory
private final long _maxDirectMemory -
_directMemory
-
-
Constructor Details
-
AbstractByteBufferPool
protected AbstractByteBufferPool(int factor, int maxQueueLength, long maxHeapMemory, long maxDirectMemory)
-
-
Method Details
-
getCapacityFactor
protected int getCapacityFactor() -
getMaxQueueLength
protected int getMaxQueueLength() -
decrementMemory
-
incrementMemory
-
updateMemory
-
releaseExcessMemory
-
getDirectMemory
-
getHeapMemory
-
getMemory
public long getMemory(boolean direct) -
clear
-