Class TickSuppressor

java.lang.Object
com.illumon.iris.db.util.TickSuppressor

public class TickSuppressor
extends Object
Tools for reducing the number of ticks generated by a table.
  • Method Details

    • convertModificationsToAddsAndRemoves

      public static Table convertModificationsToAddsAndRemoves​(Table input)
      For shift aware listeners, the modified column set cannot mark particular rows and columns dirty; only all of the columns in the modified rows. However, rows can be both removed and added and those rows do not affect the modified column set.

      If you have a table that has a small number of modified rows with many modified columns; and join on a right-hand side that modifies many rows, but few columns; downstream operations must treat all rows and columns in the cross product as modified.

      This utility function will convert all modified rows to added and removed rows, such that downstream operations can modify rows without additionally marking the columns of this table dirty.

      Parameters:
      input - an input table
      Returns:
      an output table that will produce no modified rows, but rather adds and removes instead
    • removeSpuriousModifications

      public static Table removeSpuriousModifications​(Table input)
      Removes spurious modifications from an update.

      The Deephaven query engine guarantees that any row or column that has been modified, must be marked modified in an update. However, for efficiency, it does not guarantee that only rows with changed data are marked as modified. There are cases where a query writer would like to remove spurious modifications. For example if a downstream listener is sending network messages eliminating additional messages may be worthwhile.

      This function produces a new query table with the same contents as the original query table. For each modified row and column, if a row has not actually been modified or a column has no modifications; then remove the modification from the downstream update.

      Parameters:
      input - an input table
      Returns:
      an output table where the set of modified rows and columns is restricted to cells where current and previous values are not identical
    • removeSpuriousModifications

      public static Table removeSpuriousModifications​(Table input, String... ignoreColumns)
      Removes spurious modifications from an update.

      The Deephaven query engine guarantees that any row or column that has been modified, must be marked modified in an update. However, for efficiency, it does not guarantee that only rows with changed data are marked as modified. There are cases where a query writer would like to remove spurious modifications. For example if a downstream listener is sending network messages eliminating additional messages may be worthwhile.

      This function allows some of the input columns to be ignored. For example, many Deephaven ingesters log a Timestamp column on each row. If the remaining fields of a row are unchanged, it may not be necessary to process further query logic on that row. To ensure proper table semantics, a copy of the ignored columns is made on each tick that is passed through to the result table.

      This function produces a new query table with the same contents as the original query table (except for ignored columns, which may be an older value). For each modified row and column, if a row has not actually been modified or a column has no modifications; then remove the modification from the downstream update.

      Parameters:
      input - an input table
      ignoreColumns - a list of columns to ignore for modification purposes
      Returns:
      an output table where the set of modified rows and columns is restricted to cells where current and previous values are not identical