use of org.apache.rocketmq.mysql.schema.Table in project rocketmq-externals by apache.
the class EventProcessor method processTableMapEvent.
private void processTableMapEvent(Event event) {
TableMapEventData data = event.getData();
String dbName = data.getDatabase();
String tableName = data.getTable();
Long tableId = data.getTableId();
Table table = schema.getTable(dbName, tableName);
tableMap.put(tableId, table);
}
use of org.apache.rocketmq.mysql.schema.Table in project rocketmq-externals by apache.
the class EventProcessor method addRow.
private void addRow(String type, Long tableId, Serializable[] row) {
if (transaction == null) {
transaction = new Transaction(config);
}
Table t = tableMap.get(tableId);
if (t != null) {
while (true) {
if (transaction.addRow(type, t, row)) {
break;
} else {
transaction.setNextBinlogPosition(replicator.getNextBinlogPosition());
replicator.commit(transaction, false);
transaction = new Transaction(config);
}
}
}
}
Aggregations