Examples of CanalServerException


Examples of com.alibaba.otter.canal.server.exception.CanalServerException

        instanceGenerator = new CanalInstanceGenerator() {

            public CanalInstance generate(String destination) {
                InstanceConfig config = instanceConfigs.get(destination);
                if (config == null) {
                    throw new CanalServerException("can't find destination:{}");
                }

                if (config.getMode().isManager()) {
                    ManagerCanalInstanceGenerator instanceGenerator = new ManagerCanalInstanceGenerator();
                    instanceGenerator.setCanalConfigClient(managerClients.get(config.getManagerAddress()));
View Full Code Here

Examples of com.alibaba.otter.canal.server.exception.CanalServerException

        instanceGenerator = new CanalInstanceGenerator() {

            public CanalInstance generate(String destination) {
                InstanceConfig config = instanceConfigs.get(destination);
                if (config == null) {
                    throw new CanalServerException("can't find destination:{}");
                }

                if (config.getMode().isManager()) {
                    ManagerCanalInstanceGenerator instanceGenerator = new ManagerCanalInstanceGenerator();
                    instanceGenerator.setCanalConfigClient(managerClients.get(config.getManagerAddress()));
View Full Code Here

Examples of com.alibaba.otter.canal.server.exception.CanalServerException

        instanceGenerator = new CanalInstanceGenerator() {

            public CanalInstance generate(String destination) {
                InstanceConfig config = instanceConfigs.get(destination);
                if (config == null) {
                    throw new CanalServerException("can't find destination:{}");
                }

                if (config.getMode().isManager()) {
                    ManagerCanalInstanceGenerator instanceGenerator = new ManagerCanalInstanceGenerator();
                    instanceGenerator.setCanalConfigClient(managerClients.get(config.getManagerAddress()));
View Full Code Here

Examples of com.alibaba.otter.canal.server.exception.CanalServerException

        synchronized (canalInstance) {
            // 获取到流式数据中的最后一批获取的位置
            PositionRange<LogPosition> positionRanges = canalInstance.getMetaManager().getLastestBatch(clientIdentity);

            if (positionRanges != null) {
                throw new CanalServerException(
                                               String.format("clientId:%s has last batch:[%s] isn't ack , maybe loss data",
                                                             clientIdentity.getClientId(), positionRanges));
            }

            Events<Event> events = null;
View Full Code Here

Examples of com.alibaba.otter.canal.server.exception.CanalServerException

        CanalInstance canalInstance = canalInstances.get(clientIdentity.getDestination());
        PositionRange<LogPosition> positionRanges = null;
        positionRanges = canalInstance.getMetaManager().removeBatch(clientIdentity, batchId); // 更新位置
        if (positionRanges == null) { // 说明是重复的ack/rollback
            throw new CanalServerException(
                                           String.format("ack error , clientId:%s batchId:%d is not exist , please check",
                                                         clientIdentity.getClientId(), batchId));
        }

        // 更新cursor最好严格判断下位置是否有跳跃更新
View Full Code Here

Examples of com.alibaba.otter.canal.server.exception.CanalServerException

        synchronized (canalInstance) {
            // 清除batch信息
            PositionRange<LogPosition> positionRanges = canalInstance.getMetaManager().removeBatch(clientIdentity,
                                                                                                   batchId);
            if (positionRanges == null) { // 说明是重复的ack/rollback
                throw new CanalServerException(
                                               String.format("rollback error, clientId:%s batchId:%d is not exist , please check",
                                                             clientIdentity.getClientId(), batchId));
            }

            // lastRollbackPostions.put(clientIdentity,
View Full Code Here

Examples of com.alibaba.otter.canal.server.exception.CanalServerException

                    return eventStore.get(start, batchSize);
                } else {
                    return eventStore.get(start, batchSize, timeout, unit);
                }
            } catch (Exception e) {
                throw new CanalServerException(e);
            }
        }
    }
View Full Code Here

Examples of com.alibaba.otter.canal.server.exception.CanalServerException

    private void checkSubscribe(ClientIdentity clientIdentity) {
        CanalInstance canalInstance = canalInstances.get(clientIdentity.getDestination());
        boolean hasSubscribe = canalInstance.getMetaManager().hasSubscribe(clientIdentity);
        if (!hasSubscribe) {
            throw new CanalServerException(String.format("ClientIdentity:%s should subscribe first",
                                                         clientIdentity.toString()));
        }
    }
View Full Code Here

Examples of com.alibaba.otter.canal.server.exception.CanalServerException

        }
    }

    private void checkStart(String destination) {
        if (!isStart(destination)) {
            throw new CanalServerException(String.format("destination:%s should start first", destination));
        }
    }
View Full Code Here

Examples of com.alibaba.otter.canal.server.exception.CanalServerException

        synchronized (canalInstance) {
            // 获取到流式数据中的最后一批获取的位置
            PositionRange<LogPosition> positionRanges = canalInstance.getMetaManager().getLastestBatch(clientIdentity);

            if (positionRanges != null) {
                throw new CanalServerException(
                                               String.format(
                                                             "clientId:%s has last batch:[%s] isn't ack , maybe loss data",
                                                             clientIdentity.getClientId(), positionRanges));
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.