Package com.alibaba.otter.canal.common

Examples of com.alibaba.otter.canal.common.CanalException


            for (int i = 0; i < size; i++) {
                List<InetSocketAddress> dbAddress = new ArrayList<InetSocketAddress>();
                SourcingType lastType = null;
                for (List<DataSourcing> groupDbAddress : groupDbAddresses) {
                    if (lastType != null && !lastType.equals(groupDbAddress.get(i).getType())) {
                        throw new CanalException(String.format("master/slave Sourcing type is unmatch. %s vs %s",
                                                               lastType, groupDbAddress.get(i).getType()));
                    }

                    lastType = groupDbAddress.get(i).getType();
                    dbAddress.add(groupDbAddress.get(i).getDbAddress());
View Full Code Here


                                                                            parameters.getDefaultDatabaseName()));

            }
            eventParser = localBinlogEventParser;
        } else if (type.isOracle()) {
            throw new CanalException("unsupport SourcingType for " + type);
        } else {
            throw new CanalException("unsupport SourcingType for " + type);
        }

        if (eventParser instanceof AbstractEventParser) { // add transaction support at 2012-12-06
            AbstractEventParser abstractEventParser = (AbstractEventParser) eventParser;
            abstractEventParser.setTransactionSize(parameters.getTransactionSize());
View Full Code Here

        if (haMode.isHeartBeat()) {
            haController = new HeartBeatHAController();
            ((HeartBeatHAController) haController).setDetectingRetryTimes(parameters.getDetectingRetryTimes());
            ((HeartBeatHAController) haController).setSwitchEnable(parameters.getHeartbeatHaEnable());
        } else if (haMode.isTddl()) {
            throw new CanalException("unsupport HAMode for " + haMode);
        } else if (haMode.isCobar()) {
            throw new CanalException("unsupport HAMode for " + haMode);
        } else {
            throw new CanalException("unsupport HAMode for " + haMode);
        }
        logger.info("init haController end! \n\t load CanalHAController:{}", haController.getClass().getName());

        return haController;
    }
View Full Code Here

            logPositionManager = new FailbackLogPositionManager();
            ((FailbackLogPositionManager) logPositionManager).setPrimary(primaryLogPositionManager);
            ((FailbackLogPositionManager) logPositionManager).setFailback(failbackLogPositionManager);
        } else {
            throw new CanalException("unsupport indexMode for " + indexMode);
        }

        logger.info("init logPositionManager end! \n\t load CanalLogPositionManager:{}",
                    logPositionManager.getClass().getName());
View Full Code Here

    public static AuthenticationInfo createFrom(DatasourceInfo datasourceInfo) {
        AuthenticationInfo authenticationInfo = new AuthenticationInfo();
        try {
            BeanUtils.copyProperties(authenticationInfo, datasourceInfo);
        } catch (Exception e) {
            throw new CanalException(e);
        }
        return authenticationInfo;
    }
View Full Code Here

        try {
            Object obj = delegate.callManager(event);
            if (obj != null && obj instanceof Canal) {
                return (Canal) obj;
            } else {
                throw new CanalException("No Such Canal by [" + destination + "]");
            }
        } catch (Exception e) {
            throw new CanalException("call_manager_error", e);
        }
    }
View Full Code Here

        try {
            Object obj = delegate.callManager(event);
            if (obj != null && obj instanceof String) {
                return (String) obj;
            } else {
                throw new CanalException("No Such Canal by [" + destination + "]");
            }
        } catch (Exception e) {
            throw new CanalException("call_manager_error", e);
        }
    }
View Full Code Here

                                                                            parameters.getDefaultDatabaseName()));

            }
            eventParser = localBinlogEventParser;
        } else if (type.isOracle()) {
            throw new CanalException("unsupport SourcingType for " + type);
        } else {
            throw new CanalException("unsupport SourcingType for " + type);
        }

        if (eventParser instanceof AbstractEventParser) { // add transaction support at 2012-12-06
            AbstractEventParser abstractEventParser = (AbstractEventParser) eventParser;
            abstractEventParser.setTransactionSize(parameters.getTransactionSize());
View Full Code Here

        if (haMode.isHeartBeat()) {
            haController = new HeartBeatHAController();
            ((HeartBeatHAController) haController).setDetectingRetryTimes(parameters.getDetectingRetryTimes());
            ((HeartBeatHAController) haController).setSwitchEnable(parameters.getHeartbeatHaEnable());
        } else if (haMode.isTddl()) {
            throw new CanalException("unsupport HAMode for " + haMode);
        } else if (haMode.isCobar()) {
            throw new CanalException("unsupport HAMode for " + haMode);
        } else {
            throw new CanalException("unsupport HAMode for " + haMode);
        }
        logger.info("init haController end! \n\t load CanalHAController:{}", haController.getClass().getName());

        return haController;
    }
View Full Code Here

            logPositionManager = new FailbackLogPositionManager();
            ((FailbackLogPositionManager) logPositionManager).setPrimary(primaryLogPositionManager);
            ((FailbackLogPositionManager) logPositionManager).setFailback(failbackLogPositionManager);
        } else {
            throw new CanalException("unsupport indexMode for " + indexMode);
        }

        logger.info("init logPositionManager end! \n\t load CanalLogPositionManager:{}",
                    logPositionManager.getClass().getName());
View Full Code Here

TOP

Related Classes of com.alibaba.otter.canal.common.CanalException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.