morningman commented on code in PR #21700:
URL: https://github.com/apache/doris/pull/21700#discussion_r1259931208
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreCache.java:
##########
@@ -171,6 +173,20 @@ public Map<PartitionCacheKey, HivePartition>
loadAll(Iterable<? extends Partitio
});
+ fileSystemCache =
CacheBuilder.newBuilder().maximumSize(Config.max_hive_partition_cache_num)
Review Comment:
It is strange to use `Config.max_hive_partition_cache_num` as the max size
of fs cache.
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreCache.java:
##########
@@ -984,6 +1022,43 @@ public void setAcidInfo(AcidInfo acidInfo) {
}
}
+ @Data
+ public static class FileSystemCacheKey {
Review Comment:
I think this class should be implement in `fs` package.
It is not only for `HiveMetaStoreCache`
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreCache.java:
##########
@@ -984,6 +1022,43 @@ public void setAcidInfo(AcidInfo acidInfo) {
}
}
+ @Data
+ public static class FileSystemCacheKey {
+ private final FileSystemType type;
+ private final JobConf conf;
+ private final long tableId;
+
+ public FileSystemCacheKey(FileSystemType type, JobConf conf, long
tableId) {
+ this.type = type;
+ this.conf = conf;
+ this.tableId = tableId;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!(obj instanceof FileSystemCacheKey)) {
+ return false;
+ }
+ return type.equals(((FileSystemCacheKey) obj).type) && conf ==
((FileSystemCacheKey) obj).conf
+ && tableId == ((FileSystemCacheKey) obj).tableId;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(tableId, type);
+ }
+ }
+
+ public enum FileSystemType {
+ S3,
Review Comment:
Should define in `fs` packge
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreCache.java:
##########
@@ -984,6 +1022,43 @@ public void setAcidInfo(AcidInfo acidInfo) {
}
}
+ @Data
+ public static class FileSystemCacheKey {
+ private final FileSystemType type;
+ private final JobConf conf;
+ private final long tableId;
+
+ public FileSystemCacheKey(FileSystemType type, JobConf conf, long
tableId) {
+ this.type = type;
+ this.conf = conf;
+ this.tableId = tableId;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!(obj instanceof FileSystemCacheKey)) {
+ return false;
+ }
+ return type.equals(((FileSystemCacheKey) obj).type) && conf ==
((FileSystemCacheKey) obj).conf
+ && tableId == ((FileSystemCacheKey) obj).tableId;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(tableId, type);
Review Comment:
Need to take `JobConf` into account. Or if we change the properties, the fs
cache is not updated.
--
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]