Class RacCommitLogWriterFlushStrategy
- java.lang.Object
-
- io.debezium.connector.oracle.logminer.logwriter.RacCommitLogWriterFlushStrategy
-
- All Implemented Interfaces:
LogWriterFlushStrategy,AutoCloseable
public class RacCommitLogWriterFlushStrategy extends Object implements LogWriterFlushStrategy
ALogWriterFlushStrategyfor Oracle RAC that performs a transaction-scoped commit to flush the Oracle LogWriter (LGWR) process on each RAC node. This strategy builds atop ofCommitLogWriterFlushStrategyby creating a commit strategy to each Oracle RAC node and orchestrating the flushes simultaneously for each node when a flush is needed. In the event that a node fails to flush, this strategy will delay for 3 seconds to allow Oracle to automatically flush the buffers before proceeding.- Author:
- Chris Cranford
-
-
Field Summary
Fields Modifier and Type Field Description private Map<String,CommitLogWriterFlushStrategy>flushStrategiesprivate Set<String>hostsprivate JdbcConfigurationjdbcConfigurationprivate static org.slf4j.LoggerLOGGERprivate OracleStreamingChangeEventSourceMetricsstreamingMetrics-
Fields inherited from interface io.debezium.connector.oracle.logminer.logwriter.LogWriterFlushStrategy
LOGMNR_FLUSH_TABLE
-
-
Constructor Summary
Constructors Constructor Description RacCommitLogWriterFlushStrategy(OracleConnectorConfig connectorConfig, JdbcConfiguration jdbcConfig, OracleStreamingChangeEventSourceMetrics streamingMetrics)Creates an Oracle RAC LogWriter (LGWR) flushing strategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()private voidcloseRacNodeFlushStrategies()Closes the RAC node flush strategies.private CommitLogWriterFlushStrategycreateHostFlushStrategy(String hostName, Integer port)voidflush(Scn currentScn)Perform the Oracle LGWR process flush.StringgetHost()private voidrecreateRacNodeFlushStrategies()
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
flushStrategies
private final Map<String,CommitLogWriterFlushStrategy> flushStrategies
-
streamingMetrics
private final OracleStreamingChangeEventSourceMetrics streamingMetrics
-
jdbcConfiguration
private final JdbcConfiguration jdbcConfiguration
-
-
Constructor Detail
-
RacCommitLogWriterFlushStrategy
public RacCommitLogWriterFlushStrategy(OracleConnectorConfig connectorConfig, JdbcConfiguration jdbcConfig, OracleStreamingChangeEventSourceMetrics streamingMetrics)
Creates an Oracle RAC LogWriter (LGWR) flushing strategy.- Parameters:
connectorConfig- the connector configuration, must not benulljdbcConfig- the mining session JDBC connection configuration, must not benullstreamingMetrics- the streaming metrics, must not benull
-
-
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) throws InterruptedException
Description copied from interface:LogWriterFlushStrategyPerform the Oracle LGWR process flush.- Specified by:
flushin interfaceLogWriterFlushStrategy- Parameters:
currentScn- the current system change number- Throws:
InterruptedException
-
recreateRacNodeFlushStrategies
private void recreateRacNodeFlushStrategies()
-
createHostFlushStrategy
private CommitLogWriterFlushStrategy createHostFlushStrategy(String hostName, Integer port) throws SQLException
- Throws:
SQLException
-
closeRacNodeFlushStrategies
private void closeRacNodeFlushStrategies()
Closes the RAC node flush strategies.
-
-