public class LogMinerStreamingChangeEventSource extends Object implements io.debezium.pipeline.source.spi.StreamingChangeEventSource<io.debezium.connector.oracle.OraclePartition,io.debezium.connector.oracle.OracleOffsetContext>
StreamingChangeEventSource
based on Oracle's LogMiner
utility. The event handler loop is executed in a separate executor.
Diff: Make createProcessor method as protected to produce a LogMinerEventProcessor with enhanced processRow method to distinguish whether is bounded.
Constructor and Description |
---|
LogMinerStreamingChangeEventSource(io.debezium.connector.oracle.OracleConnectorConfig connectorConfig,
io.debezium.connector.oracle.OracleConnection jdbcConnection,
io.debezium.pipeline.EventDispatcher<io.debezium.connector.oracle.OraclePartition,io.debezium.relational.TableId> dispatcher,
io.debezium.pipeline.ErrorHandler errorHandler,
io.debezium.util.Clock clock,
io.debezium.connector.oracle.OracleDatabaseSchema schema,
io.debezium.config.Configuration jdbcConfig,
io.debezium.connector.oracle.OracleStreamingChangeEventSourceMetrics streamingMetrics) |
Modifier and Type | Method and Description |
---|---|
void |
commitOffset(Map<String,?> offset) |
protected io.debezium.connector.oracle.logminer.processor.LogMinerEventProcessor |
createProcessor(io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext context,
io.debezium.connector.oracle.OraclePartition partition,
io.debezium.connector.oracle.OracleOffsetContext offsetContext) |
void |
endMiningSession(io.debezium.connector.oracle.OracleConnection connection,
io.debezium.connector.oracle.OracleOffsetContext offsetContext)
End the current Oracle LogMiner session, if one is in progress.
|
void |
execute(io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext context,
io.debezium.connector.oracle.OraclePartition partition,
io.debezium.connector.oracle.OracleOffsetContext offsetContext)
This is the loop to get changes from LogMiner.
|
boolean |
startMiningSession(io.debezium.connector.oracle.OracleConnection connection,
io.debezium.connector.oracle.Scn startScn,
io.debezium.connector.oracle.Scn endScn,
int attempts)
Starts a new Oracle LogMiner session.
|
public LogMinerStreamingChangeEventSource(io.debezium.connector.oracle.OracleConnectorConfig connectorConfig, io.debezium.connector.oracle.OracleConnection jdbcConnection, io.debezium.pipeline.EventDispatcher<io.debezium.connector.oracle.OraclePartition,io.debezium.relational.TableId> dispatcher, io.debezium.pipeline.ErrorHandler errorHandler, io.debezium.util.Clock clock, io.debezium.connector.oracle.OracleDatabaseSchema schema, io.debezium.config.Configuration jdbcConfig, io.debezium.connector.oracle.OracleStreamingChangeEventSourceMetrics streamingMetrics)
public void execute(io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext context, io.debezium.connector.oracle.OraclePartition partition, io.debezium.connector.oracle.OracleOffsetContext offsetContext)
execute
in interface io.debezium.pipeline.source.spi.StreamingChangeEventSource<io.debezium.connector.oracle.OraclePartition,io.debezium.connector.oracle.OracleOffsetContext>
context
- change event source contextprotected io.debezium.connector.oracle.logminer.processor.LogMinerEventProcessor createProcessor(io.debezium.pipeline.source.spi.ChangeEventSource.ChangeEventSourceContext context, io.debezium.connector.oracle.OraclePartition partition, io.debezium.connector.oracle.OracleOffsetContext offsetContext)
public boolean startMiningSession(io.debezium.connector.oracle.OracleConnection connection, io.debezium.connector.oracle.Scn startScn, io.debezium.connector.oracle.Scn endScn, int attempts) throws SQLException
When this is called, LogMiner prepares all the necessary state for an upcoming LogMiner view query. If the mining statement defines using DDL tracking, the data dictionary will be mined as a part of this call to prepare DDL tracking state for the upcoming LogMiner view query.
connection
- database connection, should not be null
startScn
- mining session's starting system change number (exclusive), should not be
null
endScn
- mining session's ending system change number (inclusive), can be null
attempts
- the number of mining start attemptsSQLException
- if mining session failed to startpublic void endMiningSession(io.debezium.connector.oracle.OracleConnection connection, io.debezium.connector.oracle.OracleOffsetContext offsetContext) throws SQLException
connection
- database connection, should not be null
offsetContext
- connector offset context, should not be null
SQLException
- if the current mining session cannot be ended gracefullyCopyright © 2024 The Apache Software Foundation. All rights reserved.