Class LogMinerHelper
- java.lang.Object
-
- io.debezium.connector.oracle.logminer.LogMinerHelper
-
public class LogMinerHelper extends Object
This class contains methods to configure and manage LogMiner utility
-
-
Constructor Summary
Constructors Constructor Description LogMinerHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private 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.static List<LogFile>getLogFilesForOffsetScn(OracleConnection connection, Scn offsetScn, Duration archiveLogRetention, boolean archiveLogOnlyMode, String archiveDestinationName)Get all log files that should be mined.private static ScngetScnFromString(String value)(package private) static voidlogError(OracleStreamingChangeEventSourceMetrics streamingMetrics, String format, Object... args)(package private) static voidlogWarn(OracleStreamingChangeEventSourceMetrics streamingMetrics, String format, Object... args)static voidremoveLogFilesFromMining(OracleConnection conn)This method removes all added log files from miningstatic voidsetLogFilesForMining(OracleConnection connection, Scn lastProcessedScn, Duration archiveLogRetention, boolean archiveLogOnlyMode, String archiveDestinationName)This method substitutes CONTINUOUS_MINE functionality
-
-
-
Field Detail
-
CURRENT
private static final String CURRENT
- See Also:
- Constant Field Values
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Method Detail
-
setLogFilesForMining
public static void setLogFilesForMining(OracleConnection connection, Scn lastProcessedScn, Duration archiveLogRetention, boolean archiveLogOnlyMode, String archiveDestinationName) 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 benull- Throws:
SQLException- if anything unexpected happens
-
logWarn
static void logWarn(OracleStreamingChangeEventSourceMetrics streamingMetrics, String format, Object... args)
-
logError
static void logError(OracleStreamingChangeEventSourceMetrics streamingMetrics, String format, Object... args)
-
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
-
removeLogFilesFromMining
public static void removeLogFilesFromMining(OracleConnection conn) throws SQLException
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
public static int getColumnIndexByName(String columnName, Table table)
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
-
-