Skip to content

Commit

Permalink
Remove default configuration in Caching metastore builder
Browse files Browse the repository at this point in the history
Enforce the caller provides configuration, so that
`CachingHiveMetastoreConfig` is the only source of default
configuration.
  • Loading branch information
findepi committed Apr 25, 2023
1 parent 2a3f53a commit f18f0d4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public static CachingHiveMetastore memoizeMetastore(HiveMetastore delegate, long
.maximumSize(maximumSize)
.statsRecording(StatsRecording.DISABLED)
.cacheMissing(true)
.partitionCacheEnabled(true)
.build();
}

Expand All @@ -177,7 +178,7 @@ public static class CachingHiveMetastoreBuilder
private Long maximumSize;
private StatsRecording statsRecording = StatsRecording.ENABLED;
private Boolean cacheMissing;
private boolean partitionCacheEnabled = true;
private Boolean partitionCacheEnabled;

public CachingHiveMetastoreBuilder() {}

Expand All @@ -192,7 +193,7 @@ private CachingHiveMetastoreBuilder(
Long maximumSize,
StatsRecording statsRecording,
Boolean cacheMissing,
boolean partitionCacheEnabled)
Boolean partitionCacheEnabled)
{
this.delegate = delegate;
this.executor = executor;
Expand Down Expand Up @@ -300,6 +301,7 @@ public CachingHiveMetastore build()
requireNonNull(delegate, "delegate not set");
requireNonNull(maximumSize, "maximumSize not set");
requireNonNull(cacheMissing, "cacheMissing not set");
requireNonNull(partitionCacheEnabled, "partitionCacheEnabled not set");
return new CachingHiveMetastore(
delegate,
metadataCacheEnabled,
Expand Down

0 comments on commit f18f0d4

Please sign in to comment.