Class CommitLogWriterFlushStrategy
java.lang.Object
io.debezium.connector.oracle.logminer.logwriter.CommitLogWriterFlushStrategy
- All Implemented Interfaces:
LogWriterFlushStrategy,AutoCloseable
A
LogWriterFlushStrategy that uses a transaction commit to force the provided
connection's Oracle LogWriter (LGWR) process to flush to disk.- Author:
- Chris Cranford
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final OracleConnectionprivate static final Stringprivate static final Stringprivate static final Stringprivate static final org.slf4j.Loggerprivate static final StringFields inherited from interface io.debezium.connector.oracle.logminer.logwriter.LogWriterFlushStrategy
LOGMNR_FLUSH_TABLE -
Constructor Summary
ConstructorsConstructorDescriptionCommitLogWriterFlushStrategy(OracleConnection connection) Creates a transaction-commit Oracle LogWriter (LGWR) process flush strategy.CommitLogWriterFlushStrategy(JdbcConfiguration jdbcConfig) Creates a transaction-commit Oracle LogWriter (LGWR) process flush strategy. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()private voidMakes sure that the flush table is created in the database and that it at least has 1 row of data so that when flushes occur that the update succeeds without failure.private voidCleans and resets the state of the flush table if multiple rows are detected.voidPerform the Oracle LGWR process flush.getHost()
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
CREATE_FLUSH_TABLE
- See Also:
-
INSERT_FLUSH_TABLE
- See Also:
-
UPDATE_FLUSH_TABLE
- See Also:
-
DELETE_FLUSH_TABLE
- See Also:
-
connection
-
closeConnectionOnClose
private final boolean closeConnectionOnClose
-
-
Constructor Details
-
CommitLogWriterFlushStrategy
Creates a transaction-commit Oracle LogWriter (LGWR) process flush strategy. This will use the existing database connection to make the flush and the connection will not be automatically closed when the strategy is closed.- Parameters:
connection- the connection to be used to force the flush, must not benull
-
CommitLogWriterFlushStrategy
Creates a transaction-commit Oracle LogWriter (LGWR) process flush strategy. This will create a new database connection based on the supplied JDBC configuration and the connection will automatically be closed when the strategy is closed.- Parameters:
jdbcConfig- the jdbc configuration- Throws:
SQLException- if there was a database problem
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getHost
- Specified by:
getHostin interfaceLogWriterFlushStrategy- Returns:
- the host or ip address that will be flushed by the strategy
-
flush
Description copied from interface:LogWriterFlushStrategyPerform the Oracle LGWR process flush.- Specified by:
flushin interfaceLogWriterFlushStrategy- Parameters:
currentScn- the current system change number
-
createFlushTableIfNotExists
private void createFlushTableIfNotExists()Makes sure that the flush table is created in the database and that it at least has 1 row of data so that when flushes occur that the update succeeds without failure. -
fixMultiRowDataBug
Cleans and resets the state of the flush table if multiple rows are detected. This bug was introduced in Debezium 1.7.0.Final by mistake and this function will self-correct the data managed by the table.- Throws:
SQLException- if a database exception occurs
-