Skip to content

Commit

Permalink
Validate unsupported configuration options for Glue v2
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed May 22, 2024
1 parent 316b29c commit 274f0c0
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit 274f0c0

Please sign in to comment.