Package io.deephaven.chunk.util.pools
Class MultiChunkPool
java.lang.Object
io.deephaven.chunk.util.pools.MultiChunkPool
- All Implemented Interfaces:
BooleanChunkPool
,ByteChunkPool
,CharChunkPool
,DoubleChunkPool
,FloatChunkPool
,IntChunkPool
,LongChunkPool
,ObjectChunkPool
,ShortChunkPool
public final class MultiChunkPool
extends Object
implements BooleanChunkPool, ByteChunkPool, CharChunkPool, ShortChunkPool, IntChunkPool, LongChunkPool, FloatChunkPool, DoubleChunkPool, ObjectChunkPool
Provides a set of per-type
ChunkPool
s. Normally accessed via a ThreadLocal
, to allow some threads to
share a common pool and others to allocate their own.-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static MultiChunkPool
getChunkPool
(@NotNull ChunkType chunkType) <ATTR extends Any>
ResettableBooleanChunk<ATTR>Take aResettableBooleanChunk
.<ATTR extends Any>
ResettableByteChunk<ATTR>Take aResettableByteChunk
.<ATTR extends Any>
ResettableCharChunk<ATTR>Take aResettableCharChunk
.<ATTR extends Any>
ResettableDoubleChunk<ATTR>Take aResettableDoubleChunk
.<ATTR extends Any>
ResettableFloatChunk<ATTR>Take aResettableFloatChunk
.<ATTR extends Any>
ResettableIntChunk<ATTR>Take aResettableIntChunk
.<ATTR extends Any>
ResettableLongChunk<ATTR>Take aResettableLongChunk
.<TYPE,
ATTR extends Any>
ResettableObjectChunk<TYPE,ATTR> Take aResettableObjectChunk
of at least the specifiedcapacity
.<ATTR extends Any>
ResettableShortChunk<ATTR>Take aResettableShortChunk
.<ATTR extends Any>
ResettableWritableBooleanChunk<ATTR>Take aResettableWritableBooleanChunk
.<ATTR extends Any>
ResettableWritableByteChunk<ATTR>Take aResettableWritableByteChunk
.<ATTR extends Any>
ResettableWritableCharChunk<ATTR>Take aResettableWritableCharChunk
.<ATTR extends Any>
ResettableWritableDoubleChunk<ATTR>Take aResettableWritableDoubleChunk
.<ATTR extends Any>
ResettableWritableFloatChunk<ATTR>Take aResettableWritableFloatChunk
.<ATTR extends Any>
ResettableWritableIntChunk<ATTR>Take aResettableWritableIntChunk
.<ATTR extends Any>
ResettableWritableLongChunk<ATTR>Take aResettableWritableLongChunk
.<TYPE,
ATTR extends Any>
ResettableWritableObjectChunk<TYPE,ATTR> Take aResettableWritableObjectChunk
of at least the specifiedcapacity
.<ATTR extends Any>
ResettableWritableShortChunk<ATTR>Take aResettableWritableShortChunk
.<ATTR extends Any>
WritableBooleanChunk<ATTR>takeWritableBooleanChunk
(int capacity) Take aWritableBooleanChunk
of at least the specifiedcapacity
.<ATTR extends Any>
WritableByteChunk<ATTR>takeWritableByteChunk
(int capacity) Take aWritableByteChunk
of at least the specifiedcapacity
.<ATTR extends Any>
WritableCharChunk<ATTR>takeWritableCharChunk
(int capacity) Take aWritableCharChunk
of at least the specifiedcapacity
.<ATTR extends Any>
WritableDoubleChunk<ATTR>takeWritableDoubleChunk
(int capacity) Take aWritableDoubleChunk
of at least the specifiedcapacity
.<ATTR extends Any>
WritableFloatChunk<ATTR>takeWritableFloatChunk
(int capacity) Take aWritableFloatChunk
of at least the specifiedcapacity
.<ATTR extends Any>
WritableIntChunk<ATTR>takeWritableIntChunk
(int capacity) Take aWritableIntChunk
of at least the specifiedcapacity
.<ATTR extends Any>
WritableLongChunk<ATTR>takeWritableLongChunk
(int capacity) Take aWritableLongChunk
of at least the specifiedcapacity
.<TYPE,
ATTR extends Any>
WritableObjectChunk<TYPE,ATTR> takeWritableObjectChunk
(int capacity) Take aWritableObjectChunk
of at least the specifiedcapacity
.<ATTR extends Any>
WritableShortChunk<ATTR>takeWritableShortChunk
(int capacity) Take aWritableShortChunk
of at least the specifiedcapacity
.
-
Method Details
-
enableDedicatedPoolForThisThread
public static void enableDedicatedPoolForThisThread() -
forThisThread
-
getChunkPool
-
getBooleanChunkPool
-
getCharChunkPool
-
getByteChunkPool
-
getShortChunkPool
-
getIntChunkPool
-
getLongChunkPool
-
getFloatChunkPool
-
getDoubleChunkPool
-
getObjectChunkPool
-
asChunkPool
- Specified by:
asChunkPool
in interfaceBooleanChunkPool
- Specified by:
asChunkPool
in interfaceByteChunkPool
- Specified by:
asChunkPool
in interfaceCharChunkPool
- Specified by:
asChunkPool
in interfaceDoubleChunkPool
- Specified by:
asChunkPool
in interfaceFloatChunkPool
- Specified by:
asChunkPool
in interfaceIntChunkPool
- Specified by:
asChunkPool
in interfaceLongChunkPool
- Specified by:
asChunkPool
in interfaceObjectChunkPool
- Specified by:
asChunkPool
in interfaceShortChunkPool
- Returns:
- This BooleanChunkPool as a
ChunkPool
. This is useful for passing this pool to methods that expect aChunkPool
but do not need to know the specific type.
-
takeWritableBooleanChunk
Description copied from interface:BooleanChunkPool
Take aWritableBooleanChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeWritableBooleanChunk
in interfaceBooleanChunkPool
- Parameters:
capacity
- The minimum capacity for the result- Returns:
- A
WritableBooleanChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-
takeResettableBooleanChunk
Description copied from interface:BooleanChunkPool
Take aResettableBooleanChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableBooleanChunk
in interfaceBooleanChunkPool
- Returns:
- A
ResettableBooleanChunk
that belongs to the caller untilclosed
-
takeResettableWritableBooleanChunk
Description copied from interface:BooleanChunkPool
Take aResettableWritableBooleanChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableWritableBooleanChunk
in interfaceBooleanChunkPool
- Returns:
- A
ResettableWritableBooleanChunk
that belongs to the caller untilclosed
-
takeWritableCharChunk
Description copied from interface:CharChunkPool
Take aWritableCharChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeWritableCharChunk
in interfaceCharChunkPool
- Parameters:
capacity
- The minimum capacity for the result- Returns:
- A
WritableCharChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-
takeResettableCharChunk
Description copied from interface:CharChunkPool
Take aResettableCharChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableCharChunk
in interfaceCharChunkPool
- Returns:
- A
ResettableCharChunk
that belongs to the caller untilclosed
-
takeResettableWritableCharChunk
Description copied from interface:CharChunkPool
Take aResettableWritableCharChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableWritableCharChunk
in interfaceCharChunkPool
- Returns:
- A
ResettableWritableCharChunk
that belongs to the caller untilclosed
-
takeWritableByteChunk
Description copied from interface:ByteChunkPool
Take aWritableByteChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeWritableByteChunk
in interfaceByteChunkPool
- Parameters:
capacity
- The minimum capacity for the result- Returns:
- A
WritableByteChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-
takeResettableByteChunk
Description copied from interface:ByteChunkPool
Take aResettableByteChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableByteChunk
in interfaceByteChunkPool
- Returns:
- A
ResettableByteChunk
that belongs to the caller untilclosed
-
takeResettableWritableByteChunk
Description copied from interface:ByteChunkPool
Take aResettableWritableByteChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableWritableByteChunk
in interfaceByteChunkPool
- Returns:
- A
ResettableWritableByteChunk
that belongs to the caller untilclosed
-
takeWritableShortChunk
Description copied from interface:ShortChunkPool
Take aWritableShortChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeWritableShortChunk
in interfaceShortChunkPool
- Parameters:
capacity
- The minimum capacity for the result- Returns:
- A
WritableShortChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-
takeResettableShortChunk
Description copied from interface:ShortChunkPool
Take aResettableShortChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableShortChunk
in interfaceShortChunkPool
- Returns:
- A
ResettableShortChunk
that belongs to the caller untilclosed
-
takeResettableWritableShortChunk
Description copied from interface:ShortChunkPool
Take aResettableWritableShortChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableWritableShortChunk
in interfaceShortChunkPool
- Returns:
- A
ResettableWritableShortChunk
that belongs to the caller untilclosed
-
takeWritableIntChunk
Description copied from interface:IntChunkPool
Take aWritableIntChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeWritableIntChunk
in interfaceIntChunkPool
- Parameters:
capacity
- The minimum capacity for the result- Returns:
- A
WritableIntChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-
takeResettableIntChunk
Description copied from interface:IntChunkPool
Take aResettableIntChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableIntChunk
in interfaceIntChunkPool
- Returns:
- A
ResettableIntChunk
that belongs to the caller untilclosed
-
takeResettableWritableIntChunk
Description copied from interface:IntChunkPool
Take aResettableWritableIntChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableWritableIntChunk
in interfaceIntChunkPool
- Returns:
- A
ResettableWritableIntChunk
that belongs to the caller untilclosed
-
takeWritableLongChunk
Description copied from interface:LongChunkPool
Take aWritableLongChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeWritableLongChunk
in interfaceLongChunkPool
- Parameters:
capacity
- The minimum capacity for the result- Returns:
- A
WritableLongChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-
takeResettableLongChunk
Description copied from interface:LongChunkPool
Take aResettableLongChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableLongChunk
in interfaceLongChunkPool
- Returns:
- A
ResettableLongChunk
that belongs to the caller untilclosed
-
takeResettableWritableLongChunk
Description copied from interface:LongChunkPool
Take aResettableWritableLongChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableWritableLongChunk
in interfaceLongChunkPool
- Returns:
- A
ResettableWritableLongChunk
that belongs to the caller untilclosed
-
takeWritableFloatChunk
Description copied from interface:FloatChunkPool
Take aWritableFloatChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeWritableFloatChunk
in interfaceFloatChunkPool
- Parameters:
capacity
- The minimum capacity for the result- Returns:
- A
WritableFloatChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-
takeResettableFloatChunk
Description copied from interface:FloatChunkPool
Take aResettableFloatChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableFloatChunk
in interfaceFloatChunkPool
- Returns:
- A
ResettableFloatChunk
that belongs to the caller untilclosed
-
takeResettableWritableFloatChunk
Description copied from interface:FloatChunkPool
Take aResettableWritableFloatChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableWritableFloatChunk
in interfaceFloatChunkPool
- Returns:
- A
ResettableWritableFloatChunk
that belongs to the caller untilclosed
-
takeWritableDoubleChunk
Description copied from interface:DoubleChunkPool
Take aWritableDoubleChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeWritableDoubleChunk
in interfaceDoubleChunkPool
- Parameters:
capacity
- The minimum capacity for the result- Returns:
- A
WritableDoubleChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-
takeResettableDoubleChunk
Description copied from interface:DoubleChunkPool
Take aResettableDoubleChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableDoubleChunk
in interfaceDoubleChunkPool
- Returns:
- A
ResettableDoubleChunk
that belongs to the caller untilclosed
-
takeResettableWritableDoubleChunk
Description copied from interface:DoubleChunkPool
Take aResettableWritableDoubleChunk
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableWritableDoubleChunk
in interfaceDoubleChunkPool
- Returns:
- A
ResettableWritableDoubleChunk
that belongs to the caller untilclosed
-
takeWritableObjectChunk
public <TYPE,ATTR extends Any> WritableObjectChunk<TYPE,ATTR> takeWritableObjectChunk(int capacity) Description copied from interface:ObjectChunkPool
Take aWritableObjectChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeWritableObjectChunk
in interfaceObjectChunkPool
- Parameters:
capacity
- The minimum capacity for the result- Returns:
- A
WritableObjectChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-
takeResettableObjectChunk
Description copied from interface:ObjectChunkPool
Take aResettableObjectChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableObjectChunk
in interfaceObjectChunkPool
- Returns:
- A
ResettableObjectChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-
takeResettableWritableObjectChunk
public <TYPE,ATTR extends Any> ResettableWritableObjectChunk<TYPE,ATTR> takeResettableWritableObjectChunk()Description copied from interface:ObjectChunkPool
Take aResettableWritableObjectChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableWritableObjectChunk
in interfaceObjectChunkPool
- Returns:
- A
ResettableWritableObjectChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-