Class SnapshotUtils

java.lang.Object
io.deephaven.engine.table.impl.snapshot.SnapshotUtils

public class SnapshotUtils extends Object
  • Constructor Details

    • SnapshotUtils

      public SnapshotUtils()
  • Method Details

    • createColumnSourceMap

      public static <T> Map<String,T> createColumnSourceMap(Map<String,? extends ColumnSource<?>> columns, BiFunction<Class<?>,Class<?>,T> factory)
      Creates a new columnSourceMap based on 'columns'.
    • copyStampColumns

      public static void copyStampColumns(@NotNull @NotNull Map<String,? extends ColumnSource<?>> stampColumns, long stampKey, @NotNull @NotNull Map<String,? extends WritableColumnSource<?>> destColumns, @NotNull @NotNull RowSet destRowSet)
      For each name in stampColumns: - identify a stamp source (namely 'stampColumns.get(name)') - a row in that stamp source (namely 'stampKey') - a stamp dest (namely the column identified by 'destColumns.get(name)') - a bunch of destination rows (namely all the rows defined in 'destRowSet') Then "spray" that single source value over those destination values.
      Parameters:
      stampColumns - The stamp columns that serve as the source data
      stampKey - The source key
      destColumns - The destination columns we are "spraying" to
      destRowSet - The keys in destColumns we want to write to
    • copyStampColumns

      public static void copyStampColumns(@NotNull @NotNull Map<String,? extends ColumnSource<?>> stampColumns, long stampKey, @NotNull @NotNull Map<String,SingleValueColumnSource<?>> destColumns)
      Like the above, but with a singleton destination. For each name in stampColumns: - identify a stamp source (namely 'stampColumns.get(name)') - a row in that stamp source (namely 'stampKey') - a stamp dest (namely the column identified by 'destColumns.get(name)') - a row in the destination (namely 'destKey') Then copy the source value to the destination value.
      Parameters:
      stampColumns - The stamp columns that serve as the source data
      stampKey - The source key
      destColumns - The destination columns we are writing to
    • setNullStampColumns

      public static void setNullStampColumns(@NotNull @NotNull Map<String,? extends ColumnSource<?>> stampColumns, @NotNull @NotNull Map<String,SingleValueColumnSource<?>> destColumns)
      Like the above, but with a singleton destination that will be set to the appropriate null value.
      Parameters:
      stampColumns - The stamp columns that serve as the source data
      destColumns - The destination columns we are writing to
    • copyDataColumns

      public static void copyDataColumns(@NotNull @NotNull Map<String,ChunkSource.WithPrev<? extends Values>> srcColumns, @NotNull @NotNull RowSet srcRowSet, @NotNull @NotNull Map<String,? extends WritableColumnSource<?>> destColumns, @NotNull @NotNull RowSet destRowSet, boolean usePrev)
      For each name in srcColumns, copy all the data at srcColumns.get(name) (with a range of rows defined by srcRowSet) to a column indicated by destColumns.get(name) (with a range of rows defined by destRowSet).
      Parameters:
      srcColumns - The stamp columns that serve as the source data
      srcRowSet - The keys in the srcColumns we are reading from
      destColumns - The destination columns we are writing to
      destRowSet - The keys in destColumns we want to write to
    • generateSnapshotDataColumns

      @NotNull public static @NotNull Map<String,ChunkSource.WithPrev<? extends Values>> generateSnapshotDataColumns(Table table)
    • generateTriggerStampColumns

      @NotNull public static @NotNull Map<String,? extends ColumnSource<?>> generateTriggerStampColumns(Table table)
    • maybeTransformToDirectVectorColumnSource

      @NotNull public static @NotNull ColumnSource<?> maybeTransformToDirectVectorColumnSource(ColumnSource<?> columnSource)