Class LogMinerQueryResultProcessor
- java.lang.Object
-
- io.debezium.connector.oracle.logminer.LogMinerQueryResultProcessor
-
class LogMinerQueryResultProcessor extends Object
This class process entries obtained from LogMiner view. It parses each entry. On each DML it registers a callback in TransactionalBuffer. On rollback it removes registered entries from TransactionalBuffer. On commit it executes all registered callbacks, which dispatch ChangeRecords. This also calculates metrics
-
-
Field Summary
Fields Modifier and Type Field Description private OracleConnectorConfigconnectorConfigprivate ChangeEventSource.ChangeEventSourceContextcontextprivate ScncurrentOffsetCommitScnprivate ScncurrentOffsetScnprivate EventDispatcher<TableId>dispatcherprivate DmlParserdmlParserprivate HistoryRecorderhistoryRecorderprivate static org.slf4j.LoggerLOGGERprivate OracleOffsetContextoffsetContextprivate OracleDatabaseSchemaschemaprivate SelectLobParserselectLobParserprivate OracleStreamingChangeEventSourceMetricsstreamingMetricsprivate longstuckScnCounterprivate TransactionalBuffertransactionalBuffer
-
Constructor Summary
Constructors Constructor Description LogMinerQueryResultProcessor(ChangeEventSource.ChangeEventSourceContext context, OracleConnectorConfig connectorConfig, OracleStreamingChangeEventSourceMetrics streamingMetrics, TransactionalBuffer transactionalBuffer, OracleOffsetContext offsetContext, OracleDatabaseSchema schema, EventDispatcher<TableId> dispatcher, HistoryRecorder historyRecorder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private TabledispatchSchemaChangeEventAndGetTableForNewCapturedTable(TableId tableId)private StringgetTableMetadataDdl(TableId tableId)private booleanhasNext(ResultSet resultSet)private static booleanisDmlOperation(int operationCode)private LogMinerDmlEntryparse(String redoSql, Table table, String txId)(package private) voidprocessResult(ResultSet resultSet)This method does all the jobprivate static DmlParserresolveParser(OracleConnectorConfig connectorConfig, OracleValueConverters valueConverters)private voidwarnStuckScn()This method is warning if a long running transaction is discovered and could be abandoned in the future.
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
context
private final ChangeEventSource.ChangeEventSourceContext context
-
streamingMetrics
private final OracleStreamingChangeEventSourceMetrics streamingMetrics
-
transactionalBuffer
private final TransactionalBuffer transactionalBuffer
-
dmlParser
private final DmlParser dmlParser
-
offsetContext
private final OracleOffsetContext offsetContext
-
schema
private final OracleDatabaseSchema schema
-
dispatcher
private final EventDispatcher<TableId> dispatcher
-
connectorConfig
private final OracleConnectorConfig connectorConfig
-
historyRecorder
private final HistoryRecorder historyRecorder
-
selectLobParser
private final SelectLobParser selectLobParser
-
currentOffsetScn
private Scn currentOffsetScn
-
currentOffsetCommitScn
private Scn currentOffsetCommitScn
-
stuckScnCounter
private long stuckScnCounter
-
-
Constructor Detail
-
LogMinerQueryResultProcessor
LogMinerQueryResultProcessor(ChangeEventSource.ChangeEventSourceContext context, OracleConnectorConfig connectorConfig, OracleStreamingChangeEventSourceMetrics streamingMetrics, TransactionalBuffer transactionalBuffer, OracleOffsetContext offsetContext, OracleDatabaseSchema schema, EventDispatcher<TableId> dispatcher, HistoryRecorder historyRecorder)
-
-
Method Detail
-
resolveParser
private static DmlParser resolveParser(OracleConnectorConfig connectorConfig, OracleValueConverters valueConverters)
-
processResult
void processResult(ResultSet resultSet) throws SQLException
This method does all the job- Parameters:
resultSet- the info from LogMiner view- Throws:
SQLException- thrown if any database exception occurs
-
hasNext
private boolean hasNext(ResultSet resultSet) throws SQLException
- Throws:
SQLException
-
dispatchSchemaChangeEventAndGetTableForNewCapturedTable
private Table dispatchSchemaChangeEventAndGetTableForNewCapturedTable(TableId tableId) throws SQLException
- Throws:
SQLException
-
getTableMetadataDdl
private String getTableMetadataDdl(TableId tableId) throws SQLException
- Throws:
SQLException
-
warnStuckScn
private void warnStuckScn()
This method is warning if a long running transaction is discovered and could be abandoned in the future. The criteria is the offset SCN remains the same in 25 mining cycles
-
parse
private LogMinerDmlEntry parse(String redoSql, Table table, String txId)
-
isDmlOperation
private static boolean isDmlOperation(int operationCode)
-
-