Class RowMapper
- java.lang.Object
-
- io.debezium.connector.oracle.logminer.RowMapper
-
public class RowMapper extends Object
A utility class to map LogMiner content resultSet values. This class gracefully logs errors, loosing an entry is not critical. The loss will be logged
-
-
Field Summary
Fields Modifier and Type Field Description private static intCHANGE_TIMEstatic intCOMMITprivate static intCSFstatic intDDLstatic intDELETEstatic intINSERTstatic intLOB_ERASEstatic intLOB_WRITEprivate static org.slf4j.LoggerLOGGERstatic intMISSING_SCNprivate static intOPERATIONprivate static intOPERATION_CODEstatic intROLLBACKprivate static intROLLBACK_FLAGprivate static intROW_IDprivate static intRS_IDprivate static intSCNprivate static intSEG_OWNERstatic intSELECT_LOB_LOCATORprivate static intSQL_REDOstatic intSTARTprivate static intTABLE_NAMEprivate static intTX_IDstatic intUPDATEprivate static intUSERNAMEprivate static CalendarUTC_CALENDAR
-
Constructor Summary
Constructors Constructor Description RowMapper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TimestampgetChangeTime(ResultSet rs)static StringgetOperation(ResultSet rs)static intgetOperationCode(ResultSet rs)static intgetRollbackFlag(ResultSet rs)static StringgetRowId(ResultSet rs)static ObjectgetRsId(ResultSet rs)static ScngetScn(ResultSet rs)static StringgetSegOwner(ResultSet rs)static StringgetSqlRedo(ResultSet rs, boolean isDml, HistoryRecorder historyRecorder, Scn scn, String tableName, String segOwner, int operationCode, Timestamp changeTime, String txId)It constructs REDO_SQL.static TableIdgetTableId(String catalogName, ResultSet rs)static StringgetTableName(ResultSet rs)static StringgetTransactionId(ResultSet rs)static StringgetUsername(ResultSet rs)
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
INSERT
public static final int INSERT
- See Also:
- Constant Field Values
-
DELETE
public static final int DELETE
- See Also:
- Constant Field Values
-
UPDATE
public static final int UPDATE
- See Also:
- Constant Field Values
-
DDL
public static final int DDL
- See Also:
- Constant Field Values
-
START
public static final int START
- See Also:
- Constant Field Values
-
COMMIT
public static final int COMMIT
- See Also:
- Constant Field Values
-
SELECT_LOB_LOCATOR
public static final int SELECT_LOB_LOCATOR
- See Also:
- Constant Field Values
-
LOB_WRITE
public static final int LOB_WRITE
- See Also:
- Constant Field Values
-
LOB_ERASE
public static final int LOB_ERASE
- See Also:
- Constant Field Values
-
MISSING_SCN
public static final int MISSING_SCN
- See Also:
- Constant Field Values
-
ROLLBACK
public static final int ROLLBACK
- See Also:
- Constant Field Values
-
SCN
private static final int SCN
- See Also:
- Constant Field Values
-
SQL_REDO
private static final int SQL_REDO
- See Also:
- Constant Field Values
-
OPERATION_CODE
private static final int OPERATION_CODE
- See Also:
- Constant Field Values
-
CHANGE_TIME
private static final int CHANGE_TIME
- See Also:
- Constant Field Values
-
TX_ID
private static final int TX_ID
- See Also:
- Constant Field Values
-
CSF
private static final int CSF
- See Also:
- Constant Field Values
-
TABLE_NAME
private static final int TABLE_NAME
- See Also:
- Constant Field Values
-
SEG_OWNER
private static final int SEG_OWNER
- See Also:
- Constant Field Values
-
OPERATION
private static final int OPERATION
- See Also:
- Constant Field Values
-
USERNAME
private static final int USERNAME
- See Also:
- Constant Field Values
-
ROW_ID
private static final int ROW_ID
- See Also:
- Constant Field Values
-
ROLLBACK_FLAG
private static final int ROLLBACK_FLAG
- See Also:
- Constant Field Values
-
RS_ID
private static final int RS_ID
- See Also:
- Constant Field Values
-
UTC_CALENDAR
private static final Calendar UTC_CALENDAR
-
-
Method Detail
-
getOperation
public static String getOperation(ResultSet rs) throws SQLException
- Throws:
SQLException
-
getUsername
public static String getUsername(ResultSet rs) throws SQLException
- Throws:
SQLException
-
getOperationCode
public static int getOperationCode(ResultSet rs) throws SQLException
- Throws:
SQLException
-
getTableName
public static String getTableName(ResultSet rs) throws SQLException
- Throws:
SQLException
-
getSegOwner
public static String getSegOwner(ResultSet rs) throws SQLException
- Throws:
SQLException
-
getChangeTime
public static Timestamp getChangeTime(ResultSet rs) throws SQLException
- Throws:
SQLException
-
getScn
public static Scn getScn(ResultSet rs) throws SQLException
- Throws:
SQLException
-
getTransactionId
public static String getTransactionId(ResultSet rs) throws SQLException
- Throws:
SQLException
-
getSqlRedo
public static String getSqlRedo(ResultSet rs, boolean isDml, HistoryRecorder historyRecorder, Scn scn, String tableName, String segOwner, int operationCode, Timestamp changeTime, String txId) throws SQLException
It constructs REDO_SQL. If REDO_SQL is in a few lines, it truncates after first 40_000 characters It also records LogMiner history info if isDml is true- Parameters:
rs- result setisDml- flag indicating if operation code is a DMLhistoryRecorder- history recorderscn- scntableName- table namesegOwner- segment owneroperationCode- operation codechangeTime- time of changetxId- transaction ID- Returns:
- the redo SQL
- Throws:
SQLException- if an exception occurred while interacting with the data source
-
getRowId
public static String getRowId(ResultSet rs) throws SQLException
- Throws:
SQLException
-
getRollbackFlag
public static int getRollbackFlag(ResultSet rs) throws SQLException
- Throws:
SQLException
-
getTableId
public static TableId getTableId(String catalogName, ResultSet rs) throws SQLException
- Throws:
SQLException
-
getRsId
public static Object getRsId(ResultSet rs) throws SQLException
- Throws:
SQLException
-
-