Class StreamChunkUtils

java.lang.Object
io.deephaven.stream.StreamChunkUtils

public class StreamChunkUtils extends Object
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 Details

    • StreamChunkUtils

      public StreamChunkUtils()
  • Method Details

    • chunkTypeForColumnIndex

      @NotNull public static @NotNull ChunkType chunkTypeForColumnIndex(@NotNull @NotNull TableDefinition tableDefinition, int columnIndex)
      Return the ChunkType for a given column index in the specified TableDefinition.
      Parameters:
      tableDefinition - the TableDefinition
      columnIndex - the column index to get the ChunkType 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 specified TableDefinition.
      Parameters:
      definition - the TableDefinition to make chunks for
      size - the size of the returned chunks
      Returns:
      an array of writable chunks
    • replacementType

      public static Class<?> replacementType(@NotNull @NotNull Class<?> columnDataType)
      For storage, we substitute long and byte for Instant and Boolean, 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