From df8cc875d20c564d3c4e940ac6e720b58ae84426 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 3 Nov 2021 10:58:37 -0700 Subject: [PATCH] Inline unnecessary method in HiveMetadataFactory --- .../plugin/hive/HiveMetadataFactory.java | 46 ++----------------- 1 file changed, 3 insertions(+), 43 deletions(-) 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); - } }