Package org.eclipse.jetty.io
Class MappedByteBufferPool
- java.lang.Object
-
- org.eclipse.jetty.io.MappedByteBufferPool
-
- All Implemented Interfaces:
ByteBufferPool
- Direct Known Subclasses:
MappedByteBufferPool.Tagged
@ManagedObject @Deprecated public class MappedByteBufferPool extends java.lang.Object
Deprecated.This api is not supported anymore. Please do not use it.A ByteBuffer pool where ByteBuffers are held in queues that are held in a Map.
Given a capacity
factorof 1024, the Map entry with key1holds a queue of ByteBuffers each of capacity 1024, the Map entry with key2holds a queue of ByteBuffers each of capacity 2048, and so on.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMappedByteBufferPool.TaggedDeprecated.-
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.ByteBufferPool
ByteBufferPool.Bucket, ByteBufferPool.Lease
-
-
Constructor Summary
Constructors Constructor Description MappedByteBufferPool()Deprecated.Creates a new MappedByteBufferPool with a default configuration.MappedByteBufferPool(int factor)Deprecated.Creates a new MappedByteBufferPool with the given capacity factor.MappedByteBufferPool(int factor, int maxQueueLength)Deprecated.Creates a new MappedByteBufferPool with the given configuration.MappedByteBufferPool(int factor, int maxQueueLength, java.util.function.Function<java.lang.Integer,ByteBufferPool.Bucket> newBucket)Deprecated.Creates a new MappedByteBufferPool with the given configuration.MappedByteBufferPool(int factor, int maxQueueLength, java.util.function.Function<java.lang.Integer,ByteBufferPool.Bucket> newBucket, long maxHeapMemory, long maxDirectMemory)Deprecated.Creates a new MappedByteBufferPool with the given configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.nio.ByteBufferacquire(int size, boolean direct)Deprecated.Requests aByteBufferof the given size.voidclear()Deprecated.longgetDirectByteBufferCount()Deprecated.longgetDirectMemory()Deprecated.longgetHeapByteBufferCount()Deprecated.longgetHeapMemory()Deprecated.longgetMemory(boolean direct)Deprecated.voidrelease(java.nio.ByteBuffer buffer)Deprecated.Returns aByteBuffer, usually obtained withByteBufferPool.acquire(int, boolean)(but not necessarily), making it available for recycling and reuse.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.io.ByteBufferPool
newByteBuffer, remove
-
-
-
-
Constructor Detail
-
MappedByteBufferPool
public MappedByteBufferPool()
Deprecated.Creates a new MappedByteBufferPool with a default configuration.
-
MappedByteBufferPool
public MappedByteBufferPool(int factor)
Deprecated.Creates a new MappedByteBufferPool with the given capacity factor.- Parameters:
factor- the capacity factor
-
MappedByteBufferPool
public MappedByteBufferPool(int factor, int maxQueueLength)Deprecated.Creates a new MappedByteBufferPool with the given configuration.- Parameters:
factor- the capacity factormaxQueueLength- the maximum ByteBuffer queue length
-
MappedByteBufferPool
public MappedByteBufferPool(int factor, int maxQueueLength, java.util.function.Function<java.lang.Integer,ByteBufferPool.Bucket> newBucket)Deprecated.Creates a new MappedByteBufferPool with the given configuration.- Parameters:
factor- the capacity factormaxQueueLength- the maximum ByteBuffer queue lengthnewBucket- the function that creates a Bucket
-
MappedByteBufferPool
public MappedByteBufferPool(int factor, int maxQueueLength, java.util.function.Function<java.lang.Integer,ByteBufferPool.Bucket> newBucket, long maxHeapMemory, long maxDirectMemory)Deprecated.Creates a new MappedByteBufferPool with the given configuration.- Parameters:
factor- the capacity factormaxQueueLength- the maximum ByteBuffer queue lengthnewBucket- the function that creates a BucketmaxHeapMemory- the max heap memory in bytesmaxDirectMemory- the max direct memory in bytes
-
-
Method Detail
-
acquire
public java.nio.ByteBuffer acquire(int size, boolean direct)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.
- Parameters:
size- the size of the bufferdirect- whether the buffer must be direct or not- Returns:
- the requested buffer
- See Also:
ByteBufferPool.release(ByteBuffer)
-
release
public void release(java.nio.ByteBuffer buffer)
Deprecated.Description copied from interface:ByteBufferPoolReturns a
ByteBuffer, usually obtained withByteBufferPool.acquire(int, boolean)(but not necessarily), making it available for recycling and reuse.- Parameters:
buffer- the buffer to return- See Also:
ByteBufferPool.acquire(int, boolean)
-
clear
public void clear()
Deprecated.
-
getDirectByteBufferCount
@ManagedAttribute("The number of pooled direct ByteBuffers") public long getDirectByteBufferCount()
Deprecated.
-
getHeapByteBufferCount
@ManagedAttribute("The number of pooled heap ByteBuffers") public long getHeapByteBufferCount()
Deprecated.
-
getDirectMemory
@ManagedAttribute("The bytes retained by direct ByteBuffers") public long getDirectMemory()
Deprecated.
-
getHeapMemory
@ManagedAttribute("The bytes retained by heap ByteBuffers") public long getHeapMemory()
Deprecated.
-
getMemory
public long getMemory(boolean direct)
Deprecated.
-
-