public InsertRowsEventInfo(TableInfo tableInfo, Long timestamp, String binlogFilename, Long binlogPosition, WriteRowsEventData data) { super(tableInfo, INSERT_EVENT, timestamp, binlogFilename, binlogPosition, data.getIncludedColumns(), data.getRows()); this.data = data; } }
private void processWriteEvent(Event event) { WriteRowsEventData data = event.getData(); Long tableId = data.getTableId(); List<Serializable[]> list = data.getRows(); for (Serializable[] row : list) { addRow("WRITE", tableId, row); } }
protected void assertRows(WriteRowsEventData eventData, int numRowsInEvent, Serializable... expectedValuesInRows) { assertThat(eventData.getRows().size()).isEqualTo(numRowsInEvent); int valuePosition = 0; for (Serializable[] row : eventData.getRows()) { for (Serializable value : row) { assertThat(value).isEqualTo(expectedValuesInRows[valuePosition++]); } } }
RecordsForTable recordMaker = recordMakers.forTable(tableNumber, includedColumns, super::enqueueRecord); if (recordMaker != null) { List<Serializable[]> rows = write.getRows(); Long ts = context.getClock().currentTimeInMillis(); int count = 0;
case WRITE_ROWS: case EXT_WRITE_ROWS: for ( Serializable[] data : writeRowsData().getRows() ) { list.add(buildRowMap("insert", position, nextPosition, data, table, writeRowsData().getIncludedColumns(), rowQuery));
private Serializable getValue(WriteRowsEventData eventData, String columnName) { if(columnOrders.containsKey(columnName)) { return eventData.getRows().get(0)[columnOrders.get(columnName) - 1]; } throw new RuntimeException("Column with name [" + columnName + "] not found"); }
private Serializable getValue(WriteRowsEventData eventData, String columnName) { if(columnOrders.containsKey(columnName)) { return eventData.getRows().get(0)[columnOrders.get(columnName) - 1]; } throw new RuntimeException("Column with name [" + columnName + "] not found"); }
private Serializable getValue(WriteRowsEventData eventData, String columnName) { if(columnOrders.containsKey(columnName)) { return eventData.getRows().get(0)[columnOrders.get(columnName) - 1]; } throw new RuntimeException("Column with name [" + columnName + "] not found. Have " + columnOrders.keySet()); }
private Serializable getValue(WriteRowsEventData eventData, String columnName) { if(columnOrders.containsKey(columnName)) { return eventData.getRows().get(0)[columnOrders.get(columnName) - 1]; } throw new RuntimeException("Column with name [" + columnName + "] not found. Have " + columnOrders.keySet()); }
public InsertRowsEventInfo(TableInfo tableInfo, Long timestamp, String binlogFilename, Long binlogPosition, WriteRowsEventData data) { super(tableInfo, INSERT_EVENT, timestamp, binlogFilename, binlogPosition, data.getIncludedColumns(), data.getRows()); this.data = data; } }
protected void assertRows(WriteRowsEventData eventData, int numRowsInEvent, Serializable... expectedValuesInRows) { assertThat(eventData.getRows().size()).isEqualTo(numRowsInEvent); int valuePosition = 0; for (Serializable[] row : eventData.getRows()) { for (Serializable value : row) { assertThat(value).isEqualTo(expectedValuesInRows[valuePosition++]); } } }
d.getRows().forEach(row -> { if (LOGGER.isInfoEnabled()) { LOGGER.debug("Pending write: {}", StringUtils.hex((byte[]) row[0]));
for (Serializable[] row : ((WriteRowsEventData) eventData).getRows()) { byte[] data = row[2] instanceof byte[] ? (byte[]) row[2] : row[2] instanceof String ? ((String) row[2]).getBytes(Charsets.UTF_8)