Class ChunkUtils

java.lang.Object
io.deephaven.engine.table.impl.util.ChunkUtils

public class ChunkUtils extends Object
  • 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

      public static String extractKeyStringFromChunk(Chunk<? extends Values> chunk, int chunkPosition)
      Produce a pretty key for error messages from an element within parallel chunks.
    • dumpChunk

      public static String dumpChunk(Chunk<? extends Any> chunk)
    • dumpChunk

      public static String dumpChunk(CharChunk<? extends Any> chunk)
    • dumpChunk

      public static String dumpChunk(ByteChunk<? extends Any> chunk)
    • dumpChunk

      public static String dumpChunk(ShortChunk<? extends Any> chunk)
    • dumpChunk

      public static String dumpChunk(IntChunk<? extends Any> chunk)
    • dumpChunk

      public static String dumpChunk(LongChunk<? extends Any> chunk)
    • dumpChunk

      public static String dumpChunk(FloatChunk<? extends Any> chunk)
    • dumpChunk

      public static String dumpChunk(DoubleChunk<? extends Any> chunk)
    • dumpChunk

      public static String dumpChunk(ObjectChunk<?,? extends Any> chunk)
    • contains

      public static boolean contains(CharChunk<? extends Any> chunk, char value)
    • contains

      public static boolean contains(ByteChunk<? extends Any> chunk, byte value)
    • contains

      public static boolean contains(ShortChunk<? extends Any> chunk, short value)
    • contains

      public static boolean contains(IntChunk<? extends Any> chunk, int value)
    • contains

      public static boolean contains(LongChunk<? extends Any> chunk, long value)
    • contains

      public static boolean contains(FloatChunk<? extends Any> chunk, float value)
    • contains

      public static boolean contains(DoubleChunk<? extends Any> chunk, double value)
    • contains

      public static boolean contains(ObjectChunk<?,? extends Any> chunk, Object value)
    • 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 destinations
      srcAllKeys - 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

      public static <T extends Values> void fillWithNullValue(ChunkSink<T> dest, RowSequence allKeys)
    • makeInOrderIntChunk

      public static <T extends Any> WritableIntChunk<T> makeInOrderIntChunk(int chunkSize)
      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

      public static <T extends Any> void fillInOrder(@NotNull @NotNull WritableIntChunk<T> inOrderChunk)
      Fill inOrderChunk with consecutive integers from 0..size() - 1.
      Parameters:
      inOrderChunk - the chunk to fill
    • fillInOrder

      public static <T extends Any> void fillInOrder(@NotNull @NotNull WritableLongChunk<T> inOrderChunk)
      Fill inOrderChunk 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)
      Fill inOrderChunk with the positions of validity that hold true, and set its size to the number of positions filled.
      Parameters:
      inOrderChunk - the chunk to fill
      validity - the valid positions to fill from