Class PrevTableTools

java.lang.Object
io.deephaven.engine.table.impl.PrevTableTools

@InternalUseOnly public final class PrevTableTools extends Object
Tools for presenting the previous state of a table, as PrevColumnSource presents the previous values of a column. A view of the previous state is good for one update cycle only.
  • Method Details

    • prevTable

      public static Table prevTable(@NotNull @NotNull Table table)
      Make a view of the previous state of table, good only during the updating phase of the current update cycle: the rows of the previous row set, and the previous value of each column.

      The view drifts once the cycle ends. The view copies the previous row set once, when made, but the columns read previous values on every access, and those values become the current values when the cycle ends. The previous row set and the previous column values agree only during the updating phase: during the idle phase that follows a cycle, a column's previous values are the current values, but a tracking row set's previous row set can still be the row set from before the cycle. So make the view only during the updating phase, use the view only within the operation that makes the view, and never publish the view. A snapshot that uses previous values meets these conditions, since the snapshot discards any attempt that a cycle boundary interrupts.

      A column of tracking row sets, such as the row set column of a data index table, presents previous row sets only if the column's previous values are the row sets' previous row sets, as a RowSetColumnSourceWrapper column's are. Those previous row sets are valid only during the updating phase as well.

      The view wraps concrete column sources, so prevTable coalesces table first. The view carries every attribute of the coalesced table, and is flat if the coalesced table is flat.

      Parameters:
      table - The table
      Returns:
      table itself if table is static; otherwise a static table over the previous state of table, good only during the updating phase of the current update cycle