Package io.deephaven.stream
Class StreamChunkUtils
java.lang.Object
io.deephaven.stream.StreamChunkUtils
Common utilities to support stream ingestion to
chunks
, which is an important building block.
Includes support for determining ingestion chunk types
and allocating ingestion chunks. These
utilities establish "standard" data type
to chunk type mappings.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ChunkType
chunkTypeForColumnIndex
(@NotNull TableDefinition tableDefinition, int columnIndex) Return theChunkType
for a given column index in the specifiedTableDefinition
.static <ATTR extends Any>
@NotNull WritableChunk<ATTR>[]makeChunksForDefinition
(@NotNull TableDefinition definition, int size) Make output chunks for the specifiedTableDefinition
.static Class<?>
replacementType
(@NotNull Class<?> columnDataType)
-
Constructor Details
-
StreamChunkUtils
public StreamChunkUtils()
-
-
Method Details
-
chunkTypeForColumnIndex
@NotNull public static @NotNull ChunkType chunkTypeForColumnIndex(@NotNull @NotNull TableDefinition tableDefinition, int columnIndex) Return theChunkType
for a given column index in the specifiedTableDefinition
.- Parameters:
tableDefinition
- theTableDefinition
columnIndex
- the column index to get theChunkType
for- Returns:
- the
ChunkType
for the specified column
-
makeChunksForDefinition
@NotNull public static <ATTR extends Any> @NotNull WritableChunk<ATTR>[] makeChunksForDefinition(@NotNull @NotNull TableDefinition definition, int size) Make output chunks for the specifiedTableDefinition
.- Parameters:
definition
- theTableDefinition
to make chunks forsize
- the size of the returned chunks- Returns:
- an array of writable chunks
-
replacementType
For storage, we substitutelong
andbyte
forInstant
andBoolean
, respectively. We expect ingesters to pass us primitive chunks for those types.- Parameters:
columnDataType
- the "external" column data type- Returns:
- the "internal" data type to be supplied
-