Search in sources :

Example 1 with NullEventDataDeserializer

use of com.github.shyiko.mysql.binlog.event.deserialization.NullEventDataDeserializer in project eventuate-local by eventuate-local.

the class MySqlBinaryLogClient method getEventDeserializer.

private EventDeserializer getEventDeserializer() {
    EventDeserializer eventDeserializer = new EventDeserializer();
    // do not deserialize binlog events except the EXT_WRITE_ROWS and TABLE_MAP
    Arrays.stream(EventType.values()).forEach(eventType -> {
        if (eventType != EventType.EXT_WRITE_ROWS && eventType != EventType.TABLE_MAP && eventType != EventType.ROTATE) {
            eventDeserializer.setEventDataDeserializer(eventType, new NullEventDataDeserializer());
        }
    });
    eventDeserializer.setEventDataDeserializer(EventType.EXT_WRITE_ROWS, new WriteRowsEventDataDeserializer(tableMapEventByTableId).setMayContainExtraInformation(true));
    return eventDeserializer;
}
Also used : WriteRowsEventDataDeserializer(com.github.shyiko.mysql.binlog.event.deserialization.WriteRowsEventDataDeserializer) NullEventDataDeserializer(com.github.shyiko.mysql.binlog.event.deserialization.NullEventDataDeserializer) EventDeserializer(com.github.shyiko.mysql.binlog.event.deserialization.EventDeserializer)

Aggregations

EventDeserializer (com.github.shyiko.mysql.binlog.event.deserialization.EventDeserializer)1 NullEventDataDeserializer (com.github.shyiko.mysql.binlog.event.deserialization.NullEventDataDeserializer)1 WriteRowsEventDataDeserializer (com.github.shyiko.mysql.binlog.event.deserialization.WriteRowsEventDataDeserializer)1