-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow disabling caching missing tables in CachingMetastore #17177
Allow disabling caching missing tables in CachingMetastore #17177
Conversation
72a207d
to
0101fee
Compare
plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/cache/CachingHiveMetastore.java
Outdated
Show resolved
Hide resolved
return value; | ||
} | ||
cache.invalidate(key); | ||
} | ||
return cache.getUnchecked(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary call this method if the value is not present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, cache.getIfPresent
didn't load anything yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -141,6 +141,7 @@ public void setUp() | |||
.cacheTtl(new Duration(5, TimeUnit.MINUTES)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add dedicated test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
@@ -943,7 +982,7 @@ public Optional<List<String>> getPartitionNamesByFilter( | |||
List<String> columnNames, | |||
TupleDomain<String> partitionKeysFilter) | |||
{ | |||
return get(partitionFilterCache, partitionFilter(databaseName, tableName, columnNames, partitionKeysFilter)); | |||
return getOptional(partitionFilterCache, partitionFilter(databaseName, tableName, columnNames, partitionKeysFilter)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be also used in bulk loaded cache?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps, but I didn't find the bulk loaded cache which caches absence, can you help me with that?
Make it clear that `TestCachingHiveMetastore`'s `metastore` and `statsCacheMetastore` differ with `metadataCacheEnabled` and `statsCacheEnabled` -- make it apparent by the later's name and in their initialization.
Table absence is harder to less interesting to cache and sometimes undesirable at all. This is similar to `metadata.cache-missing` config we have for JDBC connectors.
Enforce the caller provides configuration, so that `CachingHiveMetastoreConfig` is the only source of default configuration.
0101fee
to
60776c0
Compare
Table absence is harder to less interesting to cache and sometimes undesirable at all. This is similar to
metadata.cache-missing
config we have for JDBC connectors.