public class LogMinerStreamingChangeEventSource extends Object implements StreamingChangeEventSource
StreamingChangeEventSource based on Oracle's LogMiner utility.
The event handler loop is executed in a separate executor.ChangeEventSource.ChangeEventSourceContext| Modifier and Type | Field and Description |
|---|---|
private Duration |
archiveLogRetention |
private Clock |
clock |
private OracleConnectorConfig |
connectorConfig |
private List<BigInteger> |
currentRedoLogSequences |
private EventDispatcher<TableId> |
dispatcher |
private Scn |
endScn |
private ErrorHandler |
errorHandler |
private boolean |
isContinuousMining |
private boolean |
isRac |
private JdbcConfiguration |
jdbcConfiguration |
private OracleConnection |
jdbcConnection |
private static org.slf4j.Logger |
LOGGER |
private OracleOffsetContext |
offsetContext |
private Set<String> |
racHosts |
private OracleDatabaseSchema |
schema |
private Scn |
startScn |
private OracleConnectorConfig.LogMiningStrategy |
strategy |
private OracleStreamingChangeEventSourceMetrics |
streamingMetrics |
private OracleTaskContext |
taskContext |
| Constructor and Description |
|---|
LogMinerStreamingChangeEventSource(OracleConnectorConfig connectorConfig,
OracleOffsetContext offsetContext,
OracleConnection jdbcConnection,
EventDispatcher<TableId> dispatcher,
ErrorHandler errorHandler,
Clock clock,
OracleDatabaseSchema schema,
OracleTaskContext taskContext,
Configuration jdbcConfig,
OracleStreamingChangeEventSourceMetrics streamingMetrics) |
| Modifier and Type | Method and Description |
|---|---|
private void |
abandonOldTransactionsIfExist(OracleConnection connection,
TransactionalBuffer transactionalBuffer) |
void |
commitOffset(Map<String,?> offset) |
void |
execute(ChangeEventSource.ChangeEventSourceContext context)
This is the loop to get changes from LogMiner
|
private List<BigInteger> |
getCurrentRedoLogSequences()
Get the current redo log sequence(s).
|
private boolean |
hasLogSwitchOccurred()
Checks whether a database log switch has occurred and updates metrics if so.
|
private void |
initializeRedoLogsForMining(OracleConnection connection,
boolean postEndMiningSession,
Duration archiveLogRetention) |
private void |
pauseBetweenMiningSessions() |
private static final org.slf4j.Logger LOGGER
private final OracleConnection jdbcConnection
private final EventDispatcher<TableId> dispatcher
private final Clock clock
private final OracleDatabaseSchema schema
private final OracleOffsetContext offsetContext
private final boolean isRac
private final JdbcConfiguration jdbcConfiguration
private final OracleConnectorConfig.LogMiningStrategy strategy
private final OracleTaskContext taskContext
private final ErrorHandler errorHandler
private final boolean isContinuousMining
private final OracleStreamingChangeEventSourceMetrics streamingMetrics
private final OracleConnectorConfig connectorConfig
private final Duration archiveLogRetention
private Scn startScn
private Scn endScn
private List<BigInteger> currentRedoLogSequences
public LogMinerStreamingChangeEventSource(OracleConnectorConfig connectorConfig, OracleOffsetContext offsetContext, OracleConnection jdbcConnection, EventDispatcher<TableId> dispatcher, ErrorHandler errorHandler, Clock clock, OracleDatabaseSchema schema, OracleTaskContext taskContext, Configuration jdbcConfig, OracleStreamingChangeEventSourceMetrics streamingMetrics)
public void execute(ChangeEventSource.ChangeEventSourceContext context)
execute in interface StreamingChangeEventSourcecontext - change event source contextprivate void abandonOldTransactionsIfExist(OracleConnection connection, TransactionalBuffer transactionalBuffer)
private void initializeRedoLogsForMining(OracleConnection connection, boolean postEndMiningSession, Duration archiveLogRetention) throws SQLException
SQLExceptionprivate boolean hasLogSwitchOccurred()
throws SQLException
true if a log switch was detected, otherwise falseSQLException - if a database exception occurredprivate List<BigInteger> getCurrentRedoLogSequences() throws SQLException
SQLException - if a database exception occurredprivate void pauseBetweenMiningSessions()
throws InterruptedException
InterruptedExceptionpublic void commitOffset(Map<String,?> offset)
commitOffset in interface StreamingChangeEventSourceCopyright © 2021 JBoss by Red Hat. All rights reserved.