Class SnapshotUtils

java.lang.Object
com.illumon.iris.db.v2.snapshot.SnapshotUtils

public class SnapshotUtils
extends Object
  • Constructor Details

  • 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 Map<String,​? extends ColumnSource> stampColumns, long stampKey, @NotNull Map<String,​? extends WritableSource> destColumns, @NotNull Index destIndex)
      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 'destIndex') 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
      destIndex - The keys in destColumns we want to write to
    • copyStampColumns

      public static void copyStampColumns​(@NotNull Map<String,​? extends ColumnSource> stampColumns, long stampKey, @NotNull Map<String,​? extends WritableSource> destColumns, long destKey)
      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 to
      destKey - The key in destColumns we want to write to
    • copyDataColumns

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