924060929 commented on code in PR #66633:
URL: https://github.com/apache/doris/pull/66633#discussion_r3861654687
##########
fe/fe-connector/fe-connector-hive/src/main/java/org/apache/doris/connector/hive/HiveConnector.java:
##########
@@ -135,10 +138,12 @@ public HiveConnector(Map<String, String> properties,
ConnectorContext context) {
this.props = HiveCatalogProperties.of(properties);
this.properties = props.getRaw();
this.context = context;
- this.fileListingCache = new HiveFileListingCache(props);
+ this.fileListingCache = new HiveFileListingCache(metaCache, props);
Review Comment:
这里不是让每个 connector 自己实现一整套 cache。公共框架已经统一负责缓存的存储、过期、失效和并发控制;connector
里的显式代码只是告诉框架三件事:缓存什么、对象怎么加载、对象不用时怎么释放。
这部分没法完全藏到 core 里,因为 core 不知道 Hive、Iceberg、Paimon
各自缓存对象的类型,也不知道这些对象有没有连接、引用计数等特殊释放要求。如果把这些细节放进 core,反而会让 core 依赖具体
connector。现在的边界其实就是:公共框架负责“怎么缓存”,connector 负责“生成和释放被缓存的对象”。
内存控制这个问题是存在的。本 PR 只统一缓存框架,现有的 maximumSize 和 TTL 只能限制单个 cache,还不能统一控制所有
connector 的总内存。跨 connector 的统一内存治理会在 #66717 的 master 版本里继续做,建立在这个公共框架之上。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]