mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
format
This commit is contained in:
@@ -22,7 +22,6 @@ import com.alibaba.otter.canal.parse.CanalEventParser;
|
||||
import com.alibaba.otter.canal.parse.exception.CanalParseException;
|
||||
import com.alibaba.otter.canal.parse.exception.TableIdNotFoundException;
|
||||
import com.alibaba.otter.canal.parse.inbound.EventTransactionBuffer.TransactionFlushCallback;
|
||||
import com.alibaba.otter.canal.parse.inbound.mysql.MysqlEventParser;
|
||||
import com.alibaba.otter.canal.parse.index.CanalLogPositionManager;
|
||||
import com.alibaba.otter.canal.parse.support.AuthenticationInfo;
|
||||
import com.alibaba.otter.canal.protocol.CanalEntry;
|
||||
@@ -387,10 +386,11 @@ public abstract class AbstractEventParser<EVENT> extends AbstractCanalLifeCycle
|
||||
String name = String.format("destination = %s , address = %s , HeartBeatTimeTask",
|
||||
destination,
|
||||
runningInfo == null ? null : runningInfo.getAddress().toString());
|
||||
synchronized(AbstractEventParser.class){
|
||||
// synchronized (MysqlEventParser.class) {
|
||||
// why use MysqlEventParser.class, u know, MysqlEventParser is the child class 4 AbstractEventParser,
|
||||
// do this is ...
|
||||
synchronized (AbstractEventParser.class) {
|
||||
// synchronized (MysqlEventParser.class) {
|
||||
// why use MysqlEventParser.class, u know, MysqlEventParser is
|
||||
// the child class 4 AbstractEventParser,
|
||||
// do this is ...
|
||||
if (timer == null) {
|
||||
timer = new Timer(name, true);
|
||||
}
|
||||
|
||||
@@ -279,9 +279,8 @@ public class MysqlConnection implements ErosaConnection {
|
||||
}
|
||||
|
||||
List<String> columnValues = rs.getFieldValues();
|
||||
if (columnValues.size() > 0 && columnValues.get(0) != null
|
||||
&& columnValues.get(0).toUpperCase().equals("CRC32")) {
|
||||
binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_CRC32;
|
||||
if(columnValues.get(0).toUpperCase().equals("CRC32")){
|
||||
binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_CRC32;
|
||||
}else{
|
||||
binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_OFF;
|
||||
}
|
||||
|
||||
@@ -182,9 +182,7 @@ public class MysqlEventParser extends AbstractMysqlEventParser implements CanalE
|
||||
protected void stopHeartBeat() {
|
||||
TimerTask heartBeatTimerTask = this.heartBeatTimerTask;
|
||||
super.stopHeartBeat();
|
||||
|
||||
if (heartBeatTimerTask != null) {
|
||||
|
||||
MysqlConnection mysqlConnection = ((MysqlDetectingTimeTask) heartBeatTimerTask).getMysqlConnection();
|
||||
try {
|
||||
mysqlConnection.disconnect();
|
||||
@@ -414,7 +412,8 @@ public class MysqlEventParser extends AbstractMysqlEventParser implements CanalE
|
||||
}
|
||||
}
|
||||
// 其余情况
|
||||
logger.warn("prepare to find start position just last position\n {}",JsonUtils.marshalToString(logPosition));
|
||||
logger.warn("prepare to find start position just last position\n {}",
|
||||
JsonUtils.marshalToString(logPosition));
|
||||
return logPosition.getPostion();
|
||||
} else {
|
||||
// 针对切换的情况,考虑回退时间
|
||||
|
||||
Reference in New Issue
Block a user