Package org.eclipse.jetty.io
Class ArrayByteBufferPool
java.lang.Object
org.eclipse.jetty.io.ArrayByteBufferPool
- All Implemented Interfaces:
ByteBufferPool,Dumpable
- Direct Known Subclasses:
LogarithmicArrayByteBufferPool
@ManagedObject
@Deprecated(since="2021-05-27")
public class ArrayByteBufferPool
extends Object
implements Dumpable
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
A ByteBuffer pool where ByteBuffers are held in queues that are held in array elements.
Given a capacity factor of 1024, the first array element holds a queue of ByteBuffers
each of capacity 1024, the second array element holds a queue of ByteBuffers each of capacity
2048, and so on.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.ByteBufferPool
ByteBufferPool.Bucket, ByteBufferPool.LeaseNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Creates a new ArrayByteBufferPool with a default configuration.ArrayByteBufferPool(int minCapacity, int factor, int maxCapacity) Deprecated.Creates a new ArrayByteBufferPool with the given configuration.ArrayByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxQueueLength) Deprecated.Creates a new ArrayByteBufferPool with the given configuration.ArrayByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxQueueLength, long maxHeapMemory, long maxDirectMemory) Deprecated.Creates a new ArrayByteBufferPool with the given configuration. -
Method Summary
Modifier and TypeMethodDescriptionacquire(int size, boolean direct) Deprecated.Requests aByteBufferof the given size.voidclear()Deprecated.voiddump(Appendable out, String indent) Deprecated.Dump this object (and children) into an Appendable using the provided indent after any new lines.longDeprecated.longDeprecated.longDeprecated.longDeprecated.longDeprecated.longDeprecated.longgetMemory(boolean direct) Deprecated.booleanDeprecated.voidrelease(ByteBuffer buffer) Deprecated.Returns aByteBuffer, usually obtained withByteBufferPool.acquire(int, boolean)(but not necessarily), making it available for recycling and reuse.voidsetDetailedDump(boolean detailedDump) Deprecated.toString()Deprecated.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.io.ByteBufferPool
newByteBuffer, remove
-
Constructor Details
-
ArrayByteBufferPool
public ArrayByteBufferPool()Deprecated.Creates a new ArrayByteBufferPool with a default configuration. -
ArrayByteBufferPool
public ArrayByteBufferPool(int minCapacity, int factor, int maxCapacity) Deprecated.Creates a new ArrayByteBufferPool with the given configuration.- Parameters:
minCapacity- the minimum ByteBuffer capacityfactor- the capacity factormaxCapacity- the maximum ByteBuffer capacity
-
ArrayByteBufferPool
public ArrayByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxQueueLength) Deprecated.Creates a new ArrayByteBufferPool with the given configuration.- Parameters:
minCapacity- the minimum ByteBuffer capacityfactor- the capacity factormaxCapacity- the maximum ByteBuffer capacitymaxQueueLength- the maximum ByteBuffer queue length
-
ArrayByteBufferPool
public ArrayByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxQueueLength, long maxHeapMemory, long maxDirectMemory) Deprecated.Creates a new ArrayByteBufferPool with the given configuration.- Parameters:
minCapacity- the minimum ByteBuffer capacityfactor- the capacity factormaxCapacity- the maximum ByteBuffer capacitymaxQueueLength- the maximum ByteBuffer queue lengthmaxHeapMemory- the max heap memory in bytes, -1 for unlimited memory or 0 to use default heuristic.maxDirectMemory- the max direct memory in bytes, -1 for unlimited memory or 0 to use default heuristic.
-
-
Method Details
-
acquire
Deprecated.Description copied from interface:ByteBufferPoolRequests a
ByteBufferof the given size.The returned buffer may have a bigger capacity than the size being requested but it will have the limit set to the given size.
- Specified by:
acquirein interfaceByteBufferPool- Parameters:
size- the size of the bufferdirect- whether the buffer must be direct or not- Returns:
- the requested buffer
- See Also:
-
release
Deprecated.Description copied from interface:ByteBufferPoolReturns a
ByteBuffer, usually obtained withByteBufferPool.acquire(int, boolean)(but not necessarily), making it available for recycling and reuse.- Specified by:
releasein interfaceByteBufferPool- Parameters:
buffer- the buffer to return- See Also:
-
clear
public void clear()Deprecated. -
getDirectByteBufferCount
Deprecated. -
getHeapByteBufferCount
Deprecated. -
isDetailedDump
public boolean isDetailedDump()Deprecated. -
setDetailedDump
public void setDetailedDump(boolean detailedDump) Deprecated. -
dump
Deprecated.Description copied from interface:DumpableDump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dumpin interfaceDumpable- Parameters:
out- The appendable to dump toindent- The indent to apply after any new lines.- Throws:
IOException- if unable to write to Appendable
-
toString
Deprecated. -
getDirectMemory
Deprecated. -
getHeapMemory
Deprecated. -
getMaxDirectMemory
@ManagedAttribute("The max num of bytes that can be retained from direct ByteBuffers") public long getMaxDirectMemory()Deprecated. -
getMaxHeapMemory
@ManagedAttribute("The max num of bytes that can be retained from heap ByteBuffers") public long getMaxHeapMemory()Deprecated. -
getMemory
public long getMemory(boolean direct) Deprecated.
-