Top Description Inners Fields Constructors Methods
org.eclipse.jetty.io

public Class ArrayByteBufferPool

extends Object
implements ByteBufferPool, Dumpable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.io.ByteBufferPool
Known Direct Subclasses
org.eclipse.jetty.io.ArrayByteBufferPool.Quadratic, org.eclipse.jetty.io.ArrayByteBufferPool.Tracking
Annotations
@ManagedObject
Imports
java.io.IOException, .PrintWriter, .StringWriter, java.nio.ByteBuffer, java.time.Instant, java.util.Arrays, .List, .Set, java.util.concurrent.ConcurrentHashMap, .CopyOnWriteArrayList, java.util.concurrent.atomic.AtomicLong, java.util.function.Consumer, .IntUnaryOperator, java.util.stream.Collectors, org.eclipse.jetty.io.internal.CompoundPool, .QueuedPool, org.eclipse.jetty.util.BufferUtil, .ConcurrentPool, .NanoTime, .Pool, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedObject, .ManagedOperation, org.eclipse.jetty.util.component.Dumpable, .DumpableCollection, org.slf4j.Logger, .LoggerFactory

A RetainableByteBuffer pool where RetainableByteBuffers are held in Pools that are held in array elements.

Given a capacity factor of 1024, the first array element holds a Pool of RetainableByteBuffers each of capacity 1024, the second array element holds a Pool of RetainableByteBuffers each of capacity 2048, and so on with capacities 3072, 4096, 5120, etc.

The maxHeapMemory and maxDirectMemory default heuristic is to use Runtime#maxMemory() divided by 8.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static class
ArrayByteBufferPool.Quadratic

A variant of the ArrayByteBufferPool that uses buckets of buffers that increase in size by a power of 2 (eg 1k, 2k, 4k, 8k, etc.).

private static class
public static class
ArrayByteBufferPool.Tracking

A variant of ArrayByteBufferPool that tracks buffer acquires/releases, useful to identify buffer leaks.

Field Summary

Modifier and TypeField and Description
private final IntUnaryOperator
private final AtomicLong
private final AtomicLong
private final ArrayByteBufferPool.RetainedBucket[]
private final ArrayByteBufferPool.RetainedBucket[]
private final int
private final long
private final long
private final int
pack-priv static final int
pack-priv static final int
private static final Logger

Constructor Summary

AccessConstructor and Description
public
ArrayByteBufferPool()

Creates a new ArrayByteBufferPool with a default configuration.

public
ArrayByteBufferPool(int
the minimum ByteBuffer capacity
minCapacity
,
int
the capacity factor
factor
,
int
the maximum ByteBuffer capacity
maxCapacity
)

Creates a new ArrayByteBufferPool with the given configuration.

public
ArrayByteBufferPool(int
the minimum ByteBuffer capacity
minCapacity
,
int
the capacity factor
factor
,
int
the maximum ByteBuffer capacity
maxCapacity
,
int
the maximum number of ByteBuffers for each bucket
maxBucketSize
)

Creates a new ArrayByteBufferPool with the given configuration.

public
ArrayByteBufferPool(int
the minimum ByteBuffer capacity
minCapacity
,
int
the capacity factor
factor
,
int
the maximum ByteBuffer capacity
maxCapacity
,
int
the maximum number of ByteBuffers for each bucket
maxBucketSize
,
long
the max heap memory in bytes, -1 for unlimited memory or 0 to use default heuristic
maxHeapMemory
,
long
the max direct memory in bytes, -1 for unlimited memory or 0 to use default heuristic
maxDirectMemory
)

Creates a new ArrayByteBufferPool with the given configuration.

protected
ArrayByteBufferPool(int
the minimum ByteBuffer capacity
minCapacity
,
int
the capacity factor
factor
,
int
the maximum ByteBuffer capacity
maxCapacity
,
int
the maximum number of ByteBuffers for each bucket
maxBucketSize
,
long
the max heap memory in bytes, -1 for unlimited memory or 0 to use default heuristic
maxHeapMemory
,
long
the max direct memory in bytes, -1 for unlimited memory or 0 to use default heuristic
maxDirectMemory
,
IntUnaryOperator
a IntUnaryOperator that takes a capacity and returns a bucket index
bucketIndexFor
,
IntUnaryOperator
a IntUnaryOperator that takes a bucket index and returns a capacity
bucketCapacity
)

Creates a new ArrayByteBufferPool with the given configuration.

Method Summary

Modifier and TypeMethod and Description
public RetainableByteBuffer
acquire(int
The size of the buffer. The returned buffer will have at least this capacity.
size
,
boolean
true if a direct memory buffer is needed, false otherwise.
direct
)

Implements org.eclipse.jetty.io.ByteBufferPool.acquire.

Acquires a RetainableByteBuffer from this pool.

protected ByteBuffer
allocate(int capacity)

protected ByteBuffer
allocateDirect(int capacity)

private ArrayByteBufferPool.RetainedBucket
bucketFor(int capacity, boolean direct)

public void
clear()

Implements org.eclipse.jetty.io.ByteBufferPool.clear.

Removes all non-retained pooled instances from this pool.

private void
public void
dump(Appendable
The appendable to dump to
out
,
String
The indent to apply after any new lines.
indent
)

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.
private void
evict(boolean
true to search in the direct buffers buckets, false to search in the heap buffers buckets.
direct
,
long
the amount of bytes to evict. At least this much will be removed from the buckets.
excess
)

This eviction mechanism searches for the RetainableByteBuffers that were released the longest time ago.

private Pool.Entry<RetainableByteBuffer>
private long
public long
public long
public long
public long
private long
getAvailableMemory(boolean direct)

private long
getByteBufferCount(boolean direct)

public long
public long
public long
public long
public int
private long
getMemory(boolean direct)

public int
private long
maxMemory(long maxMemory)

private RetainableByteBuffer
newRetainableByteBuffer(int capacity, boolean direct, Consumer<RetainableByteBuffer> releaser)

public Pool<RetainableByteBuffer>
poolFor(int capacity, boolean direct)

private void
releaseExcessMemory(boolean direct)

protected void
removed(RetainableByteBuffer retainedBuffer)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_bucketIndexForback to summary
private final IntUnaryOperator _bucketIndexFor
_currentDirectMemoryback to summary
private final AtomicLong _currentDirectMemory
_currentHeapMemoryback to summary
private final AtomicLong _currentHeapMemory
_directback to summary
private final ArrayByteBufferPool.RetainedBucket[] _direct
_indirectback to summary
private final ArrayByteBufferPool.RetainedBucket[] _indirect
_maxCapacityback to summary
private final int _maxCapacity
_maxDirectMemoryback to summary
private final long _maxDirectMemory
_maxHeapMemoryback to summary
private final long _maxHeapMemory
_minCapacityback to summary
private final int _minCapacity
DEFAULT_FACTORback to summary
pack-priv static final int DEFAULT_FACTOR
DEFAULT_MAX_CAPACITY_BY_FACTORback to summary
pack-priv static final int DEFAULT_MAX_CAPACITY_BY_FACTOR
LOGback to summary
private static final Logger LOG

Constructor Detail

ArrayByteBufferPoolback to summary
public ArrayByteBufferPool()

Creates a new ArrayByteBufferPool with a default configuration. Both maxHeapMemory and maxDirectMemory default to 0 to use default heuristic.

ArrayByteBufferPoolback to summary
public ArrayByteBufferPool(int minCapacity, int factor, int maxCapacity)

Creates a new ArrayByteBufferPool with the given configuration. Both maxHeapMemory and maxDirectMemory default to 0 to use default heuristic.

Parameters
minCapacity:int

the minimum ByteBuffer capacity

factor:int

the capacity factor

maxCapacity:int

the maximum ByteBuffer capacity

ArrayByteBufferPoolback to summary
public ArrayByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxBucketSize)

Creates a new ArrayByteBufferPool with the given configuration. Both maxHeapMemory and maxDirectMemory default to 0 to use default heuristic.

Parameters
minCapacity:int

the minimum ByteBuffer capacity

factor:int

the capacity factor

maxCapacity:int

the maximum ByteBuffer capacity

maxBucketSize:int

the maximum number of ByteBuffers for each bucket

ArrayByteBufferPoolback to summary
public ArrayByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory)

Creates a new ArrayByteBufferPool with the given configuration.

Parameters
minCapacity:int

the minimum ByteBuffer capacity

factor:int

the capacity factor

maxCapacity:int

the maximum ByteBuffer capacity

maxBucketSize:int

the maximum number of ByteBuffers for each bucket

maxHeapMemory:long

the max heap memory in bytes, -1 for unlimited memory or 0 to use default heuristic

maxDirectMemory:long

the max direct memory in bytes, -1 for unlimited memory or 0 to use default heuristic

ArrayByteBufferPoolback to summary
protected ArrayByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory, IntUnaryOperator bucketIndexFor, IntUnaryOperator bucketCapacity)

Creates a new ArrayByteBufferPool with the given configuration.

Parameters
minCapacity:int

the minimum ByteBuffer capacity

factor:int

the capacity factor

maxCapacity:int

the maximum ByteBuffer capacity

maxBucketSize:int

the maximum number of ByteBuffers for each bucket

maxHeapMemory:long

the max heap memory in bytes, -1 for unlimited memory or 0 to use default heuristic

maxDirectMemory:long

the max direct memory in bytes, -1 for unlimited memory or 0 to use default heuristic

bucketIndexFor:IntUnaryOperator

a IntUnaryOperator that takes a capacity and returns a bucket index

bucketCapacity:IntUnaryOperator

a IntUnaryOperator that takes a bucket index and returns a capacity

Method Detail

acquireback to summary
public RetainableByteBuffer acquire(int size, boolean direct)

Implements org.eclipse.jetty.io.ByteBufferPool.acquire.

Doc from org.eclipse.jetty.io.ByteBufferPool.acquire.

Acquires a RetainableByteBuffer from this pool.

Parameters
size:int

The size of the buffer. The returned buffer will have at least this capacity.

direct:boolean

true if a direct memory buffer is needed, false otherwise.

Returns:RetainableByteBuffer

a RetainableByteBuffer with position and limit set to 0.

Annotations
@Override
allocateback to summary
protected ByteBuffer allocate(int capacity)
allocateDirectback to summary
protected ByteBuffer allocateDirect(int capacity)
bucketForback to summary
private ArrayByteBufferPool.RetainedBucket bucketFor(int capacity, boolean direct)
clearback to summary
public void clear()

Implements org.eclipse.jetty.io.ByteBufferPool.clear.

Doc from org.eclipse.jetty.io.ByteBufferPool.clear.

Removes all non-retained pooled instances from this pool.

Annotations
@ManagedOperation:Clears this ByteBufferPool
impact:ACTION
clearArrayback to summary
private void clearArray(ArrayByteBufferPool.RetainedBucket[] poolArray, AtomicLong memoryCounter)
dumpback to summary
public void dump(Appendable out, String indent) throws IOException

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Doc from org.eclipse.jetty.util.component.Dumpable.dump.

Dump 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.

Parameters
out:Appendable

The appendable to dump to

indent:String

The indent to apply after any new lines.

Annotations
@Override
Exceptions
IOException:
if unable to write to Appendable
evictback to summary
private void evict(boolean direct, long excess)

This eviction mechanism searches for the RetainableByteBuffers that were released the longest time ago.

Parameters
direct:boolean

true to search in the direct buffers buckets, false to search in the heap buffers buckets.

excess:long

the amount of bytes to evict. At least this much will be removed from the buckets.

findOldestEntryback to summary
private Pool.Entry<RetainableByteBuffer> findOldestEntry(long now, Pool<RetainableByteBuffer> bucket)
getAvailableByteBufferCountback to summary
private long getAvailableByteBufferCount(boolean direct)
getAvailableDirectByteBufferCountback to summary
public long getAvailableDirectByteBufferCount()
Annotations
@ManagedAttribute:The number of pooled direct ByteBuffers that are available
getAvailableDirectMemoryback to summary
public long getAvailableDirectMemory()
Annotations
@ManagedAttribute:The available bytes retained by direct ByteBuffers
getAvailableHeapByteBufferCountback to summary
public long getAvailableHeapByteBufferCount()
Annotations
@ManagedAttribute:The number of pooled heap ByteBuffers that are available
getAvailableHeapMemoryback to summary
public long getAvailableHeapMemory()
Annotations
@ManagedAttribute:The available bytes retained by heap ByteBuffers
getAvailableMemoryback to summary
private long getAvailableMemory(boolean direct)
getByteBufferCountback to summary
private long getByteBufferCount(boolean direct)
getDirectByteBufferCountback to summary
public long getDirectByteBufferCount()
Annotations
@ManagedAttribute:The number of pooled direct ByteBuffers
getDirectMemoryback to summary
public long getDirectMemory()
Annotations
@ManagedAttribute:The bytes retained by direct ByteBuffers
getHeapByteBufferCountback to summary
public long getHeapByteBufferCount()
Annotations
@ManagedAttribute:The number of pooled heap ByteBuffers
getHeapMemoryback to summary
public long getHeapMemory()
Annotations
@ManagedAttribute:The bytes retained by heap ByteBuffers
getMaxCapacityback to summary
public int getMaxCapacity()
Annotations
@ManagedAttribute:The maximum pooled buffer capacity
getMemoryback to summary
private long getMemory(boolean direct)
getMinCapacityback to summary
public int getMinCapacity()
Annotations
@ManagedAttribute:The minimum pooled buffer capacity
maxMemoryback to summary
private long maxMemory(long maxMemory)
newRetainableByteBufferback to summary
private RetainableByteBuffer newRetainableByteBuffer(int capacity, boolean direct, Consumer<RetainableByteBuffer> releaser)
poolForback to summary
public Pool<RetainableByteBuffer> poolFor(int capacity, boolean direct)
releaseExcessMemoryback to summary
private void releaseExcessMemory(boolean direct)
removedback to summary
protected void removed(RetainableByteBuffer retainedBuffer)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.eclipse.jetty.io back to summary

private Class ArrayByteBufferPool.Buffer

extends AbstractRetainableByteBuffer
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final AtomicLong
private final Consumer<RetainableByteBuffer>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public long
public boolean
release()

Overrides org.eclipse.jetty.io.AbstractRetainableByteBuffer.release.

Overrides default org.eclipse.jetty.io.Retainable.release.

Releases this resource, potentially decrementing a reference count (if any).

Inherited from org.eclipse.jetty.io.AbstractRetainableByteBuffer:
acquirecanRetaingetByteBufferisRetainedretaintoString

Field Detail

lastNanoTimeback to summary
private final AtomicLong lastNanoTime
releaserback to summary
private final Consumer<RetainableByteBuffer> releaser

Constructor Detail

Bufferback to summary
private Buffer(ByteBuffer buffer, Consumer<RetainableByteBuffer> releaser)

Method Detail

getLastNanoTimeback to summary
public long getLastNanoTime()
releaseback to summary
public boolean release()

Overrides org.eclipse.jetty.io.AbstractRetainableByteBuffer.release.

Overrides default org.eclipse.jetty.io.Retainable.release.

Doc from org.eclipse.jetty.io.Retainable.release.

Releases this resource, potentially decrementing a reference count (if any).

Returns:boolean

true when the reference count goes to zero or if there was no reference count, false otherwise.

Annotations
@Override
org.eclipse.jetty.io back to summary

public Class ArrayByteBufferPool.Quadratic

extends ArrayByteBufferPool
Class Inheritance

A variant of the ArrayByteBufferPool that uses buckets of buffers that increase in size by a power of 2 (eg 1k, 2k, 4k, 8k, etc.).

Field Summary

Inherited from org.eclipse.jetty.io.ArrayByteBufferPool:
DEFAULT_FACTORDEFAULT_MAX_CAPACITY_BY_FACTOR

Constructor Summary

AccessConstructor and Description
public
public
Quadratic(int minCapacity, int maxCapacity, int maxBucketSize)

public
Quadratic(int minCapacity, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory)

Method Summary

Inherited from org.eclipse.jetty.io.ArrayByteBufferPool:
acquireallocateallocateDirectcleardumpgetAvailableDirectByteBufferCountgetAvailableDirectMemorygetAvailableHeapByteBufferCountgetAvailableHeapMemorygetDirectByteBufferCountgetDirectMemorygetHeapByteBufferCountgetHeapMemorygetMaxCapacitygetMinCapacitypoolForremovedtoString

Constructor Detail

Quadraticback to summary
public Quadratic()
Quadraticback to summary
public Quadratic(int minCapacity, int maxCapacity, int maxBucketSize)
Quadraticback to summary
public Quadratic(int minCapacity, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory)
org.eclipse.jetty.io back to summary

private Class ArrayByteBufferPool.RetainedBucket

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final int
private final Pool<RetainableByteBuffer>

Constructor Summary

AccessConstructor and Description
private
RetainedBucket(int capacity, int poolSize)

Method Summary

Modifier and TypeMethod and Description
private Pool<RetainableByteBuffer>
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_capacityback to summary
private final int _capacity
_poolback to summary
private final Pool<RetainableByteBuffer> _pool

Constructor Detail

RetainedBucketback to summary
private RetainedBucket(int capacity, int poolSize)

Method Detail

getPoolback to summary
private Pool<RetainableByteBuffer> getPool()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.eclipse.jetty.io back to summary

public Class ArrayByteBufferPool.Tracking

extends ArrayByteBufferPool
Class Inheritance

A variant of ArrayByteBufferPool that tracks buffer acquires/releases, useful to identify buffer leaks.

Use getLeaks() when the system is idle to get the Buffers that have been leaked, which contain the stack trace information of where the buffer was acquired.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class

Field Summary

Modifier and TypeField and Description
private final Set<ArrayByteBufferPool.Tracking.Buffer>
private static final Logger
Inherited from org.eclipse.jetty.io.ArrayByteBufferPool:
DEFAULT_FACTORDEFAULT_MAX_CAPACITY_BY_FACTOR

Constructor Summary

AccessConstructor and Description
public
public
Tracking(int minCapacity, int maxCapacity, int maxBucketSize)

public
Tracking(int minCapacity, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory)

Method Summary

Modifier and TypeMethod and Description
public RetainableByteBuffer
acquire(int
The size of the buffer. The returned buffer will have at least this capacity.
size
,
boolean
true if a direct memory buffer is needed, false otherwise.
direct
)

Overrides org.eclipse.jetty.io.ArrayByteBufferPool.acquire.

Implements org.eclipse.jetty.io.ByteBufferPool.acquire.

Acquires a RetainableByteBuffer from this pool.

public String
public Set<ArrayByteBufferPool.Tracking.Buffer>
Inherited from org.eclipse.jetty.io.ArrayByteBufferPool:
allocateallocateDirectcleardumpgetAvailableDirectByteBufferCountgetAvailableDirectMemorygetAvailableHeapByteBufferCountgetAvailableHeapMemorygetDirectByteBufferCountgetDirectMemorygetHeapByteBufferCountgetHeapMemorygetMaxCapacitygetMinCapacitypoolForremovedtoString

Field Detail

buffersback to summary
private final Set<ArrayByteBufferPool.Tracking.Buffer> buffers
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.io.ArrayByteBufferPool.LOG.

Constructor Detail

Trackingback to summary
public Tracking()
Trackingback to summary
public Tracking(int minCapacity, int maxCapacity, int maxBucketSize)
Trackingback to summary
public Tracking(int minCapacity, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory)

Method Detail

acquireback to summary
public RetainableByteBuffer acquire(int size, boolean direct)

Overrides org.eclipse.jetty.io.ArrayByteBufferPool.acquire.

Implements org.eclipse.jetty.io.ByteBufferPool.acquire.

Doc from org.eclipse.jetty.io.ByteBufferPool.acquire.

Acquires a RetainableByteBuffer from this pool.

Parameters
size:int

The size of the buffer. The returned buffer will have at least this capacity.

direct:boolean

true if a direct memory buffer is needed, false otherwise.

Returns:RetainableByteBuffer

a RetainableByteBuffer with position and limit set to 0.

Annotations
@Override
dumpLeaksback to summary
public String dumpLeaks()
getLeaksback to summary
public Set<ArrayByteBufferPool.Tracking.Buffer> getLeaks()
org.eclipse.jetty.io back to summary

public Class ArrayByteBufferPool.Tracking.Buffer

extends Wrapper
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Instant
private final Throwable
private final List<Throwable>
private final List<Throwable>
private final List<Throwable>
private final int

Constructor Summary

AccessConstructor and Description
private
Buffer(RetainableByteBuffer wrapped, int size)

Method Summary

Modifier and TypeMethod and Description
public String
dump()

public Instant
public Throwable
public int
public boolean
release()

Overrides org.eclipse.jetty.io.Retainable.Wrapper.release.

Overrides default org.eclipse.jetty.io.Retainable.release.

Releases this resource, potentially decrementing a reference count (if any).

public void
retain()

Overrides org.eclipse.jetty.io.Retainable.Wrapper.retain.

Overrides default org.eclipse.jetty.io.Retainable.retain.

Retains this resource, potentially incrementing a reference count if there are resources that will be released.

Inherited from org.eclipse.jetty.io.RetainableByteBuffer.Wrapper:
capacitycleargetByteBuffergetWrappedhasRemainingisDirectisRetainedremaining

Field Detail

acquireInstantback to summary
private final Instant acquireInstant
acquireStackback to summary
private final Throwable acquireStack
overReleaseStacksback to summary
private final List<Throwable> overReleaseStacks
releaseStacksback to summary
private final List<Throwable> releaseStacks
retainStacksback to summary
private final List<Throwable> retainStacks
sizeback to summary
private final int size

Constructor Detail

Bufferback to summary
private Buffer(RetainableByteBuffer wrapped, int size)

Method Detail

dumpback to summary
public String dump()
getAcquireInstantback to summary
public Instant getAcquireInstant()
getAcquireStackback to summary
public Throwable getAcquireStack()
getSizeback to summary
public int getSize()
releaseback to summary
public boolean release()

Overrides org.eclipse.jetty.io.Retainable.Wrapper.release.

Overrides default org.eclipse.jetty.io.Retainable.release.

Doc from org.eclipse.jetty.io.Retainable.release.

Releases this resource, potentially decrementing a reference count (if any).

Returns:boolean

true when the reference count goes to zero or if there was no reference count, false otherwise.

Annotations
@Override
retainback to summary
public void retain()

Overrides org.eclipse.jetty.io.Retainable.Wrapper.retain.

Overrides default org.eclipse.jetty.io.Retainable.retain.

Doc from org.eclipse.jetty.io.Retainable.retain.

Retains this resource, potentially incrementing a reference count if there are resources that will be released.

Annotations
@Override