Class AbstractLogMinerEventProcessor

    • Method Detail

      • isRecentlyCommitted

        protected boolean isRecentlyCommitted​(String transactionId)
        Check whether a transaction has been recently committed. Any implementation that does not support recently-committed tracking should return false.
        Parameters:
        transactionId - the unique transaction id
        Returns:
        true if the transaction has been recently committed, false otherwise
      • hasSchemaChangeBeenSeen

        protected boolean hasSchemaChangeBeenSeen​(LogMinerEventRow row)
        Checks whether the LogMinerEvent row for a schema change can be emitted.
        Parameters:
        row - the result set row
        Returns:
        true if the schema change has been seen, false otherwise.
      • isTransactionIdAllowed

        protected boolean isTransactionIdAllowed​(String transactionId)
        Return whether a give transaction can be added to the processor's buffer. The default implementation is to allow all transaction ids.
        Parameters:
        transactionId - the unique transaction id
        Returns:
        whether a transaction id can be added to the processor's buffer
      • getTransactionCache

        protected abstract TransactionCache<?> getTransactionCache()
        Returns the TransactionCache implementation.
        Returns:
        the transaction cache, never null
      • isTrxIdRawValue

        protected boolean isTrxIdRawValue()
      • handleMissingScn

        protected void handleMissingScn​(LogMinerEventRow row)
        Handle processing a LogMinerEventRow for a MISSING_SCN event.
        Parameters:
        row - the result set row
      • handleStart

        protected void handleStart​(LogMinerEventRow row)
        Handle processing a LogMinerEventRow for a START event.
        Parameters:
        row - the result set row
      • handleCommit

        protected abstract void handleCommit​(LogMinerEventRow row)
                                      throws InterruptedException
        Handle processing a LogMinerEventRow for a COMMIT event.
        Parameters:
        row - the result set row
        Throws:
        InterruptedException - if the event dispatcher was interrupted sending events
      • handleRollback

        protected void handleRollback​(LogMinerEventRow row)
        Handle processing a LogMinerEventRow for a ROLLBACK event. The default implementation is a no-op.
        Parameters:
        row - the result set row
      • handleSchemaChange

        protected void handleSchemaChange​(LogMinerEventRow row)
                                   throws InterruptedException
        Handle processing a LogMinerEventRow for a DDL event.
        Parameters:
        row - the result set row
        Throws:
        InterruptedException - if the event dispatcher is interrupted sending the event
      • handleSelectLobLocator

        protected void handleSelectLobLocator​(LogMinerEventRow row)
        Handle processing a LogMinerEventRow for a SEL_LOB_LOCATOR event.
        Parameters:
        row - the result set row
      • handleLobWrite

        protected void handleLobWrite​(LogMinerEventRow row)
        Handle processing a LogMinerEventRow for a LOB_WRITE event.
        Parameters:
        row - the result set row
      • handleLobErase

        private void handleLobErase​(LogMinerEventRow row)
        Handle processing a LogMinerEventRow for a LOB_ERASE event.
        Parameters:
        row - the result set row
      • warnPotentiallyStuckScn

        protected void warnPotentiallyStuckScn​(Scn previousOffsetScn,
                                               Scn previousOffsetCommitScn)
        Checks to see whether the offset's scn is remaining the same across multiple mining sessions while the offset's commit_scn is changing between sessions.
        Parameters:
        previousOffsetScn - the previous offset system change number
        previousOffsetCommitScn - the previous offset commit system change number
      • hasNextWithMetricsUpdate

        private boolean hasNextWithMetricsUpdate​(ResultSet resultSet)
                                          throws SQLException
        Checks whether the result-set has any more data available. When a new row is available, the streaming metrics is updated with the fetch timings.
        Parameters:
        resultSet - the result set to check if any more rows exist
        Returns:
        true if another row exists, false otherwise
        Throws:
        SQLException - if there was a database exception
      • addToTransaction

        protected void addToTransaction​(String transactionId,
                                        LogMinerEventRow row,
                                        Supplier<LogMinerEvent> eventSupplier)
        Add a transaction to the transaction map if allowed.
        Parameters:
        transactionId - the unqiue transaction id
        row - the LogMiner event row
        eventSupplier - the supplier of the event to create if the event is allowed to be added
      • dispatchSchemaChangeEventAndGetTableForNewCapturedTable

        private Table dispatchSchemaChangeEventAndGetTableForNewCapturedTable​(TableId tableId,
                                                                              OracleOffsetContext offsetContext,
                                                                              EventDispatcher<TableId> dispatcher)
                                                                       throws SQLException,
                                                                              InterruptedException
        Dispatch a schema change event for a new table and get the newly created relational table model.
        Parameters:
        tableId - the unique table identifier, must not be null
        offsetContext - the offset context
        dispatcher - the event dispatcher
        Returns:
        the relational table model
        Throws:
        SQLException - if a database exception occurred
        InterruptedException - if the event dispatch was interrupted
      • getTableMetadataDdl

        private String getTableMetadataDdl​(TableId tableId)
                                    throws SQLException
        Get the specified table's create DDL statement.
        Parameters:
        tableId - the table identifier, must not be null
        Returns:
        the table's create DDL statement, never null
        Throws:
        SQLException - if an exception occurred obtaining the DDL statement
      • parseDmlStatement

        private LogMinerDmlEntry parseDmlStatement​(String redoSql,
                                                   Table table,
                                                   String transactionId)
        Parse a DML redo SQL statement.
        Parameters:
        redoSql - the redo SQL statement
        table - the table the SQL statement is for
        transactionId - the associated transaction id for the SQL statement
        Returns:
        a parse object for the redo SQL statement
      • parseLobWriteSql

        private String parseLobWriteSql​(String sql)
        Parses a LOB_WRITE operation SQL fragment.
        Parameters:
        sql - sql statement
        Returns:
        the parsed statement
        Throws:
        io.debezium.DebeziumException - if an unexpected SQL fragment is provided that cannot be parsed