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
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import io.trino.plugin.base.classloader.ClassLoaderSafeConnectorSplitManager;
import io.trino.plugin.base.classloader.ClassLoaderSafeEventListener;
import io.trino.plugin.base.classloader.ClassLoaderSafeNodePartitioningProvider;
import io.trino.plugin.base.jmx.ConnectorObjectNameGeneratorModule;
import io.trino.plugin.base.jmx.MBeanServerModule;
import io.trino.plugin.base.session.SessionPropertiesProvider;
import io.trino.plugin.deltalake.metastore.DeltaLakeMetastoreModule;
Expand Down Expand Up @@ -77,6 +78,7 @@ public static Connector createConnector(
Bootstrap app = new Bootstrap(
new EventModule(),
new MBeanModule(),
new ConnectorObjectNameGeneratorModule(catalogName, "io.trino.plugin.deltalake", "trino.plugin.deltalake"),
new JsonModule(),
new MBeanServerModule(),
new HiveHdfsModule(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@
import io.trino.spi.statistics.ColumnStatisticType;
import io.trino.spi.type.Type;
import org.apache.hadoop.fs.Path;
import org.weakref.jmx.Flatten;
import org.weakref.jmx.Managed;

import javax.annotation.Nullable;
import javax.inject.Inject;
Expand Down Expand Up @@ -230,6 +232,8 @@ else if (config.getPinGlueClientToCurrentRegion()) {
return asyncGlueClientBuilder.build();
}

@Managed
@Flatten
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dain you removed these two annotations in a commit here: a4142de#diff-d827fd361f2fef94d35ef8593d0f9a7f168366f28acdb88a67ff413b1904a3d0

Was that on purpose?

public GlueMetastoreStats getStats()
{
return stats;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ protected void setup(Binder binder)
{
configBinder(binder).bindConfig(GlueHiveMetastoreConfig.class);
binder.bind(GlueMetastoreStats.class).in(Scopes.SINGLETON);
newExporter(binder).export(GlueMetastoreStats.class).withGeneratedName();
binder.bind(AWSCredentialsProvider.class).toProvider(GlueCredentialsProvider.class).in(Scopes.SINGLETON);
binder.bind(IcebergTableOperationsProvider.class).to(GlueIcebergTableOperationsProvider.class).in(Scopes.SINGLETON);
binder.bind(TrinoCatalogFactory.class).to(TrinoGlueCatalogFactory.class).in(Scopes.SINGLETON);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.tests.product.deltalake;

import io.trino.tempto.ProductTest;
import org.testng.annotations.Test;

import static io.trino.tempto.assertions.QueryAssert.Row.row;
import static io.trino.tempto.assertions.QueryAssert.assertThat;
import static io.trino.tests.product.TestGroups.DELTA_LAKE_DATABRICKS;
import static io.trino.tests.product.TestGroups.DELTA_LAKE_OSS;
import static io.trino.tests.product.TestGroups.PROFILE_SPECIFIC_TESTS;
import static io.trino.tests.product.utils.QueryExecutors.onTrino;

public class TestDeltaLakeJmx
extends ProductTest
{
@Test(groups = {DELTA_LAKE_DATABRICKS, PROFILE_SPECIFIC_TESTS})
public void testJmxTablesExposedByDeltaLakeConnectorBackedByGlueMetastore()
{
assertThat(onTrino().executeQuery("SHOW TABLES IN jmx.current LIKE '%name=delta%'")).containsOnly(
row("io.trino.plugin.hive.metastore.cache:name=delta,type=cachinghivemetastore"),
row("io.trino.plugin.hive.metastore.glue:name=delta,type=gluehivemetastore"),
row("io.trino.plugin.hive.s3:name=delta,type=trinos3filesystem"),
row("io.trino.plugin.hive:catalog=delta,name=delta,type=fileformatdatasourcestats"),
row("io.trino.plugin.hive:name=delta,type=namenodestats"),
row("trino.plugin.deltalake.transactionlog:catalog=delta,name=delta,type=transactionlogaccess"));
}

@Test(groups = {DELTA_LAKE_OSS, PROFILE_SPECIFIC_TESTS})
public void testJmxTablesExposedByDeltaLakeConnectorBackedByThriftMetastore()
{
assertThat(onTrino().executeQuery("SHOW TABLES IN jmx.current LIKE '%name=delta%'")).containsOnly(
row("io.trino.plugin.hive.metastore.cache:name=delta,type=cachinghivemetastore"),
row("io.trino.plugin.hive.metastore.thrift:name=delta,type=thrifthivemetastore"),
row("io.trino.plugin.hive.s3:name=delta,type=trinos3filesystem"),
row("io.trino.plugin.hive:catalog=delta,name=delta,type=fileformatdatasourcestats"),
row("io.trino.plugin.hive:name=delta,type=namenodestats"),
row("trino.plugin.deltalake.transactionlog:catalog=delta,name=delta,type=transactionlogaccess"));
}
}