diff --git a/lib/trino-filesystem-cache-alluxio/pom.xml b/lib/trino-filesystem-cache-alluxio/pom.xml index f66de3c15c3..f169d718b47 100644 --- a/lib/trino-filesystem-cache-alluxio/pom.xml +++ b/lib/trino-filesystem-cache-alluxio/pom.xml @@ -63,6 +63,11 @@ trino-filesystem + + io.trino + trino-spi + + jakarta.annotation jakarta.annotation-api @@ -112,12 +117,6 @@ runtime - - io.trino - trino-spi - runtime - - io.airlift junit-extensions diff --git a/lib/trino-filesystem-cache-alluxio/src/main/java/io/trino/filesystem/alluxio/AlluxioFileSystemCacheModule.java b/lib/trino-filesystem-cache-alluxio/src/main/java/io/trino/filesystem/alluxio/AlluxioFileSystemCacheModule.java index d4acfe96d4c..4d063e05e5d 100644 --- a/lib/trino-filesystem-cache-alluxio/src/main/java/io/trino/filesystem/alluxio/AlluxioFileSystemCacheModule.java +++ b/lib/trino-filesystem-cache-alluxio/src/main/java/io/trino/filesystem/alluxio/AlluxioFileSystemCacheModule.java @@ -16,11 +16,13 @@ import alluxio.metrics.MetricsConfig; import alluxio.metrics.MetricsSystem; import com.google.inject.Binder; +import com.google.inject.Provider; import io.airlift.configuration.AbstractConfigurationAwareModule; import io.trino.filesystem.cache.CachingHostAddressProvider; import io.trino.filesystem.cache.ConsistentHashingHostAddressProvider; import io.trino.filesystem.cache.ConsistentHashingHostAddressProviderConfig; import io.trino.filesystem.cache.TrinoFileSystemCache; +import io.trino.spi.catalog.CatalogName; import java.util.Properties; @@ -45,7 +47,9 @@ protected void setup(Binder binder) configBinder(binder).bindConfig(AlluxioFileSystemCacheConfig.class); configBinder(binder).bindConfig(ConsistentHashingHostAddressProviderConfig.class); binder.bind(AlluxioCacheStats.class).in(SINGLETON); - newExporter(binder).export(AlluxioCacheStats.class).as(generator -> generator.generatedNameOf(AlluxioCacheStats.class)); + Provider catalogName = binder.getProvider(CatalogName.class); + newExporter(binder).export(AlluxioCacheStats.class) + .as(generator -> generator.generatedNameOf(AlluxioCacheStats.class, catalogName.get().toString())); if (isCoordinator) { newOptionalBinder(binder, CachingHostAddressProvider.class).setBinding().to(ConsistentHashingHostAddressProvider.class).in(SINGLETON); diff --git a/testing/trino-product-tests/src/main/java/io/trino/tests/product/utils/CachingTestUtils.java b/testing/trino-product-tests/src/main/java/io/trino/tests/product/utils/CachingTestUtils.java index a1ce1d3a8c9..3e28296ac6e 100644 --- a/testing/trino-product-tests/src/main/java/io/trino/tests/product/utils/CachingTestUtils.java +++ b/testing/trino-product-tests/src/main/java/io/trino/tests/product/utils/CachingTestUtils.java @@ -27,7 +27,7 @@ public static CacheStats getCacheStats(String catalog) QueryResult queryResult = onTrino().executeQuery("SELECT " + " sum(\"cachereads.alltime.count\") as cachereads, " + " sum(\"externalreads.alltime.count\") as externalreads " + - "FROM jmx.current.\"io.trino.filesystem.alluxio:name=" + catalog + ",type=alluxiocachestats\";"); + "FROM jmx.current.\"io.trino.filesystem.alluxio:catalog=" + catalog + ",name=" + catalog + ",type=alluxiocachestats\";"); double cacheReads = (Double) getOnlyElement(queryResult.rows()) .get(queryResult.tryFindColumnIndex("cachereads").get() - 1);