diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadataFactory.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadataFactory.java index 408d4c27ce54..979d5ec693a0 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadataFactory.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/HiveMetadataFactory.java @@ -20,9 +20,7 @@ import io.trino.plugin.hive.metastore.HiveMetastore; import io.trino.plugin.hive.metastore.MetastoreConfig; import io.trino.plugin.hive.metastore.SemiTransactionalHiveMetastore; -import io.trino.plugin.hive.security.AccessControlMetadata; import io.trino.plugin.hive.security.AccessControlMetadataFactory; -import io.trino.plugin.hive.statistics.HiveStatisticsProvider; import io.trino.plugin.hive.statistics.MetastoreHiveStatisticsProvider; import io.trino.spi.type.TypeManager; @@ -178,7 +176,8 @@ public HiveMetadataFactory( public TransactionalMetadata create() { HiveMetastoreClosure hiveMetastoreClosure = new HiveMetastoreClosure( - memoizeMetastore(this.metastore, perTransactionCacheMaximumSize)); // per-transaction cache + memoizeMetastore(metastore, perTransactionCacheMaximumSize)); // per-transaction cache + SemiTransactionalHiveMetastore metastore = new SemiTransactionalHiveMetastore( hdfsEnvironment, hiveMetastoreClosure, @@ -190,7 +189,7 @@ public TransactionalMetadata create() hiveTransactionHeartbeatInterval, heartbeatService); - return create( + return new HiveMetadata( catalogName, metastore, hdfsEnvironment, @@ -209,43 +208,4 @@ public TransactionalMetadata create() hiveMaterializedViewMetadataFactory.create(hiveMetastoreClosure), accessControlMetadataFactory.create(metastore)); } - - protected TransactionalMetadata create( - CatalogName catalogName, - SemiTransactionalHiveMetastore metastore, - HdfsEnvironment hdfsEnvironment, - HivePartitionManager partitionManager, - boolean writesToNonManagedTablesEnabled, - boolean createsOfNonManagedTablesEnabled, - boolean translateHiveViews, - boolean hideDeltaLakeTables, - TypeManager typeManager, - LocationService locationService, - JsonCodec partitionUpdateCodec, - String trinoVersion, - HiveStatisticsProvider hiveStatisticsProvider, - HiveRedirectionsProvider hiveRedirectionsProvider, - Set systemTableProviders, - HiveMaterializedViewMetadata hiveMaterializedViewMetadata, - AccessControlMetadata accessControlMetadata) - { - return new HiveMetadata( - catalogName, - metastore, - hdfsEnvironment, - partitionManager, - writesToNonManagedTablesEnabled, - createsOfNonManagedTablesEnabled, - translateHiveViews, - hideDeltaLakeTables, - typeManager, - locationService, - partitionUpdateCodec, - trinoVersion, - hiveStatisticsProvider, - hiveRedirectionsProvider, - systemTableProviders, - hiveMaterializedViewMetadata, - accessControlMetadata); - } }