Examples of CanalMetaManagerException


Examples of com.alibaba.otter.canal.meta.exception.CanalMetaManagerException

            batchIds.add(Long.valueOf(batchIdString));
        }
        Long minBatchId = Collections.min(batchIds);
        if (!minBatchId.equals(batchId)) {
            // 检查一下提交的ack/rollback,必须按batchId分出去的顺序提交,否则容易出现丢数据
            throw new CanalMetaManagerException(String.format("batchId:%d is not the firstly:%d", batchId, minBatchId));
        }

        if (!batchIds.contains(batchId)) {
            // 不存在对应的batchId
            return null;
View Full Code Here

Examples of com.alibaba.otter.canal.meta.exception.CanalMetaManagerException

        public synchronized PositionRange removePositionRange(Long batchId) {
            if (batches.containsKey(batchId)) {
                Long minBatchId = Collections.min(batches.keySet());
                if (!minBatchId.equals(batchId)) {
                    // 检查一下提交的ack/rollback,必须按batchId分出去的顺序提交,否则容易出现丢数据
                    throw new CanalMetaManagerException(String.format("batchId:%d is not the firstly:%d", batchId,
                                                                      minBatchId));
                }
                return batches.remove(batchId);
            } else {
                return null;
View Full Code Here

Examples of com.alibaba.otter.canal.meta.exception.CanalMetaManagerException

                e.printStackTrace();
            }
        }

        if (!dataDir.canRead() || !dataDir.canWrite()) {
            throw new CanalMetaManagerException("dir[" + dataDir.getPath() + "] can not read/write");
        }

        dataFileCaches = new MapMaker().makeComputingMap(new Function<String, File>() {

            public File apply(String destination) {
View Full Code Here

Examples of com.alibaba.otter.canal.meta.exception.CanalMetaManagerException

        File destinationMetaDir = new File(dataDir, destination);
        if (!destinationMetaDir.exists()) {
            try {
                FileUtils.forceMkdir(destinationMetaDir);
            } catch (IOException e) {
                throw new CanalMetaManagerException(e);
            }
        }

        return new File(destinationMetaDir, dataFileName);
    }
View Full Code Here

Examples of com.alibaba.otter.canal.meta.exception.CanalMetaManagerException

            }

            String json = FileUtils.readFileToString(dataFile, charset.name());
            return JsonUtils.unmarshalFromString(json, FileMetaInstanceData.class);
        } catch (IOException e) {
            throw new CanalMetaManagerException(e);
        }
    }
View Full Code Here

Examples of com.alibaba.otter.canal.meta.exception.CanalMetaManagerException

            String json = JsonUtils.marshalToString(data);
            try {
                FileUtils.writeStringToFile(dataFile, json);
            } catch (IOException e) {
                throw new CanalMetaManagerException(e);
            }
        }
    }
View Full Code Here

Examples of com.alibaba.otter.canal.meta.exception.CanalMetaManagerException

        public synchronized PositionRange removePositionRange(Long batchId) {
            if (batches.containsKey(batchId)) {
                Long minBatchId = Collections.min(batches.keySet());
                if (!minBatchId.equals(batchId)) {
                    // 检查一下提交的ack/rollback,必须按batchId分出去的顺序提交,否则容易出现丢数据
                    throw new CanalMetaManagerException(String.format("batchId:%d is not the firstly:%d", batchId,
                                                                      minBatchId));
                }
                return batches.remove(batchId);
            } else {
                return null;
View Full Code Here

Examples of com.alibaba.otter.canal.meta.exception.CanalMetaManagerException

                e.printStackTrace();
            }
        }

        if (!dataDir.canRead() || !dataDir.canWrite()) {
            throw new CanalMetaManagerException("dir[" + dataDir.getPath() + "] can not read/write");
        }

        dataFileCaches = new MapMaker().makeComputingMap(new Function<String, File>() {

            public File apply(String destination) {
View Full Code Here

Examples of com.alibaba.otter.canal.meta.exception.CanalMetaManagerException

        File destinationMetaDir = new File(dataDir, destination);
        if (!destinationMetaDir.exists()) {
            try {
                FileUtils.forceMkdir(destinationMetaDir);
            } catch (IOException e) {
                throw new CanalMetaManagerException(e);
            }
        }

        return new File(destinationMetaDir, dataFileName);
    }
View Full Code Here

Examples of com.alibaba.otter.canal.meta.exception.CanalMetaManagerException

        if (position != null && position != nullPosition) {
            String json = JsonUtils.marshalToString(position);
            try {
                FileUtils.writeStringToFile(dataFile, json);
            } catch (IOException e) {
                throw new CanalMetaManagerException(e);
            }
        }
    }
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.