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.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TableLoggerBase.Flags
Flags for controlling the transactional behavior of this log call.static interface
TableLoggerBase.Handle
Marker interface for log handlesstatic class
TableLoggerBase.Operation
Indicator of the source table update event that resulted in a log call. -
Field Summary
Fields Modifier and Type Field Description static TableLoggerBase.Flags
DEFAULT_TABLELOGGER_FLAGS
By default we will log each row independently. -
Method Summary
Modifier and Type Method Description TableLoggerBase.Handle
getLogHandle(Table tableToLog, Collection<String> keyColumns)
Gets a handle suitable for use with logTableHandle.default void
logTable(Table tableToLog)
Writes a snapshot oftableToLog
to the target.default void
logTable(Table tableToLog, TableLoggerBase.Flags flags)
Writes a snapshot oftableToLog
to the target.default void
logTable(Table tableToLog, TableLoggerBase.Flags flags, boolean logUpdates)
WritestableToLog
to the target.default void
logTable(Table tableToLog, TableLoggerBase.Flags flags, boolean logUpdates, boolean logPrevValues)
WritestableToLog
to the target.default void
logTable(Table tableToLog, TableLoggerBase.Flags flags, boolean logUpdates, boolean logPrevValues, Collection<String> keyColumns)
WritestableToLog
to the target.default void
logTable(Table tableToLog, TableLoggerBase.Flags flags, Index index)
Writes a subset oftableToLog
to the target.default void
logTable(Table tableToLog, Index index)
Writes a subset oftableToLog
to the binary log.default void
logTable(Table tableToLog, Index index, TableLoggerBase.Flags flags, boolean logUpdates, boolean logPrevValues)
Writes a subset oftableToLog
to the target.void
logTable(Table tableToLog, Index index, TableLoggerBase.Flags flags, boolean logUpdates, boolean logPrevValues, Collection<String> keyColumns)
Writes a subset oftableToLog
to the target.
-
Field Details
-
DEFAULT_TABLELOGGER_FLAGS
By default we will log each row independently.
-
-
Method Details
-
logTable
void logTable(Table tableToLog, Index index, TableLoggerBase.Flags flags, boolean logUpdates, boolean logPrevValues, Collection<String> keyColumns) throws IOExceptionWrites a subset oftableToLog
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 thekeyColumns
parameter. IfkeyColumns
is null, previous values for all columns are logged.- Parameters:
tableToLog
- the table to log, must conform to the definition used to create this loggerindex
- the subset of the table to logflags
- controls the transaction behaviorlogUpdates
- if true, continue to log updates to the tablelogPrevValues
- 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 IOExceptionWrites a subset oftableToLog
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. IflogPrevValues
is true, previous values for all columns are logged.- Parameters:
tableToLog
- the table to log, must conform to the definition used to create this loggerindex
- the subset of the table to logflags
- controls the transaction behaviorlogUpdates
- if true, continue to log updates to the tablelogPrevValues
- 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 IOExceptionWritestableToLog
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. IflogPrevValues
is true, previous values for all columns are logged.- Parameters:
tableToLog
- the table to log, must conform to the definition used to create this loggerflags
- controls the transaction behaviorlogUpdates
- if true, continue to log updates to the tablelogPrevValues
- 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 IOExceptionWritestableToLog
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 thekeyColumns
parameter. IfkeyColumns
is null, previous values for all columns are logged.- Parameters:
tableToLog
- the table to log, must conform to the definition used to create this loggerflags
- controls the transaction behaviorlogUpdates
- if true, continue to log updates to the tablelogPrevValues
- 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 IOExceptionWrites a subset oftableToLog
to the target.- Parameters:
tableToLog
- the table to log, must conform to the definition used to create this loggerflags
- controls the transaction behaviorindex
- 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 IOExceptionWritestableToLog
to the target. Optionally, continue to listen for updates and log them. Delegates tologTable(Table, Flags, boolean, boolean)
withlogPrevValues
set to true.- Parameters:
tableToLog
- the table to log, must conform to the definition used to create this loggerflags
- controls the transaction behaviorlogUpdates
- if true, continue to log updates to the table- Throws:
IOException
- if the log call fails
-
logTable
Writes a snapshot oftableToLog
to the target. Delegates tologTable(Table, Flags, boolean, boolean)
withlogUpdates
andlogPrevValues
set to false.- Parameters:
tableToLog
- the table to log, must conform to the definition used to create this loggerflags
- controls the transaction behavior- Throws:
IOException
- if the log call fails
-
logTable
Writes a snapshot oftableToLog
to the target. Delegates tologTable(Table, Flags)
withflags
set toDEFAULT_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
Writes a subset oftableToLog
to the binary log. Delegates tologTable(Table, Flags, Index)
withflags
set toDEFAULT_TABLELOGGER_FLAGS
.- Parameters:
tableToLog
- the table to log, must conform to the definition used to create this loggerindex
- which rows to log from the table (initial snapshot only)- Throws:
IOException
-
getLogHandle
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 loggerkeyColumns
- 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
-