diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/GlueMetastoreModule.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/GlueMetastoreModule.java index 2217c7690d49..ca70fea9ddc7 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/GlueMetastoreModule.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/GlueMetastoreModule.java @@ -46,6 +46,7 @@ import java.util.Set; import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkState; import static com.google.inject.multibindings.OptionalBinder.newOptionalBinder; import static com.google.inject.multibindings.ProvidesIntoOptional.Type.DEFAULT; import static io.airlift.configuration.ConfigBinder.configBinder; @@ -96,6 +97,12 @@ public static GlueCache createGlueCache(CachingHiveMetastoreConfig config, NodeM boolean enabled = nodeManager.getCurrentNode().isCoordinator() && (metadataCacheTtl.toMillis() > 0 || statsCacheTtl.toMillis() > 0); + checkState(config.getMetastoreRefreshInterval().isEmpty(), "Metastore refresh interval is not supported with Glue v2"); + checkState(config.isPartitionCacheEnabled(), "Disabling partitions cache is not supported with Glue v2"); + checkState(config.isCacheMissing(), "Disabling cache missing is not supported with Glue v2"); + checkState(config.isCacheMissingPartitions(), "Disabling cache missing partitions is not supported with Glue v2"); + checkState(config.isCacheMissingStats(), "Disabling cache missing stats is not supported with Glue v2"); + if (enabled) { return new InMemoryGlueCache(metadataCacheTtl, statsCacheTtl, config.getMetastoreCacheMaximumSize()); }