Castled 源码解析 - connector 模块几个中间表定义
2022/2/1 1:10:51
本文主要是介绍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
这篇关于Castled 源码解析 - connector 模块几个中间表定义的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-15PingCAP 黄东旭参与 CCF 秀湖会议,共探开源教育未来
- 2024-05-13PingCAP 戴涛:构建面向未来的金融核心系统
- 2024-05-09flutter3.x_macos桌面os实战
- 2024-05-09Rust中的并发性:Sync 和 Send Traits
- 2024-05-08使用Ollama和OpenWebUI在CPU上玩转Meta Llama3-8B
- 2024-05-08完工标准(DoD)与验收条件(AC)究竟有什么不同?
- 2024-05-084万 star 的 NocoDB 在 sealos 上一键起,轻松把数据库编程智能表格
- 2024-05-08Mac 版Stable Diffusion WebUI的安装
- 2024-05-08解锁CodeGeeX智能问答中3项独有的隐藏技能
- 2024-05-08RAG算法优化+新增代码仓库支持,CodeGeeX的@repo功能效果提升