Class CommitLogWriterFlushStrategy
- java.lang.Object
-
- io.debezium.connector.oracle.logminer.logwriter.CommitLogWriterFlushStrategy
-
- All Implemented Interfaces:
LogWriterFlushStrategy,AutoCloseable
public class CommitLogWriterFlushStrategy extends Object implements LogWriterFlushStrategy
ALogWriterFlushStrategythat uses a transaction commit to force the provided connection's Oracle LogWriter (LGWR) process to flush to disk.- Author:
- Chris Cranford
-
-
Field Summary
Fields Modifier and Type Field Description private booleancloseConnectionOnCloseprivate OracleConnectionconnectionprivate static StringCREATE_FLUSH_TABLEprivate static StringINSERT_FLUSH_TABLEprivate static StringUPDATE_FLUSH_TABLE-
Fields inherited from interface io.debezium.connector.oracle.logminer.logwriter.LogWriterFlushStrategy
LOGMNR_FLUSH_TABLE
-
-
Constructor Summary
Constructors Constructor Description CommitLogWriterFlushStrategy(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()private voidcreateFlushTableIfNotExists()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.voidflush(Scn currentScn)Perform the Oracle LGWR process flush.StringgetHost()
-
-
-
Field Detail
-
CREATE_FLUSH_TABLE
private static final String CREATE_FLUSH_TABLE
- See Also:
- Constant Field Values
-
INSERT_FLUSH_TABLE
private static final String INSERT_FLUSH_TABLE
- See Also:
- Constant Field Values
-
UPDATE_FLUSH_TABLE
private static final String UPDATE_FLUSH_TABLE
- See Also:
- Constant Field Values
-
connection
private final OracleConnection connection
-
closeConnectionOnClose
private final boolean closeConnectionOnClose
-
-
Constructor Detail
-
CommitLogWriterFlushStrategy
public CommitLogWriterFlushStrategy(OracleConnection connection)
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
public CommitLogWriterFlushStrategy(JdbcConfiguration jdbcConfig) throws SQLException
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 Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
getHost
public String getHost()
- Specified by:
getHostin interfaceLogWriterFlushStrategy- Returns:
- the host or ip address that will be flushed by the strategy
-
flush
public void flush(Scn currentScn)
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.
-
-