return buildMysqlConnection(this.runningInfo);
}
protected void preDump(ErosaConnection connection) {
if (!(connection instanceof MysqlConnection)) {
throw new CanalParseException("Unsupported connection type : " + connection.getClass().getSimpleName());
}
// 开始启动心跳包
if (detectingEnable && StringUtils.isNotBlank(detectingSQL)) {
// fixed issue #56,避免重复创建heartbeat线程
if (mysqlHeartBeatTimeTask == null) {
logger.info("start heart beat.... ");
startHeartbeat((MysqlConnection) connection.fork());
}
}
if (binlogParser != null && binlogParser instanceof LogEventConvert) {
metaConnection = (MysqlConnection) connection.fork();
try {
metaConnection.connect();
} catch (IOException e) {
throw new CanalParseException(e);
}
tableMetaCache = new TableMetaCache(metaConnection);
((LogEventConvert) binlogParser).setTableMetaCache(tableMetaCache);
}