Top Fields Constructors Methods
io.netty.buffer

pack-priv final Class PoolChunkList<T>

extends Object
implements PoolChunkListMetric
Class Inheritance
All Implemented Interfaces
io.netty.buffer.PoolChunkListMetric, java.lang.Iterable
Imports
io.netty.util.internal.StringUtil, java.util.ArrayList, .Collections, .Iterator, .List, java.nio.ByteBuffer

Field Summary

Modifier and TypeField and Description
private final PoolArena<T>
private static final Iterator<PoolChunkMetric>
private final int
private final int
private PoolChunk<T>
private final int
private final int
private final int
private final PoolChunkList<T>
private PoolChunkList<T>

Constructor Summary

AccessConstructor and Description
pack-priv
PoolChunkList(PoolArena<T> arena, PoolChunkList<T> nextList, int minUsage, int maxUsage, int chunkSize)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
add(PoolChunk<T> chunk)

pack-priv void
add0(PoolChunk<T> chunk)

Adds the PoolChunk to this PoolChunkList.

pack-priv boolean
allocate(PooledByteBuf<T> buf, int reqCapacity, int sizeIdx, PoolThreadCache threadCache)

private static int
calculateMaxCapacity(int minUsage, int chunkSize)

Calculates the maximum capacity of a buffer that will ever be possible to allocate out of the PoolChunks that belong to the PoolChunkList with the given minUsage and maxUsage settings.

pack-priv void
destroy(PoolArena<T> arena)

pack-priv boolean
free(PoolChunk<T> chunk, long handle, int normCapacity, ByteBuffer nioBuffer)

public Iterator<PoolChunkMetric>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public int
maxUsage()

Implements io.netty.buffer.PoolChunkListMetric.maxUsage.

Return the maximum usage of the chunk list after which chunks are promoted to the next list.
public int
minUsage()

Implements io.netty.buffer.PoolChunkListMetric.minUsage.

Return the minimum usage of the chunk list before which chunks are promoted to the previous list.
private static int
minUsage0(int value)

private boolean
move(PoolChunk<T> chunk)

private boolean
move0(PoolChunk<T> chunk)

Moves the PoolChunk down the PoolChunkList linked-list so it will end up in the right PoolChunkList that has the correct minUsage / maxUsage in respect to PoolChunk#usage().

pack-priv void
prevList(PoolChunkList<T> prevList)

private void
remove(PoolChunk<T> cur)

public String
toString()

Overrides java.lang.Object.toString.

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

Field Detail

arenaback to summary
private final PoolArena<T> arena
EMPTY_METRICSback to summary
private static final Iterator<PoolChunkMetric> EMPTY_METRICS
freeMaxThresholdback to summary
private final int freeMaxThreshold
freeMinThresholdback to summary
private final int freeMinThreshold
maxCapacityback to summary
private final int maxCapacity
maxUsageback to summary
private final int maxUsage
minUsageback to summary
private final int minUsage
nextListback to summary
private final PoolChunkList<T> nextList
prevListback to summary
private PoolChunkList<T> prevList

Constructor Detail

PoolChunkListback to summary
pack-priv PoolChunkList(PoolArena<T> arena, PoolChunkList<T> nextList, int minUsage, int maxUsage, int chunkSize)

Method Detail

addback to summary
pack-priv void add(PoolChunk<T> chunk)
add0back to summary
pack-priv void add0(PoolChunk<T> chunk)

Adds the PoolChunk to this PoolChunkList.

allocateback to summary
pack-priv boolean allocate(PooledByteBuf<T> buf, int reqCapacity, int sizeIdx, PoolThreadCache threadCache)
calculateMaxCapacityback to summary
private static int calculateMaxCapacity(int minUsage, int chunkSize)

Calculates the maximum capacity of a buffer that will ever be possible to allocate out of the PoolChunks that belong to the PoolChunkList with the given minUsage and maxUsage settings.

destroyback to summary
pack-priv void destroy(PoolArena<T> arena)
freeback to summary
pack-priv boolean free(PoolChunk<T> chunk, long handle, int normCapacity, ByteBuffer nioBuffer)
iteratorback to summary
public Iterator<PoolChunkMetric> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<PoolChunkMetric>

an Iterator.

Annotations
@Override
maxUsageback to summary
public int maxUsage()

Implements io.netty.buffer.PoolChunkListMetric.maxUsage.

Doc from io.netty.buffer.PoolChunkListMetric.maxUsage.

Return the maximum usage of the chunk list after which chunks are promoted to the next list.

Annotations
@Override
minUsageback to summary
public int minUsage()

Implements io.netty.buffer.PoolChunkListMetric.minUsage.

Doc from io.netty.buffer.PoolChunkListMetric.minUsage.

Return the minimum usage of the chunk list before which chunks are promoted to the previous list.

Annotations
@Override
minUsage0back to summary
private static int minUsage0(int value)
moveback to summary
private boolean move(PoolChunk<T> chunk)
move0back to summary
private boolean move0(PoolChunk<T> chunk)

Moves the PoolChunk down the PoolChunkList linked-list so it will end up in the right PoolChunkList that has the correct minUsage / maxUsage in respect to PoolChunk#usage().

prevListback to summary
pack-priv void prevList(PoolChunkList<T> prevList)
removeback to summary
private void remove(PoolChunk<T> cur)
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