Class ChunkUtils
java.lang.Object
io.deephaven.engine.table.impl.util.ChunkUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static boolean
static boolean
contains
(DoubleChunk<? extends Any> chunk, double value) static boolean
contains
(FloatChunk<? extends Any> chunk, float value) static boolean
static boolean
static boolean
contains
(ObjectChunk<?, ? extends Any> chunk, Object value) static boolean
contains
(ShortChunk<? extends Any> chunk, short value) static void
copyData
(ChunkSource.WithPrev<? extends Values>[] sources, RowSequence srcAllKeys, WritableColumnSource<?>[] destinations, RowSequence destAllKeys, boolean usePrev) Copy data from sources to destinations for the provided source and destination keys.static void
copyData
(ChunkSource.WithPrev<? extends Values> src, RowSequence srcAllKeys, WritableColumnSource<?> dest, RowSequence destAllKeys, boolean usePrev) static String
static String
static String
static String
dumpChunk
(DoubleChunk<? extends Any> chunk) static String
dumpChunk
(FloatChunk<? extends Any> chunk) static String
static String
static String
dumpChunk
(ObjectChunk<?, ? extends Any> chunk) static String
dumpChunk
(ShortChunk<? extends Any> chunk) static String
extractKeyStringFromChunk
(Chunk<? extends Values> chunk, int chunkPosition) Produce a pretty key for error messages from an element within parallel chunks.static String
extractKeyStringFromChunk
(ChunkType keyChunkType, Chunk<? extends Values> chunk, int chunkPosition) Produce a pretty key for error messages from an element within parallel chunks.static String
extractKeyStringFromChunks
(ChunkType[] keyChunkTypes, Chunk<Values>[] chunks, int chunkPosition) Produce a pretty key for error messages from an element within parallel chunks.static <T extends Any>
voidfillInOrder
(@NotNull WritableIntChunk<T> inOrderChunk) FillinOrderChunk
with consecutive integers from 0..size() - 1.static <T extends Any>
voidfillInOrder
(@NotNull WritableLongChunk<T> inOrderChunk) FillinOrderChunk
with consecutive integers from 0..size() - 1.static <T extends Values>
voidfillWithNullValue
(ChunkSink<T> dest, RowSequence allKeys) static void
fillWithValidPositions
(@NotNull WritableIntChunk<? super ChunkPositions> inOrderChunk, @NotNull BooleanChunk<? extends Any> validity) FillinOrderChunk
with the positions ofvalidity
that holdtrue
, and set its size to the number of positions filled.static <T extends Any>
WritableIntChunk<T>makeInOrderIntChunk
(int chunkSize) Make a chunk of integers in order.
-
Constructor Details
-
ChunkUtils
public ChunkUtils()
-
-
Method Details
-
extractKeyStringFromChunks
public static String extractKeyStringFromChunks(ChunkType[] keyChunkTypes, Chunk<Values>[] chunks, int chunkPosition) Produce a pretty key for error messages from an element within parallel chunks. -
extractKeyStringFromChunk
public static String extractKeyStringFromChunk(ChunkType keyChunkType, Chunk<? extends Values> chunk, int chunkPosition) Produce a pretty key for error messages from an element within parallel chunks. -
extractKeyStringFromChunk
Produce a pretty key for error messages from an element within parallel chunks. -
dumpChunk
-
dumpChunk
-
dumpChunk
-
dumpChunk
-
dumpChunk
-
dumpChunk
-
dumpChunk
-
dumpChunk
-
dumpChunk
-
contains
-
contains
-
contains
-
contains
-
contains
-
contains
-
contains
-
contains
-
copyData
public static void copyData(ChunkSource.WithPrev<? extends Values> src, RowSequence srcAllKeys, WritableColumnSource<?> dest, RowSequence destAllKeys, boolean usePrev) - Parameters:
src
- The source of the data.srcAllKeys
- The source keys.dest
- The destination of the data (dest != src).destAllKeys
- The destination keys. It is ok for srcAllKeys == destAllKeys.usePrev
- Should we read previous values from src
-
copyData
public static void copyData(ChunkSource.WithPrev<? extends Values>[] sources, RowSequence srcAllKeys, WritableColumnSource<?>[] destinations, RowSequence destAllKeys, boolean usePrev) Copy data from sources to destinations for the provided source and destination keys. Sources and destinations must not overlap.- Parameters:
sources
- The sources of the data, parallel with destinationssrcAllKeys
- The source keys.destinations
- The destinations, parallel with sources, of the data (dest != src).destAllKeys
- The destination keys. It is ok for srcAllKeys == destAllKeys.usePrev
- Should we read previous values from src
-
fillWithNullValue
-
makeInOrderIntChunk
Make a chunk of integers in order.- Parameters:
chunkSize
- the size of the chunk to make- Returns:
- a chunk of integers from 0 to chunkSize - 1
-
fillInOrder
FillinOrderChunk
with consecutive integers from 0..size() - 1.- Parameters:
inOrderChunk
- the chunk to fill
-
fillInOrder
FillinOrderChunk
with consecutive integers from 0..size() - 1.- Parameters:
inOrderChunk
- the chunk to fill
-
fillWithValidPositions
public static void fillWithValidPositions(@NotNull @NotNull WritableIntChunk<? super ChunkPositions> inOrderChunk, @NotNull @NotNull BooleanChunk<? extends Any> validity) FillinOrderChunk
with the positions ofvalidity
that holdtrue
, and set its size to the number of positions filled.- Parameters:
inOrderChunk
- the chunk to fillvalidity
- the valid positions to fill from
-