@Test public void testDeleteMutation() throws Exception { Serializable[] change = new Serializable[4]; change[0] = 12131L; change[1] = "test_user"; change[2] = 25; change[3] = 0; Serializable[] change2 = new Serializable[4]; change2[0] = 12334L; change2[1] = "test_user2"; change2[2] = 12; change2[3] = 1; BinlogEvent event = new DeleteEvent( TABLE_ID, SERVER_ID, TIMESTAMP, BINLOG_FILE_POS, ImmutableList.of(change, change2)); List<? extends Mutation> mutations = eventMapper.map(event); assertEquals(2, mutations.size()); assertTrue(mutations.get(0) instanceof MysqlDeleteMutation); MysqlDeleteMutation mutation = (MysqlDeleteMutation) mutations.get(0); validateMetadata(mutation, 0); Row row = mutation.getEntity(); assertEquals(12131L, row.getColumns().get("id").getValue()); assertEquals("test_user", row.getColumns().get("name").getValue()); assertEquals(25, row.getColumns().get("age").getValue()); assertEquals(0, row.getColumns().get("sex").getValue()); assertTrue(mutations.get(1) instanceof MysqlDeleteMutation); mutation = (MysqlDeleteMutation) mutations.get(1); validateMetadata(mutation, 1); row = mutation.getEntity(); assertEquals(12334L, row.getColumns().get("id").getValue()); assertEquals("test_user2", row.getColumns().get("name").getValue()); assertEquals(12, row.getColumns().get("age").getValue()); assertEquals(1, row.getColumns().get("sex").getValue()); }
public List<T> map(@NonNull final R event) { Table table = tableCache.get(event.getTableId()); return mapEvent(table, event); }
MysqlMutationMapper implements Mapper<R, List<T>> { public List<T> map(@NonNull final R event) { Table table = tableCache.get(event.getTableId()); return mapEvent(table, event); } }
MysqlMutationMapper implements Mapper<R, List<T>> { public List<T> map(@NonNull final R event) { Table table = tableCache.get(event.getTableId()); return mapEvent(table, event); }  }
MysqlMutationMapper implements Mapper<R, List<T>> { public List<T> map(@NonNull final R event) { Table table = tableCache.get(event.getTableId()); return mapEvent(table, event); }  static Mapper<BinlogEvent, List<? extends Mutation<?>>> create(
      @NonNull final DataSource dataSource,
      @NonNull final TableCache tableCache,
      @NonNull final MysqlSchemaManager schemaManager,
      @NonNull final AtomicLong leaderEpoch,
      @NonNull final AtomicReference<Transaction> beginTransaction,
      @NonNull final AtomicReference<Transaction> lastTransaction,
      @NonNull final MysqlSourceMetrics metrics); List<T> map(@NonNull final R event); }
MysqlMutationMapper implements Mapper<R, List<T>> { public List<T> map(@NonNull final R event) { Table table = tableCache.get(event.getTableId()); return mapEvent(table, event); }  static Mapper<BinlogEvent, List<? extends Mutation<?>>> create(
      @NonNull final DataSource dataSource,
      @NonNull final TableCache tableCache,
      @NonNull final MysqlSchemaManager schemaManager,
      @NonNull final AtomicLong leaderEpoch,
      @NonNull final AtomicReference<Transaction> beginTransaction,
      @NonNull final AtomicReference<Transaction> lastTransaction,
      @NonNull final MysqlSourceMetrics metrics); List<T> map(@NonNull final R event);  }