FANNG1 commented on code in PR #8696:
URL: https://github.com/apache/gravitino/pull/8696#discussion_r2446702340
##########
iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/ops/IcebergCatalogWrapper.java:
##########
@@ -306,4 +336,30 @@ public IcebergTableChange(TableIdentifier tableIdentifier,
Transaction transacti
this.transaction = transaction;
}
}
+
+ private TableMetadataCache loadTableMetadataCache(IcebergConfig config,
Catalog catalog) {
+ String impl = config.get(IcebergConfig.TABLE_METADATA_CACHE_IMPL);
+ if (StringUtils.isBlank(impl)) {
+ return TableMetadataCache.DUMMY;
+ }
+
+ Preconditions.checkArgument(
+ catalog instanceof SupportsMetadataLocation,
+ "You shouldn't enable Iceberg metadata cache for the catalog %s,
because the catalog impl does not support get metadata location.",
+ catalog.name());
+
+ TableMetadataCache cache =
+ ClassUtils.loadAndGetInstance(impl,
Thread.currentThread().getContextClassLoader());
+ int capacity = config.get(IcebergConfig.TABLE_METADATA_CACHE_CAPACITY);
+ int expireMinutes =
config.get(IcebergConfig.TABLE_METADATA_CACHE_EXPIRE_MINUTES);
+ cache.initialize(
+ capacity, expireMinutes, config.getAllConfig(),
(SupportsMetadataLocation) catalog);
+ LOG.info(
+ "Load Iceberg table metadata cache for catalog: {}, impl:{}, capacity:
{}, expire minutes: {}",
Review Comment:
yes, it's per catatlog cache.
--
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]