Class LogMinerHelper
java.lang.Object
io.debezium.connector.oracle.logminer.LogMinerHelper
This class contains methods to configure and manage LogMiner utility
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidexecuteCallableStatement(OracleConnection connection, String statement) static intgetColumnIndexByName(String columnName, Table table) Returns a 0-based index offset for the column name in the relational table.getLogFilesForOffsetScn(OracleConnection connection, Scn offsetScn, Duration archiveLogRetention, boolean archiveLogOnlyMode, String archiveDestinationName) Get all log files that should be mined.private static ScngetMinimumScn(List<LogFile> logs) private static ScngetScnFromString(String value) static booleanhasLogFilesStartingBeforeOrAtScn(List<LogFile> logs, Scn scn) static voidThis method removes all added log files from miningsetLogFilesForMining(OracleConnection connection, Scn lastProcessedScn, Duration archiveLogRetention, boolean archiveLogOnlyMode, String archiveDestinationName, int maxRetries, Duration initialDelay, Duration maxDelay) This method substitutes CONTINUOUS_MINE functionality
-
Field Details
-
CURRENT
- See Also:
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
LogMinerHelper
public LogMinerHelper()
-
-
Method Details
-
setLogFilesForMining
public static List<LogFile> setLogFilesForMining(OracleConnection connection, Scn lastProcessedScn, Duration archiveLogRetention, boolean archiveLogOnlyMode, String archiveDestinationName, int maxRetries, Duration initialDelay, Duration maxDelay) throws SQLException This method substitutes CONTINUOUS_MINE functionality- Parameters:
connection- connectionlastProcessedScn- current offsetarchiveLogRetention- the duration that archive logs will be minedarchiveLogOnlyMode- true to mine only archive lgos, false to mine all available logsarchiveDestinationName- configured archive log destination name to use, may benullmaxRetries- the number of retry attempts before giving up and throwing an exception about log stateinitialDelay- the initial delaymaxDelay- the maximum delay- Returns:
- log files that were added to the current mining session
- Throws:
SQLException- if anything unexpected happens
-
hasLogFilesStartingBeforeOrAtScn
@VisibleForTesting public static boolean hasLogFilesStartingBeforeOrAtScn(List<LogFile> logs, Scn scn) -
getMinimumScn
-
getLogFilesForOffsetScn
public static List<LogFile> getLogFilesForOffsetScn(OracleConnection connection, Scn offsetScn, Duration archiveLogRetention, boolean archiveLogOnlyMode, String archiveDestinationName) throws SQLException Get all log files that should be mined.- Parameters:
connection- database connectionoffsetScn- offset system change numberarchiveLogRetention- duration that archive logs should be minedarchiveLogOnlyMode- true to mine only archive logs, false to mine all available logsarchiveDestinationName- archive destination to use, may benull- Returns:
- list of log files
- Throws:
SQLException- if a database exception occurs
-
getScnFromString
-
removeLogFilesFromMining
This method removes all added log files from mining- Parameters:
conn- connection- Throws:
SQLException- something happened
-
executeCallableStatement
private static void executeCallableStatement(OracleConnection connection, String statement) throws SQLException - Throws:
SQLException
-
getColumnIndexByName
Returns a 0-based index offset for the column name in the relational table.- Parameters:
columnName- the column name, should not benull.table- the relational table, should not benull.- Returns:
- the 0-based index offset for the column name
-