com.lmaye.cloud.starter.canal.handler.AbstractFlatMessageHandler Maven / Gradle / Ivy
package com.lmaye.cloud.starter.canal.handler;
import com.alibaba.otter.canal.protocol.CanalEntry;
import com.alibaba.otter.canal.protocol.FlatMessage;
import com.lmaye.cloud.starter.canal.context.CanalContext;
import com.lmaye.cloud.starter.canal.model.CanalModel;
import com.lmaye.cloud.starter.canal.utils.HandlerUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* -- AbstractFlatMessageHandler
*
* @author Lmay Zhou
* @date 2021/3/22 11:27
* @email [email protected]
*/
public abstract class AbstractFlatMessageHandler implements MessageHandler {
private final Map tableHandlerMap;
private final RowDataHandler>> rowDataHandler;
private Logger logger = LoggerFactory.getLogger(AbstractFlatMessageHandler.class);
public AbstractFlatMessageHandler(List extends EntryHandler> entryHandlers, RowDataHandler>> rowDataHandler) {
this.tableHandlerMap = HandlerUtil.getTableHandlerMap(entryHandlers);
this.rowDataHandler = rowDataHandler;
}
@Override
public void handleMessage(FlatMessage flatMessage) {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy