Interface TableLoggerBase

All Known Subinterfaces:
TableLogger
All Known Implementing Classes:
JdbcLogger, ProcessTelemetryFormat1Logger

public interface TableLoggerBase
A base interface for loggers that log snapshots and/or updates to Deephaven tables. Implementations of this may target either another Deephaven table or external consumers. For convenience, a number of default methods are provided that delegate to the final implementation of the logTable method.
  • Field Details

  • Method Details

    • logTable

      void logTable​(Table tableToLog, Index index, TableLoggerBase.Flags flags, boolean logUpdates, boolean logPrevValues, Collection<String> keyColumns) throws IOException
      Writes a subset of tableToLog to the target. Optionally, continue to listen for updates and log them. Also optionally, log the previous values as a separate row when rows are modified or removed. When logging previous values, only a subset of columns may be necessary to identify the row, specified with the keyColumns parameter. If keyColumns is null, previous values for all columns are logged.
      Parameters:
      tableToLog - the table to log, must conform to the definition used to create this logger
      index - the subset of the table to log
      flags - controls the transaction behavior
      logUpdates - if true, continue to log updates to the table
      logPrevValues - if true, log the old version of each row when rows are modified (only applicable when logUpdates is true)
      keyColumns - if not null, gives the columns for which to log previous values on remove and row modification (only applicable if logPrevValues is true)
      Throws:
      IOException - if the log call fails
    • logTable

      default void logTable​(Table tableToLog, Index index, TableLoggerBase.Flags flags, boolean logUpdates, boolean logPrevValues) throws IOException
      Writes a subset of tableToLog to the target. Optionally, continue to listen for updates and log them. Also optionally, log the previous values as a separate row when rows are modified or removed. If logPrevValues is true, previous values for all columns are logged.
      Parameters:
      tableToLog - the table to log, must conform to the definition used to create this logger
      index - the subset of the table to log
      flags - controls the transaction behavior
      logUpdates - if true, continue to log updates to the table
      logPrevValues - if true, log the old version of each row when rows are modified (only applicable when logUpdates is true)
      Throws:
      IOException - if the log call fails
    • logTable

      default void logTable​(Table tableToLog, TableLoggerBase.Flags flags, boolean logUpdates, boolean logPrevValues) throws IOException
      Writes tableToLog to the target. Optionally, continue to listen for updates and log them. Also optionally, log the previous values as a separate row when rows are modified or removed. If logPrevValues is true, previous values for all columns are logged.
      Parameters:
      tableToLog - the table to log, must conform to the definition used to create this logger
      flags - controls the transaction behavior
      logUpdates - if true, continue to log updates to the table
      logPrevValues - if true, log the old version of each row when rows are modified (only applicable when logUpdates is true)
      Throws:
      IOException - if the log call fails
    • logTable

      default void logTable​(Table tableToLog, TableLoggerBase.Flags flags, boolean logUpdates, boolean logPrevValues, Collection<String> keyColumns) throws IOException
      Writes tableToLog to the target. Optionally, continue to listen for updates and log them. Also optionally, log the previous values as a separate row when rows are modified or removed. When logging previous values, only a subset of columns may be necessary to identify the row, specified with the keyColumns parameter. If keyColumns is null, previous values for all columns are logged.
      Parameters:
      tableToLog - the table to log, must conform to the definition used to create this logger
      flags - controls the transaction behavior
      logUpdates - if true, continue to log updates to the table
      logPrevValues - if true, log the old version of each row when rows are modified (only applicable when logUpdates is true)
      keyColumns - if specified (not null), gives the columns for which to log previous values on remove and row modification (only applicable if logPrevValues is true)
      Throws:
      IOException - if the log call fails
    • logTable

      default void logTable​(Table tableToLog, TableLoggerBase.Flags flags, Index index) throws IOException
      Writes a subset of tableToLog to the target.
      Parameters:
      tableToLog - the table to log, must conform to the definition used to create this logger
      flags - controls the transaction behavior
      index - the subset of the table to log
      Throws:
      IOException - if the log call fails
    • logTable

      default void logTable​(Table tableToLog, TableLoggerBase.Flags flags, boolean logUpdates) throws IOException
      Writes tableToLog to the target. Optionally, continue to listen for updates and log them. Delegates to logTable(Table, Flags, boolean, boolean) with logPrevValues set to true.
      Parameters:
      tableToLog - the table to log, must conform to the definition used to create this logger
      flags - controls the transaction behavior
      logUpdates - if true, continue to log updates to the table
      Throws:
      IOException - if the log call fails
    • logTable

      default void logTable​(Table tableToLog, TableLoggerBase.Flags flags) throws IOException
      Writes a snapshot of tableToLog to the target. Delegates to logTable(Table, Flags, boolean, boolean) with logUpdates and logPrevValues set to false.
      Parameters:
      tableToLog - the table to log, must conform to the definition used to create this logger
      flags - controls the transaction behavior
      Throws:
      IOException - if the log call fails
    • logTable

      default void logTable​(Table tableToLog) throws IOException
      Writes a snapshot of tableToLog to the target. Delegates to logTable(Table, Flags) with flags set to DEFAULT_TABLELOGGER_FLAGS.
      Parameters:
      tableToLog - the table to log, must conform to the definition used to create this logger
      Throws:
      IOException - if the log call fails
    • logTable

      default void logTable​(Table tableToLog, Index index) throws IOException
      Writes a subset of tableToLog to the binary log. Delegates to logTable(Table, Flags, Index) with flags set to DEFAULT_TABLELOGGER_FLAGS.
      Parameters:
      tableToLog - the table to log, must conform to the definition used to create this logger
      index - which rows to log from the table (initial snapshot only)
      Throws:
      IOException
    • getLogHandle

      TableLoggerBase.Handle getLogHandle​(Table tableToLog, Collection<String> keyColumns)
      Gets a handle suitable for use with logTableHandle. If you are repeatedly logging rows from a table, it is more efficient to check the definition once rather than on each log call.
      Parameters:
      tableToLog - the table to log, must conform to the definition used to create this logger
      keyColumns - if not null, gives the columns for which to log previous values on remove and row modification
      Returns:
      a handle that can be passed into logTableHandle, with dummy column sources for previous columns not specified