Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/trino-filesystem-cache-alluxio/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<artifactId>trino-filesystem</artifactId>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-spi</artifactId>
</dependency>

<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
Expand Down Expand Up @@ -112,12 +117,6 @@
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-spi</artifactId>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>junit-extensions</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading