Class SnapshotUtils
java.lang.Object
io.deephaven.engine.table.impl.snapshot.SnapshotUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
copyDataColumns
(@NotNull Map<String, ChunkSource.WithPrev<? extends Values>> srcColumns, @NotNull RowSet srcRowSet, @NotNull Map<String, ? extends WritableColumnSource<?>> destColumns, @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).static void
copyStampColumns
(@NotNull Map<String, ? extends ColumnSource<?>> stampColumns, long stampKey, @NotNull Map<String, ? extends WritableColumnSource<?>> destColumns, @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.static void
copyStampColumns
(@NotNull Map<String, ? extends ColumnSource<?>> stampColumns, long stampKey, @NotNull Map<String, SingleValueColumnSource<?>> destColumns) Like the above, but with a singleton destination.createColumnSourceMap
(Map<String, ? extends ColumnSource<?>> columns, BiFunction<Class<?>, Class<?>, T> factory) Creates a new columnSourceMap based on 'columns'.static @NotNull Map<String,
ChunkSource.WithPrev<? extends Values>> generateSnapshotDataColumns
(Table table) static @NotNull Map<String,
? extends ColumnSource<?>> generateTriggerStampColumns
(Table table) static @NotNull ColumnSource<?>
maybeTransformToDirectVectorColumnSource
(ColumnSource<?> columnSource) static void
setNullStampColumns
(@NotNull Map<String, ? extends ColumnSource<?>> stampColumns, @NotNull Map<String, SingleValueColumnSource<?>> destColumns) Like the above, but with a singleton destination that will be set to the appropriatenull
value.
-
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 datastampKey
- The source keydestColumns
- The destination columns we are "spraying" todestRowSet
- 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 datastampKey
- The source keydestColumns
- 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 appropriatenull
value.- Parameters:
stampColumns
- The stamp columns that serve as the source datadestColumns
- 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 datasrcRowSet
- The keys in the srcColumns we are reading fromdestColumns
- The destination columns we are writing todestRowSet
- 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)
-