From e4e0d197f4fe2e7889586a1503aaf7692601fbd4 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Tue, 19 Jul 2022 23:46:55 -0700 Subject: [PATCH] Remove usages of MethodHandleUtil.methodHandle() --- .../java/io/trino/execution/TestCallTask.java | 2 +- .../FlushJdbcMetadataCacheProcedure.java | 15 +++++++++---- .../procedure/DropExtendedStatsProcedure.java | 20 +++++++++-------- .../deltalake/procedure/VacuumProcedure.java | 20 +++++++++-------- .../FlushHiveMetastoreCacheProcedure.java | 21 ++++++++++-------- .../WriteHiveMetastoreRecordingProcedure.java | 15 +++++++++---- .../CreateEmptyPartitionProcedure.java | 21 +++++++++--------- .../hive/procedure/DropStatsProcedure.java | 20 +++++++++-------- .../procedure/RegisterPartitionProcedure.java | 22 +++++++++---------- .../SyncPartitionMetadataProcedure.java | 21 +++++++++--------- .../UnregisterPartitionProcedure.java | 21 +++++++++--------- .../iceberg/RollbackToSnapshotProcedure.java | 19 +++++++++------- .../procedures/RangePartitionProcedures.java | 18 ++++++++++----- .../io/trino/procedure/TestProcedure.java | 2 +- .../io/trino/tests/TestProcedureCreation.java | 2 +- 15 files changed, 138 insertions(+), 101 deletions(-) diff --git a/core/trino-main/src/test/java/io/trino/execution/TestCallTask.java b/core/trino-main/src/test/java/io/trino/execution/TestCallTask.java index 7aea07c9c9c9e..a681565a5d77f 100644 --- a/core/trino-main/src/test/java/io/trino/execution/TestCallTask.java +++ b/core/trino-main/src/test/java/io/trino/execution/TestCallTask.java @@ -49,7 +49,6 @@ import static io.airlift.concurrent.Threads.daemonThreadsNamed; import static io.trino.SessionTestUtils.TEST_SESSION; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; import static io.trino.sql.planner.TestingPlannerContext.plannerContextBuilder; import static io.trino.testing.TestingAccessControlManager.TestingPrivilegeType.INSERT_TABLE; import static io.trino.testing.TestingAccessControlManager.privilege; @@ -57,6 +56,7 @@ import static io.trino.testing.TestingHandles.TEST_CATALOG_HANDLE; import static io.trino.testing.TestingHandles.TEST_CATALOG_NAME; import static io.trino.testing.TestingSession.testSessionBuilder; +import static io.trino.util.Reflection.methodHandle; import static java.util.concurrent.Executors.newCachedThreadPool; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/procedure/FlushJdbcMetadataCacheProcedure.java b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/procedure/FlushJdbcMetadataCacheProcedure.java index 5de688656549f..93fdc31233746 100644 --- a/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/procedure/FlushJdbcMetadataCacheProcedure.java +++ b/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/procedure/FlushJdbcMetadataCacheProcedure.java @@ -24,15 +24,22 @@ import java.lang.invoke.MethodHandle; import java.util.Optional; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; +import static java.lang.invoke.MethodHandles.lookup; import static java.util.Objects.requireNonNull; public class FlushJdbcMetadataCacheProcedure implements Provider { - private static final MethodHandle FLUSH_JDBC_METADATA_CACHE = methodHandle( - FlushJdbcMetadataCacheProcedure.class, - "flushMetadataCache"); + private static final MethodHandle FLUSH_JDBC_METADATA_CACHE; + + static { + try { + FLUSH_JDBC_METADATA_CACHE = lookup().unreflect(FlushJdbcMetadataCacheProcedure.class.getMethod("flushMetadataCache")); + } + catch (ReflectiveOperationException e) { + throw new AssertionError(e); + } + } private final CachingJdbcClient cachingJdbcClient; private final Optional cachingIdentifierMapping; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/procedure/DropExtendedStatsProcedure.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/procedure/DropExtendedStatsProcedure.java index 2db2a4e880028..c7faa8f5b18a1 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/procedure/DropExtendedStatsProcedure.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/procedure/DropExtendedStatsProcedure.java @@ -31,22 +31,24 @@ import static io.trino.plugin.deltalake.procedure.Procedures.checkProcedureArgument; import static io.trino.spi.StandardErrorCode.INVALID_PROCEDURE_ARGUMENT; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; import static io.trino.spi.type.VarcharType.VARCHAR; import static java.lang.String.format; +import static java.lang.invoke.MethodHandles.lookup; import static java.util.Objects.requireNonNull; public class DropExtendedStatsProcedure implements Provider { - private static final MethodHandle PROCEDURE_METHOD = methodHandle( - DropExtendedStatsProcedure.class, - "dropStats", - ConnectorSession.class, - ConnectorAccessControl.class, - // Schema name and table name - String.class, - String.class); + private static final MethodHandle PROCEDURE_METHOD; + + static { + try { + PROCEDURE_METHOD = lookup().unreflect(DropExtendedStatsProcedure.class.getMethod("dropStats", ConnectorSession.class, ConnectorAccessControl.class, String.class, String.class)); + } + catch (ReflectiveOperationException e) { + throw new AssertionError(e); + } + } private final DeltaLakeMetadataFactory metadataFactory; private final ExtendedStatisticsAccess statsAccess; diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/procedure/VacuumProcedure.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/procedure/VacuumProcedure.java index fda36f99cf299..6d3606ff4c9f0 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/procedure/VacuumProcedure.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/procedure/VacuumProcedure.java @@ -59,9 +59,9 @@ import static io.trino.plugin.deltalake.transactionlog.TransactionLogUtil.TRANSACTION_LOG_DIRECTORY; import static io.trino.plugin.deltalake.transactionlog.TransactionLogUtil.getTransactionLogDir; import static io.trino.spi.StandardErrorCode.GENERIC_INTERNAL_ERROR; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; import static io.trino.spi.type.VarcharType.VARCHAR; import static java.lang.String.format; +import static java.lang.invoke.MethodHandles.lookup; import static java.util.Comparator.naturalOrder; import static java.util.Objects.requireNonNull; @@ -70,14 +70,16 @@ public class VacuumProcedure { private static final Logger log = Logger.get(VacuumProcedure.class); - private static final MethodHandle VACUUM = methodHandle( - VacuumProcedure.class, - "vacuum", - ConnectorSession.class, - ConnectorAccessControl.class, - String.class, - String.class, - String.class); + private static final MethodHandle VACUUM; + + static { + try { + VACUUM = lookup().unreflect(VacuumProcedure.class.getMethod("vacuum", ConnectorSession.class, ConnectorAccessControl.class, String.class, String.class, String.class)); + } + catch (ReflectiveOperationException e) { + throw new AssertionError(e); + } + } private final CatalogName catalogName; private final HdfsEnvironment hdfsEnvironment; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/procedure/FlushHiveMetastoreCacheProcedure.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/procedure/FlushHiveMetastoreCacheProcedure.java index d17fb6419aa2c..937233e438eea 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/procedure/FlushHiveMetastoreCacheProcedure.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/procedure/FlushHiveMetastoreCacheProcedure.java @@ -29,9 +29,9 @@ import java.util.Optional; import static com.google.common.base.Preconditions.checkState; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; import static io.trino.spi.type.VarcharType.VARCHAR; import static java.lang.String.format; +import static java.lang.invoke.MethodHandles.lookup; import static java.util.Locale.ENGLISH; import static java.util.Objects.requireNonNull; @@ -56,14 +56,17 @@ public class FlushHiveMetastoreCacheProcedure PARAM_PARTITION_COLUMN.toLowerCase(ENGLISH), PARAM_PARTITION_VALUE.toLowerCase(ENGLISH)); - private static final MethodHandle FLUSH_HIVE_METASTORE_CACHE = methodHandle( - FlushHiveMetastoreCacheProcedure.class, - "flushMetadataCache", - String.class, - String.class, - String.class, - List.class, - List.class); + private static final MethodHandle FLUSH_HIVE_METASTORE_CACHE; + + static { + try { + FLUSH_HIVE_METASTORE_CACHE = lookup().unreflect(FlushHiveMetastoreCacheProcedure.class.getMethod("flushMetadataCache", String.class, String.class, String.class, List.class, List.class)); + } + catch (ReflectiveOperationException e) { + throw new AssertionError(e); + } + } + private static final String FAKE_PARAM_DEFAULT_VALUE = "procedure should only be invoked with named parameters"; private final Optional cachingHiveMetastore; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/WriteHiveMetastoreRecordingProcedure.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/WriteHiveMetastoreRecordingProcedure.java index 3417d8fd2ad98..6676a80321f77 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/WriteHiveMetastoreRecordingProcedure.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/recording/WriteHiveMetastoreRecordingProcedure.java @@ -23,15 +23,22 @@ import java.io.IOException; import java.lang.invoke.MethodHandle; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; +import static java.lang.invoke.MethodHandles.lookup; import static java.util.Objects.requireNonNull; public class WriteHiveMetastoreRecordingProcedure implements Provider { - private static final MethodHandle WRITE_HIVE_METASTORE_RECORDING = methodHandle( - WriteHiveMetastoreRecordingProcedure.class, - "writeHiveMetastoreRecording"); + private static final MethodHandle WRITE_HIVE_METASTORE_RECORDING; + + static { + try { + WRITE_HIVE_METASTORE_RECORDING = lookup().unreflect(WriteHiveMetastoreRecordingProcedure.class.getMethod("writeHiveMetastoreRecording")); + } + catch (ReflectiveOperationException e) { + throw new AssertionError(e); + } + } private final RateLimiter rateLimiter = RateLimiter.create(0.2); private final HiveMetastoreRecording hiveMetastoreRecording; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/CreateEmptyPartitionProcedure.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/CreateEmptyPartitionProcedure.java index 1a6bc7a1c429b..d6021839a4374 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/CreateEmptyPartitionProcedure.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/CreateEmptyPartitionProcedure.java @@ -48,24 +48,25 @@ import static com.google.common.collect.ImmutableList.toImmutableList; import static io.trino.spi.StandardErrorCode.ALREADY_EXISTS; import static io.trino.spi.StandardErrorCode.INVALID_PROCEDURE_ARGUMENT; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; import static io.trino.spi.connector.RetryMode.NO_RETRIES; import static io.trino.spi.type.VarcharType.VARCHAR; import static java.lang.String.format; +import static java.lang.invoke.MethodHandles.lookup; import static java.util.Objects.requireNonNull; public class CreateEmptyPartitionProcedure implements Provider { - private static final MethodHandle CREATE_EMPTY_PARTITION = methodHandle( - CreateEmptyPartitionProcedure.class, - "createEmptyPartition", - ConnectorSession.class, - ConnectorAccessControl.class, - String.class, - String.class, - List.class, - List.class); + private static final MethodHandle CREATE_EMPTY_PARTITION; + + static { + try { + CREATE_EMPTY_PARTITION = lookup().unreflect(CreateEmptyPartitionProcedure.class.getMethod("createEmptyPartition", ConnectorSession.class, ConnectorAccessControl.class, String.class, String.class, List.class, List.class)); + } + catch (ReflectiveOperationException e) { + throw new AssertionError(e); + } + } private final TransactionalMetadataFactory hiveMetadataFactory; private final LocationService locationService; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/DropStatsProcedure.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/DropStatsProcedure.java index 3b9fa2fccf326..a6f56d04cd948 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/DropStatsProcedure.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/DropStatsProcedure.java @@ -41,9 +41,9 @@ import static com.google.common.collect.ImmutableList.toImmutableList; import static io.trino.plugin.hive.acid.AcidTransaction.NO_ACID_TRANSACTION; import static io.trino.spi.StandardErrorCode.INVALID_PROCEDURE_ARGUMENT; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; import static io.trino.spi.type.VarcharType.VARCHAR; import static java.lang.String.format; +import static java.lang.invoke.MethodHandles.lookup; import static java.util.Objects.requireNonNull; import static org.apache.hadoop.hive.metastore.utils.FileUtils.makePartName; @@ -55,14 +55,16 @@ public class DropStatsProcedure implements Provider { - private static final MethodHandle DROP_STATS = methodHandle( - DropStatsProcedure.class, - "dropStats", - ConnectorSession.class, - ConnectorAccessControl.class, - String.class, - String.class, - List.class); + private static final MethodHandle DROP_STATS; + + static { + try { + DROP_STATS = lookup().unreflect(DropStatsProcedure.class.getMethod("dropStats", ConnectorSession.class, ConnectorAccessControl.class, String.class, String.class, List.class)); + } + catch (ReflectiveOperationException e) { + throw new AssertionError(e); + } + } private final TransactionalMetadataFactory hiveMetadataFactory; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/RegisterPartitionProcedure.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/RegisterPartitionProcedure.java index b1db53d9ab94e..b82d1d7bc74ea 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/RegisterPartitionProcedure.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/RegisterPartitionProcedure.java @@ -48,24 +48,24 @@ import static io.trino.spi.StandardErrorCode.ALREADY_EXISTS; import static io.trino.spi.StandardErrorCode.INVALID_PROCEDURE_ARGUMENT; import static io.trino.spi.StandardErrorCode.PERMISSION_DENIED; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; import static io.trino.spi.type.VarcharType.VARCHAR; import static java.lang.String.format; +import static java.lang.invoke.MethodHandles.lookup; import static java.util.Objects.requireNonNull; public class RegisterPartitionProcedure implements Provider { - private static final MethodHandle REGISTER_PARTITION = methodHandle( - RegisterPartitionProcedure.class, - "registerPartition", - ConnectorSession.class, - ConnectorAccessControl.class, - String.class, - String.class, - List.class, - List.class, - String.class); + private static final MethodHandle REGISTER_PARTITION; + + static { + try { + REGISTER_PARTITION = lookup().unreflect(RegisterPartitionProcedure.class.getMethod("registerPartition", ConnectorSession.class, ConnectorAccessControl.class, String.class, String.class, List.class, List.class, String.class)); + } + catch (ReflectiveOperationException e) { + throw new AssertionError(e); + } + } private final boolean allowRegisterPartition; private final TransactionalMetadataFactory hiveMetadataFactory; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/SyncPartitionMetadataProcedure.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/SyncPartitionMetadataProcedure.java index d881c1bccd84d..0ae129fd6201b 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/SyncPartitionMetadataProcedure.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/SyncPartitionMetadataProcedure.java @@ -53,10 +53,10 @@ import static io.trino.plugin.hive.HiveMetadata.PRESTO_QUERY_ID_NAME; import static io.trino.plugin.hive.HivePartitionManager.extractPartitionValues; import static io.trino.spi.StandardErrorCode.INVALID_PROCEDURE_ARGUMENT; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; import static io.trino.spi.type.BooleanType.BOOLEAN; import static io.trino.spi.type.VarcharType.VARCHAR; import static java.lang.Boolean.TRUE; +import static java.lang.invoke.MethodHandles.lookup; import static java.util.Locale.ENGLISH; import static java.util.Objects.requireNonNull; @@ -70,15 +70,16 @@ public enum SyncMode private static final int BATCH_GET_PARTITIONS_BY_NAMES_MAX_PAGE_SIZE = 1000; - private static final MethodHandle SYNC_PARTITION_METADATA = methodHandle( - SyncPartitionMetadataProcedure.class, - "syncPartitionMetadata", - ConnectorSession.class, - ConnectorAccessControl.class, - String.class, - String.class, - String.class, - boolean.class); + private static final MethodHandle SYNC_PARTITION_METADATA; + + static { + try { + SYNC_PARTITION_METADATA = lookup().unreflect(SyncPartitionMetadataProcedure.class.getMethod("syncPartitionMetadata", ConnectorSession.class, ConnectorAccessControl.class, String.class, String.class, String.class, boolean.class)); + } + catch (ReflectiveOperationException e) { + throw new AssertionError(e); + } + } private final TransactionalMetadataFactory hiveMetadataFactory; private final HdfsEnvironment hdfsEnvironment; diff --git a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/UnregisterPartitionProcedure.java b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/UnregisterPartitionProcedure.java index b68a0390e04d1..7a37ba773abaf 100644 --- a/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/UnregisterPartitionProcedure.java +++ b/plugin/trino-hive/src/main/java/io/trino/plugin/hive/procedure/UnregisterPartitionProcedure.java @@ -37,23 +37,24 @@ import static io.trino.plugin.hive.procedure.Procedures.checkIsPartitionedTable; import static io.trino.plugin.hive.procedure.Procedures.checkPartitionColumns; import static io.trino.spi.StandardErrorCode.NOT_FOUND; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; import static io.trino.spi.type.VarcharType.VARCHAR; import static java.lang.String.format; +import static java.lang.invoke.MethodHandles.lookup; import static java.util.Objects.requireNonNull; public class UnregisterPartitionProcedure implements Provider { - private static final MethodHandle UNREGISTER_PARTITION = methodHandle( - UnregisterPartitionProcedure.class, - "unregisterPartition", - ConnectorSession.class, - ConnectorAccessControl.class, - String.class, - String.class, - List.class, - List.class); + private static final MethodHandle UNREGISTER_PARTITION; + + static { + try { + UNREGISTER_PARTITION = lookup().unreflect(UnregisterPartitionProcedure.class.getMethod("unregisterPartition", ConnectorSession.class, ConnectorAccessControl.class, String.class, String.class, List.class, List.class)); + } + catch (ReflectiveOperationException e) { + throw new AssertionError(e); + } + } private final TransactionalMetadataFactory hiveMetadataFactory; diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/RollbackToSnapshotProcedure.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/RollbackToSnapshotProcedure.java index af22fe183979e..111236334e5b5 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/RollbackToSnapshotProcedure.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/RollbackToSnapshotProcedure.java @@ -26,21 +26,24 @@ import java.lang.invoke.MethodHandle; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; import static io.trino.spi.type.BigintType.BIGINT; import static io.trino.spi.type.VarcharType.VARCHAR; +import static java.lang.invoke.MethodHandles.lookup; import static java.util.Objects.requireNonNull; public class RollbackToSnapshotProcedure implements Provider { - private static final MethodHandle ROLLBACK_TO_SNAPSHOT = methodHandle( - RollbackToSnapshotProcedure.class, - "rollbackToSnapshot", - ConnectorSession.class, - String.class, - String.class, - Long.class); + private static final MethodHandle ROLLBACK_TO_SNAPSHOT; + + static { + try { + ROLLBACK_TO_SNAPSHOT = lookup().unreflect(RollbackToSnapshotProcedure.class.getMethod("rollbackToSnapshot", ConnectorSession.class, String.class, String.class, Long.class)); + } + catch (ReflectiveOperationException e) { + throw new AssertionError(e); + } + } private final TrinoCatalogFactory catalogFactory; private final ClassLoader classLoader; diff --git a/plugin/trino-kudu/src/main/java/io/trino/plugin/kudu/procedures/RangePartitionProcedures.java b/plugin/trino-kudu/src/main/java/io/trino/plugin/kudu/procedures/RangePartitionProcedures.java index f88ec6e6f6877..4a2fb40b0e83a 100644 --- a/plugin/trino-kudu/src/main/java/io/trino/plugin/kudu/procedures/RangePartitionProcedures.java +++ b/plugin/trino-kudu/src/main/java/io/trino/plugin/kudu/procedures/RangePartitionProcedures.java @@ -25,16 +25,24 @@ import java.lang.invoke.MethodHandle; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; import static io.trino.spi.type.VarcharType.VARCHAR; +import static java.lang.invoke.MethodHandles.lookup; import static java.util.Objects.requireNonNull; public class RangePartitionProcedures { - private static final MethodHandle ADD = methodHandle(RangePartitionProcedures.class, "addRangePartition", - String.class, String.class, String.class); - private static final MethodHandle DROP = methodHandle(RangePartitionProcedures.class, "dropRangePartition", - String.class, String.class, String.class); + private static final MethodHandle ADD; + private static final MethodHandle DROP; + + static { + try { + ADD = lookup().unreflect(RangePartitionProcedures.class.getMethod("addRangePartition", String.class, String.class, String.class)); + DROP = lookup().unreflect(RangePartitionProcedures.class.getMethod("dropRangePartition", String.class, String.class, String.class)); + } + catch (ReflectiveOperationException e) { + throw new AssertionError(e); + } + } private final KuduClientSession clientSession; diff --git a/testing/trino-tests/src/test/java/io/trino/procedure/TestProcedure.java b/testing/trino-tests/src/test/java/io/trino/procedure/TestProcedure.java index 7380c23279468..132ffc2dcf276 100644 --- a/testing/trino-tests/src/test/java/io/trino/procedure/TestProcedure.java +++ b/testing/trino-tests/src/test/java/io/trino/procedure/TestProcedure.java @@ -19,7 +19,7 @@ import java.lang.invoke.MethodHandle; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; +import static io.trino.util.Reflection.methodHandle; import static java.util.Collections.emptyList; public class TestProcedure diff --git a/testing/trino-tests/src/test/java/io/trino/tests/TestProcedureCreation.java b/testing/trino-tests/src/test/java/io/trino/tests/TestProcedureCreation.java index 5a22853a5012e..a424cca562457 100644 --- a/testing/trino-tests/src/test/java/io/trino/tests/TestProcedureCreation.java +++ b/testing/trino-tests/src/test/java/io/trino/tests/TestProcedureCreation.java @@ -20,8 +20,8 @@ import java.util.List; -import static io.trino.spi.block.MethodHandleUtil.methodHandle; import static io.trino.spi.type.VarcharType.VARCHAR; +import static io.trino.util.Reflection.methodHandle; import static org.assertj.core.api.Assertions.assertThatThrownBy; public class TestProcedureCreation