public class RecordUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
SCHEMA_CHANGE_EVENT_KEY_NAME |
static String |
SCHEMA_HEARTBEAT_EVENT_KEY_NAME |
| Modifier and Type | Method and Description |
|---|---|
static BinlogOffset |
getBinlogPosition(Map<String,?> offset) |
static BinlogOffset |
getBinlogPosition(org.apache.kafka.connect.source.SourceRecord dataRecord) |
static Long |
getFetchTimestamp(org.apache.kafka.connect.source.SourceRecord record)
Return the timestamp when the change event is fetched in
DebeziumReader. |
static io.debezium.relational.history.HistoryRecord |
getHistoryRecord(org.apache.kafka.connect.source.SourceRecord schemaRecord) |
static Long |
getMessageTimestamp(org.apache.kafka.connect.source.SourceRecord record)
Return the timestamp when the change event is produced in MySQL.
|
static FinishedSnapshotSplitInfo |
getSnapshotSplitInfo(MySqlSnapshotSplit split,
org.apache.kafka.connect.source.SourceRecord highWatermark)
Return the finished snapshot split information.
|
static Object[] |
getSplitKey(org.apache.flink.table.types.logical.RowType splitBoundaryType,
org.apache.kafka.connect.source.SourceRecord dataRecord,
io.debezium.util.SchemaNameAdjuster nameAdjuster) |
static BinlogOffset |
getStartingOffsetOfBinlogSplit(List<FinishedSnapshotSplitInfo> finishedSnapshotSplits)
Returns the start offset of the binlog split.
|
static io.debezium.relational.TableId |
getTableId(org.apache.kafka.connect.source.SourceRecord dataRecord) |
static BinlogOffset |
getWatermark(org.apache.kafka.connect.source.SourceRecord watermarkEvent) |
static boolean |
isDataChangeRecord(org.apache.kafka.connect.source.SourceRecord record) |
static boolean |
isEndWatermarkEvent(org.apache.kafka.connect.source.SourceRecord record) |
static boolean |
isHeartbeatEvent(org.apache.kafka.connect.source.SourceRecord record) |
static boolean |
isHighWatermarkEvent(org.apache.kafka.connect.source.SourceRecord record) |
static boolean |
isLowWatermarkEvent(org.apache.kafka.connect.source.SourceRecord record) |
static boolean |
isSchemaChangeEvent(org.apache.kafka.connect.source.SourceRecord sourceRecord) |
static boolean |
isWatermarkEvent(org.apache.kafka.connect.source.SourceRecord record) |
static List<org.apache.kafka.connect.source.SourceRecord> |
normalizedSplitRecords(MySqlSnapshotSplit snapshotSplit,
List<org.apache.kafka.connect.source.SourceRecord> sourceRecords,
io.debezium.util.SchemaNameAdjuster nameAdjuster)
Normalize the records of snapshot split which represents the split records state on high
watermark.
|
static Object[] |
rowToArray(ResultSet rs,
int size)
Converts a
ResultSet row to an array of Objects. |
static boolean |
splitKeyRangeContains(Object[] key,
Object[] splitKeyStart,
Object[] splitKeyEnd)
Returns the specific key contains in the split key range or not.
|
public static final String SCHEMA_CHANGE_EVENT_KEY_NAME
public static final String SCHEMA_HEARTBEAT_EVENT_KEY_NAME
public static Object[] rowToArray(ResultSet rs, int size) throws SQLException
ResultSet row to an array of Objects.SQLExceptionpublic static List<org.apache.kafka.connect.source.SourceRecord> normalizedSplitRecords(MySqlSnapshotSplit snapshotSplit, List<org.apache.kafka.connect.source.SourceRecord> sourceRecords, io.debezium.util.SchemaNameAdjuster nameAdjuster)
public static boolean isWatermarkEvent(org.apache.kafka.connect.source.SourceRecord record)
public static boolean isLowWatermarkEvent(org.apache.kafka.connect.source.SourceRecord record)
public static boolean isHighWatermarkEvent(org.apache.kafka.connect.source.SourceRecord record)
public static boolean isEndWatermarkEvent(org.apache.kafka.connect.source.SourceRecord record)
public static BinlogOffset getWatermark(org.apache.kafka.connect.source.SourceRecord watermarkEvent)
public static Long getMessageTimestamp(org.apache.kafka.connect.source.SourceRecord record)
The field `source.ts_ms` in SourceRecord data struct is the time when the change
event is operated in MySQL.
public static Long getFetchTimestamp(org.apache.kafka.connect.source.SourceRecord record)
DebeziumReader.
The field `ts_ms` in SourceRecord data struct is the time when the record fetched
by debezium reader, use it as the process time in Source.
public static boolean isSchemaChangeEvent(org.apache.kafka.connect.source.SourceRecord sourceRecord)
public static boolean isHeartbeatEvent(org.apache.kafka.connect.source.SourceRecord record)
public static FinishedSnapshotSplitInfo getSnapshotSplitInfo(MySqlSnapshotSplit split, org.apache.kafka.connect.source.SourceRecord highWatermark)
public static BinlogOffset getStartingOffsetOfBinlogSplit(List<FinishedSnapshotSplitInfo> finishedSnapshotSplits)
public static boolean isDataChangeRecord(org.apache.kafka.connect.source.SourceRecord record)
public static io.debezium.relational.TableId getTableId(org.apache.kafka.connect.source.SourceRecord dataRecord)
public static Object[] getSplitKey(org.apache.flink.table.types.logical.RowType splitBoundaryType, org.apache.kafka.connect.source.SourceRecord dataRecord, io.debezium.util.SchemaNameAdjuster nameAdjuster)
public static BinlogOffset getBinlogPosition(org.apache.kafka.connect.source.SourceRecord dataRecord)
public static BinlogOffset getBinlogPosition(Map<String,?> offset)
public static boolean splitKeyRangeContains(Object[] key, Object[] splitKeyStart, Object[] splitKeyEnd)
public static io.debezium.relational.history.HistoryRecord getHistoryRecord(org.apache.kafka.connect.source.SourceRecord schemaRecord)
throws IOException
IOExceptionCopyright © 2022 The Apache Software Foundation. All rights reserved.