Castled 源码解析 - connector 模块几个中间表定义

Castled 的connector利用了schema 以及中间表进行数据存储(包含的已经提交的,未提交的)
官方使用了一个属于snapshot(快照),对于数据的处理,官方使用了excep sql 函数,基于不同
时间的snapshot 利用excep 就可以知道数据的变动

几个提供的中间表

主要在ConnectorExecutionConstants 中定义

 
public class ConnectorExecutionConstants {
 
    public static final String CASTLED_CONTAINER = "castled";
    public static final String UNCOMMITTED_SNAPSHOT = "uncommitted_snapshot";
    public static final String COMMITTED_SNAPSHOT = "committed_snapshot";
    public static final String COMMITTED_SNAPSHOT_BACKUP = "committed_snapshot_bkp";
    public static final String FAILED_RECORDS = "failed_records";
 
    public static final Path WAREHOUSE_UNLOAD_DIR_PATH = Paths.get("warehouse_unloads");
    public static final Path FAILURE_RECORDS_DIR = Paths.get("pipeline_failed_records");
    public static final Path APP_UPLOADS_PATH = Paths.get("app_uploads");
 
 
    public static String getQualifiedCommittedSnapshot(String uuid) {
        return String.format("%s.%s_%s", CASTLED_CONTAINER, uuid, COMMITTED_SNAPSHOT);
    }
 
    public static String getFailedRecordsTable(String uuid) {
        return String.format("%s_%s", uuid, FAILED_RECORDS);
    }
 
    public static String getQualifiedUncommittedSnapshot(String uuid) {
        return String.format("%s.%s_%s", CASTLED_CONTAINER, uuid, UNCOMMITTED_SNAPSHOT);
    }
 
    public static String getCommittedSnapshot(String uuid) {
        return String.format("%s_%s", uuid, COMMITTED_SNAPSHOT);
    }
 
    public static String getUncommittedSnapshot(String uuid) {
        return String.format("%s_%s", uuid, UNCOMMITTED_SNAPSHOT);
    }
 
    public static String getQualifiedCommittedSnapshotBkp(String uuid) {
        return String.format("%s.%s_%s", CASTLED_CONTAINER, uuid, COMMITTED_SNAPSHOT_BACKUP);
    }
 
    public static String getCommittedSnapshotBackup(String uuid) {
        return String.format("%s_%s", uuid, COMMITTED_SNAPSHOT_BACKUP);
    }
 
}

说明

以上几个定义的中间表是比较重要的,如果运行Castled的话,就会看到类似的表在datawarehouse中,而且不同poller就是利用上边的定义进行数据处理的

参考资料

https://github.com/castledio/castled

posted on   荣锋亮  阅读(47)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2021-01-31 使用clinicjs 分析cube.js 的调用情况
2021-01-31 sitespeed.io 开源web 性能监控&&优化工具集
2021-01-31 sideway/joi js 强大的data schma 校验框架
2021-01-31 cube.js 最新版本的一些特性
2020-01-31 gox 简单灵活的golang 跨平台编译工具
2020-01-31 mailhog 作为smtp server mock工具
2019-01-31 几个方便的nodejs 任务调度框架

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示