protected void startEventParserInternal(CanalEventParser parser, boolean isGroup) {
super.startEventParserInternal(parser, isGroup);
if (eventParser instanceof MysqlEventParser) {
MysqlEventParser mysqlEventParser = (MysqlEventParser) eventParser;
CanalHAController haController = mysqlEventParser.getHaController();
if (haController instanceof MediaHAController) {
if (isGroup) {
throw new CanalException("not support group database use media HA");
}
((MediaHAController) haController).setCanalHASwitchable(mysqlEventParser);
}
if (!haController.isStart()) {
haController.start();
}
// 基于media的Ha,直接从tddl中获取数据库信息
if (haController instanceof MediaHAController) {
AuthenticationInfo authenticationInfo = ((MediaHAController) haController).getAvailableAuthenticationInfo();