From f1a8feb8e4d38fc771c0d09f85c93dae3886456a Mon Sep 17 00:00:00 2001 From: Manfred Moser Date: Thu, 26 Sep 2024 13:08:04 -0700 Subject: [PATCH] Remove atop connector The connector has very limited use since it only works with the atop command. Much more modern monitoring tools are in standard use now and replace usage of atop. In a contributor call, on slack and in other conversations no concerns were expressed by anybody about the removal. --- core/trino-server/src/main/provisio/trino.xml | 6 - docs/release-template.md | 2 - docs/src/main/sphinx/connector.md | 1 - docs/src/main/sphinx/connector/atop.md | 142 ------------- plugin/trino-atop/pom.xml | 158 --------------- .../main/java/io/trino/plugin/atop/Atop.java | 24 --- .../trino/plugin/atop/AtopColumnHandle.java | 27 --- .../io/trino/plugin/atop/AtopConnector.java | 90 --------- .../plugin/atop/AtopConnectorConfig.java | 128 ------------ .../plugin/atop/AtopConnectorFactory.java | 83 -------- .../io/trino/plugin/atop/AtopErrorCode.java | 40 ---- .../io/trino/plugin/atop/AtopFactory.java | 21 -- .../io/trino/plugin/atop/AtopMetadata.java | 188 ------------------ .../java/io/trino/plugin/atop/AtopModule.java | 54 ----- .../io/trino/plugin/atop/AtopPageSource.java | 174 ---------------- .../plugin/atop/AtopPageSourceProvider.java | 79 -------- .../java/io/trino/plugin/atop/AtopPlugin.java | 28 --- .../trino/plugin/atop/AtopProcessFactory.java | 173 ---------------- .../java/io/trino/plugin/atop/AtopSplit.java | 113 ----------- .../trino/plugin/atop/AtopSplitManager.java | 90 --------- .../java/io/trino/plugin/atop/AtopTable.java | 179 ----------------- .../io/trino/plugin/atop/AtopTableHandle.java | 46 ----- .../plugin/atop/AtopTransactionHandle.java | 22 -- .../io/trino/plugin/atop/Environment.java | 32 --- .../io/trino/plugin/atop/AtopQueryRunner.java | 72 ------- .../plugin/atop/TestAtopConnectorConfig.java | 71 ------- .../io/trino/plugin/atop/TestAtopHang.java | 76 ------- .../io/trino/plugin/atop/TestAtopPlugin.java | 47 ----- .../trino/plugin/atop/TestAtopSecurity.java | 81 -------- .../io/trino/plugin/atop/TestAtopSmoke.java | 76 ------- .../io/trino/plugin/atop/TestAtopSplit.java | 39 ---- .../trino/plugin/atop/TestingAtopFactory.java | 109 ---------- .../resources/io/trino/plugin/atop/disks.txt | 36 ---- .../io/trino/plugin/atop/hanging_atop.sh | 1 - .../io/trino/plugin/atop/reboots.txt | 38 ---- .../io/trino/plugin/atop/security.json | 8 - pom.xml | 1 - .../EnvMultinodeAllConnectors.java | 1 - .../environment/multinode-all/atop.properties | 2 - 39 files changed, 2558 deletions(-) delete mode 100644 docs/src/main/sphinx/connector/atop.md delete mode 100644 plugin/trino-atop/pom.xml delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/Atop.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopColumnHandle.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnector.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnectorConfig.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnectorFactory.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopErrorCode.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopFactory.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopMetadata.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopModule.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPageSource.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPageSourceProvider.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPlugin.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopProcessFactory.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopSplit.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopSplitManager.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopTable.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopTableHandle.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopTransactionHandle.java delete mode 100644 plugin/trino-atop/src/main/java/io/trino/plugin/atop/Environment.java delete mode 100644 plugin/trino-atop/src/test/java/io/trino/plugin/atop/AtopQueryRunner.java delete mode 100644 plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopConnectorConfig.java delete mode 100644 plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopHang.java delete mode 100644 plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopPlugin.java delete mode 100644 plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopSecurity.java delete mode 100644 plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopSmoke.java delete mode 100644 plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopSplit.java delete mode 100644 plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestingAtopFactory.java delete mode 100644 plugin/trino-atop/src/test/resources/io/trino/plugin/atop/disks.txt delete mode 100644 plugin/trino-atop/src/test/resources/io/trino/plugin/atop/hanging_atop.sh delete mode 100644 plugin/trino-atop/src/test/resources/io/trino/plugin/atop/reboots.txt delete mode 100644 plugin/trino-atop/src/test/resources/io/trino/plugin/atop/security.json delete mode 100644 testing/trino-product-tests-launcher/src/main/resources/docker/presto-product-tests/conf/environment/multinode-all/atop.properties diff --git a/core/trino-server/src/main/provisio/trino.xml b/core/trino-server/src/main/provisio/trino.xml index acba34fd30fb8..e27ac02f7f38e 100644 --- a/core/trino-server/src/main/provisio/trino.xml +++ b/core/trino-server/src/main/provisio/trino.xml @@ -39,12 +39,6 @@ - - - - - - diff --git a/docs/release-template.md b/docs/release-template.md index 1dd8ee813deff..d41cf1df4f370 100644 --- a/docs/release-template.md +++ b/docs/release-template.md @@ -16,8 +16,6 @@ ## Accumulo connector -## Atop connector - ## BigQuery connector ## Blackhole connector diff --git a/docs/src/main/sphinx/connector.md b/docs/src/main/sphinx/connector.md index 12699a6734edb..242bcf07ad863 100644 --- a/docs/src/main/sphinx/connector.md +++ b/docs/src/main/sphinx/connector.md @@ -7,7 +7,6 @@ from different data sources. :maxdepth: 1 Accumulo -Atop BigQuery Black Hole Cassandra diff --git a/docs/src/main/sphinx/connector/atop.md b/docs/src/main/sphinx/connector/atop.md deleted file mode 100644 index 776cbde67b5e2..0000000000000 --- a/docs/src/main/sphinx/connector/atop.md +++ /dev/null @@ -1,142 +0,0 @@ -# Atop connector - -The Atop connector supports reading disk utilization statistics from the [Atop](https://www.atoptool.nl/) -(Advanced System and Process Monitor) Linux server performance analysis tool. - -## Requirements - -In order to use this connector, the host on which the Trino worker is running -needs to have the `atop` tool installed locally. - -## Connector configuration - -The connector can read disk utilization statistics on the Trino cluster. -Create a catalog properties file that specifies the Atop connector by -setting the `connector.name` to `atop`. - -For example, create the file `etc/catalog/example.properties` with the -following connector properties as appropriate for your setup: - -```text -connector.name=atop -atop.executable-path=/usr/bin/atop -``` - -## Configuration properties - -:::{list-table} -:widths: 42, 18, 5, 35 -:header-rows: 1 - -* - Property name - - Default value - - Required - - Description -* - `atop.concurrent-readers-per-node` - - `1` - - Yes - - The number of concurrent read operations allowed per node. -* - `atop.executable-path` - - (none) - - Yes - - The file path on the local file system for the `atop` utility. -* - `atop.executable-read-timeout` - - `1ms` - - Yes - - The timeout when reading from the atop process. -* - `atop.max-history-days` - - `30` - - Yes - - The maximum number of days in the past to take into account for statistics. -* - `atop.security` - - `ALLOW_ALL` - - Yes - - The [access control](/security/built-in-system-access-control) for the connector. -* - `atop.time-zone` - - System default - - Yes - - The time zone identifier in which the atop data is collected. Generally the timezone of the host. - Sample time zone identifiers: `Europe/Vienna`, `+0100`, `UTC`. -::: - -## Usage - -The Atop connector provides a `default` schema. - -The tables exposed by this connector can be retrieved by running `SHOW TABLES`: - -``` -SHOW TABLES FROM example.default; -``` - -```text - Table ---------- - disks - reboots -(2 rows) -``` - -The `disks` table offers disk utilization statistics recorded on the Trino node. - -:::{list-table} Disks columns -:widths: 30, 30, 40 -:header-rows: 1 - -* - Name - - Type - - Description -* - `host_ip` - - `VARCHAR` - - Trino worker IP -* - `start_time` - - `TIMESTAMP(3) WITH TIME ZONE` - - Interval start time for the statistics -* - `end_time` - - `TIMESTAMP(3) WITH TIME ZONE` - - Interval end time for the statistics -* - `device_name` - - `VARCHAR` - - Logical volume/hard disk name -* - `utilization_percent` - - `DOUBLE` - - The percentage of time the unit was busy handling requests -* - `io_time` - - `INTERVAL DAY TO SECOND` - - Time spent for I/O -* - `read_requests` - - `BIGINT` - - Number of reads issued -* - `sectors_read` - - `BIGINT` - - Number of sectors transferred for reads -* - `write_requests` - - `BIGINT` - - Number of writes issued -* - `sectors_written` - - `BIGINT` - - Number of sectors transferred for write -::: - -The `reboots` table offers information about the system reboots performed on the Trino node. - -:::{list-table} Reboots columns -:widths: 30, 30, 40 -:header-rows: 1 - -* - Name - - Type - - Description -* - `host_ip` - - `VARCHAR` - - Trino worker IP -* - `power_on_time` - - `TIMESTAMP(3) WITH TIME ZONE` - - The boot/reboot timestamp -::: - -## SQL support - -The connector provides {ref}`globally available ` and -{ref}`read operation ` statements to access system and process monitor -information on your Trino nodes. diff --git a/plugin/trino-atop/pom.xml b/plugin/trino-atop/pom.xml deleted file mode 100644 index ba374a818c714..0000000000000 --- a/plugin/trino-atop/pom.xml +++ /dev/null @@ -1,158 +0,0 @@ - - - 4.0.0 - - - io.trino - trino-root - 460-SNAPSHOT - ../../pom.xml - - - trino-atop - - trino-plugin - Trino - Atop connector - - - - com.google.guava - guava - - - - com.google.inject - guice - - - - io.airlift - bootstrap - - - - io.airlift - concurrent - - - - io.airlift - configuration - - - - io.airlift - json - - - - io.airlift - units - - - - io.trino - trino-plugin-toolkit - - - - jakarta.annotation - jakarta.annotation-api - - - - jakarta.validation - jakarta.validation-api - - - - com.fasterxml.jackson.core - jackson-annotations - provided - - - - io.airlift - slice - provided - - - - io.opentelemetry - opentelemetry-api - provided - - - - io.opentelemetry - opentelemetry-context - provided - - - - io.trino - trino-spi - provided - - - - org.openjdk.jol - jol-core - provided - - - - io.airlift - log-manager - runtime - - - - io.airlift - junit-extensions - test - - - - io.airlift - testing - test - - - - io.trino - trino-main - test - - - - io.trino - trino-testing - test - - - - io.trino - trino-tpch - test - - - - org.assertj - assertj-core - test - - - - org.jetbrains - annotations - test - - - - org.junit.jupiter - junit-jupiter-api - test - - - diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/Atop.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/Atop.java deleted file mode 100644 index dbc7277c03e40..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/Atop.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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.plugin.atop; - -import java.io.Closeable; -import java.util.Iterator; - -public interface Atop - extends Closeable, Iterator -{ - @Override - void close(); -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopColumnHandle.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopColumnHandle.java deleted file mode 100644 index 0e1df2af77267..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopColumnHandle.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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.plugin.atop; - -import io.trino.spi.connector.ColumnHandle; - -import static java.util.Objects.requireNonNull; - -public record AtopColumnHandle(String name) - implements ColumnHandle -{ - public AtopColumnHandle - { - requireNonNull(name, "name is null"); - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnector.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnector.java deleted file mode 100644 index ed4a05c186fb5..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnector.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.inject.Inject; -import io.airlift.bootstrap.LifeCycleManager; -import io.trino.spi.connector.Connector; -import io.trino.spi.connector.ConnectorAccessControl; -import io.trino.spi.connector.ConnectorMetadata; -import io.trino.spi.connector.ConnectorPageSourceProvider; -import io.trino.spi.connector.ConnectorSession; -import io.trino.spi.connector.ConnectorSplitManager; -import io.trino.spi.connector.ConnectorTransactionHandle; -import io.trino.spi.transaction.IsolationLevel; - -import java.util.Optional; - -import static java.util.Objects.requireNonNull; - -public class AtopConnector - implements Connector -{ - private final LifeCycleManager lifeCycleManager; - private final AtopMetadata metadata; - private final AtopSplitManager splitManager; - private final AtopPageSourceProvider pageSourceProvider; - private final Optional accessControl; - - @Inject - public AtopConnector( - LifeCycleManager lifeCycleManager, - AtopMetadata metadata, - AtopSplitManager splitManager, - AtopPageSourceProvider pageSourceProvider, - Optional accessControl) - { - this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); - this.metadata = requireNonNull(metadata, "metadata is null"); - this.splitManager = requireNonNull(splitManager, "splitManager is null"); - this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null"); - this.accessControl = requireNonNull(accessControl, "accessControl is null"); - } - - @Override - public ConnectorTransactionHandle beginTransaction(IsolationLevel isolationLevel, boolean readOnly, boolean autoCommit) - { - return AtopTransactionHandle.INSTANCE; - } - - @Override - public ConnectorMetadata getMetadata(ConnectorSession session, ConnectorTransactionHandle transactionHandle) - { - return metadata; - } - - @Override - public ConnectorSplitManager getSplitManager() - { - return splitManager; - } - - @Override - public ConnectorPageSourceProvider getPageSourceProvider() - { - return pageSourceProvider; - } - - @Override - public ConnectorAccessControl getAccessControl() - { - return accessControl.orElseThrow(UnsupportedOperationException::new); - } - - @Override - public final void shutdown() - { - lifeCycleManager.stop(); - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnectorConfig.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnectorConfig.java deleted file mode 100644 index 4970619c58561..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnectorConfig.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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.plugin.atop; - -import io.airlift.configuration.Config; -import io.airlift.configuration.ConfigDescription; -import io.airlift.configuration.validation.FileExists; -import io.airlift.units.Duration; -import io.airlift.units.MinDuration; -import jakarta.validation.constraints.Min; -import jakarta.validation.constraints.NotNull; - -import java.time.ZoneId; - -import static java.util.concurrent.TimeUnit.MINUTES; - -public class AtopConnectorConfig -{ - public enum AtopSecurity - { - ALLOW_ALL, - FILE, - } - - private String executablePath = "atop"; - private String timeZone = ZoneId.systemDefault().getId(); - private AtopSecurity security = AtopSecurity.ALLOW_ALL; - private Duration readTimeout = new Duration(5, MINUTES); - private int concurrentReadersPerNode = 1; - private int maxHistoryDays = 30; - - @NotNull - public AtopSecurity getSecurity() - { - return security; - } - - @Config("atop.security") - public AtopConnectorConfig setSecurity(AtopSecurity security) - { - this.security = security; - return this; - } - - @NotNull - @FileExists - public String getExecutablePath() - { - return executablePath; - } - - @Config("atop.executable-path") - public AtopConnectorConfig setExecutablePath(String path) - { - this.executablePath = path; - return this; - } - - public ZoneId getTimeZoneId() - { - return ZoneId.of(timeZone); - } - - @NotNull - public String getTimeZone() - { - return timeZone; - } - - @Config("atop.time-zone") - @ConfigDescription("The timezone in which the atop data was collected. Generally the timezone of the host.") - public AtopConnectorConfig setTimeZone(String id) - { - this.timeZone = id; - return this; - } - - @MinDuration("1ms") - public Duration getReadTimeout() - { - return readTimeout; - } - - @Config("atop.executable-read-timeout") - @ConfigDescription("The timeout when reading from the atop process.") - public AtopConnectorConfig setReadTimeout(Duration timeout) - { - this.readTimeout = timeout; - return this; - } - - @Min(1) - public int getConcurrentReadersPerNode() - { - return concurrentReadersPerNode; - } - - @Config("atop.concurrent-readers-per-node") - public AtopConnectorConfig setConcurrentReadersPerNode(int readers) - { - this.concurrentReadersPerNode = readers; - return this; - } - - @Min(1) - public int getMaxHistoryDays() - { - return maxHistoryDays; - } - - @Config("atop.max-history-days") - public AtopConnectorConfig setMaxHistoryDays(int maxHistoryDays) - { - this.maxHistoryDays = maxHistoryDays; - return this; - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnectorFactory.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnectorFactory.java deleted file mode 100644 index 98b2a713a63de..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopConnectorFactory.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.inject.Injector; -import io.airlift.bootstrap.Bootstrap; -import io.airlift.json.JsonModule; -import io.trino.plugin.atop.AtopConnectorConfig.AtopSecurity; -import io.trino.plugin.base.CatalogNameModule; -import io.trino.plugin.base.security.ConnectorAccessControlModule; -import io.trino.plugin.base.security.FileBasedAccessControlModule; -import io.trino.spi.classloader.ThreadContextClassLoader; -import io.trino.spi.connector.Connector; -import io.trino.spi.connector.ConnectorContext; -import io.trino.spi.connector.ConnectorFactory; - -import java.util.Map; - -import static io.airlift.configuration.ConditionalModule.conditionalModule; -import static io.airlift.configuration.ConfigurationAwareModule.combine; -import static io.trino.plugin.base.Versions.checkStrictSpiVersionMatch; -import static java.util.Objects.requireNonNull; - -public class AtopConnectorFactory - implements ConnectorFactory -{ - private final Class atopFactoryClass; - private final ClassLoader classLoader; - - public AtopConnectorFactory(Class atopFactoryClass, ClassLoader classLoader) - { - this.atopFactoryClass = requireNonNull(atopFactoryClass, "atopFactoryClass is null"); - this.classLoader = requireNonNull(classLoader, "classLoader is null"); - } - - @Override - public String getName() - { - return "atop"; - } - - @Override - public Connector create(String catalogName, Map requiredConfig, ConnectorContext context) - { - requireNonNull(requiredConfig, "requiredConfig is null"); - checkStrictSpiVersionMatch(context, this); - - try (ThreadContextClassLoader _ = new ThreadContextClassLoader(classLoader)) { - Bootstrap app = new Bootstrap( - new AtopModule( - atopFactoryClass, - context.getTypeManager(), - context.getNodeManager(), - context.getNodeManager().getEnvironment()), - new CatalogNameModule(catalogName), - new ConnectorAccessControlModule(), - conditionalModule( - AtopConnectorConfig.class, - config -> config.getSecurity() == AtopSecurity.FILE, - combine( - new FileBasedAccessControlModule(), - new JsonModule()))); - - Injector injector = app - .doNotInitializeLogging() - .setRequiredConfigurationProperties(requiredConfig) - .initialize(); - - return injector.getInstance(AtopConnector.class); - } - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopErrorCode.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopErrorCode.java deleted file mode 100644 index 6d725b7c1b299..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopErrorCode.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.plugin.atop; - -import io.trino.spi.ErrorCode; -import io.trino.spi.ErrorCodeSupplier; -import io.trino.spi.ErrorType; - -import static io.trino.spi.ErrorType.EXTERNAL; - -public enum AtopErrorCode - implements ErrorCodeSupplier -{ - ATOP_CANNOT_START_PROCESS_ERROR(0, EXTERNAL), - ATOP_READ_TIMEOUT(1, EXTERNAL); - - private final ErrorCode errorCode; - - AtopErrorCode(int code, ErrorType type) - { - errorCode = new ErrorCode(code + 0x0500_0000, name(), type); - } - - @Override - public ErrorCode toErrorCode() - { - return errorCode; - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopFactory.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopFactory.java deleted file mode 100644 index 1ce952ac6329b..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopFactory.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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.plugin.atop; - -import java.time.ZonedDateTime; - -public interface AtopFactory -{ - Atop create(AtopTable table, ZonedDateTime date); -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopMetadata.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopMetadata.java deleted file mode 100644 index 974f9b7b1dc46..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopMetadata.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.inject.Inject; -import io.trino.plugin.atop.AtopTable.AtopColumn; -import io.trino.spi.TrinoException; -import io.trino.spi.connector.ColumnHandle; -import io.trino.spi.connector.ColumnMetadata; -import io.trino.spi.connector.ColumnNotFoundException; -import io.trino.spi.connector.ConnectorMetadata; -import io.trino.spi.connector.ConnectorSession; -import io.trino.spi.connector.ConnectorTableHandle; -import io.trino.spi.connector.ConnectorTableMetadata; -import io.trino.spi.connector.ConnectorTableVersion; -import io.trino.spi.connector.Constraint; -import io.trino.spi.connector.ConstraintApplicationResult; -import io.trino.spi.connector.SchemaTableName; -import io.trino.spi.connector.SchemaTablePrefix; -import io.trino.spi.predicate.Domain; -import io.trino.spi.type.TypeManager; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static io.trino.plugin.atop.AtopTable.AtopColumn.END_TIME; -import static io.trino.plugin.atop.AtopTable.AtopColumn.START_TIME; -import static io.trino.spi.StandardErrorCode.NOT_SUPPORTED; -import static java.util.Locale.ENGLISH; -import static java.util.Objects.requireNonNull; - -public class AtopMetadata - implements ConnectorMetadata -{ - private static final AtopColumnHandle START_TIME_HANDLE = new AtopColumnHandle(START_TIME.getName()); - private static final AtopColumnHandle END_TIME_HANDLE = new AtopColumnHandle(END_TIME.getName()); - private final TypeManager typeManager; - private final String environment; - - @Inject - public AtopMetadata(TypeManager typeManager, Environment environment) - { - this.typeManager = requireNonNull(typeManager, "typeManager is null"); - this.environment = environment.toString(); - } - - @Override - public List listSchemaNames(ConnectorSession session) - { - return ImmutableList.of("default", environment); - } - - @Override - public ConnectorTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName, Optional startVersion, Optional endVersion) - { - if (startVersion.isPresent() || endVersion.isPresent()) { - throw new TrinoException(NOT_SUPPORTED, "This connector does not support versioned tables"); - } - - requireNonNull(tableName, "tableName is null"); - - String schemaName = tableName.getSchemaName(); - if (!listSchemaNames(session).contains(schemaName)) { - return null; - } - try { - AtopTable table = AtopTable.valueOf(tableName.getTableName().toUpperCase(ENGLISH)); - return new AtopTableHandle(schemaName, table); - } - catch (IllegalArgumentException e) { - return null; - } - } - - @Override - public ConnectorTableMetadata getTableMetadata(ConnectorSession session, ConnectorTableHandle tableHandle) - { - AtopTableHandle atopTableHandle = (AtopTableHandle) tableHandle; - ImmutableList.Builder columns = ImmutableList.builder(); - for (AtopColumn column : atopTableHandle.table().getColumns()) { - columns.add(new ColumnMetadata(column.getName(), typeManager.getType(column.getType()))); - } - SchemaTableName schemaTableName = new SchemaTableName(atopTableHandle.schema(), atopTableHandle.table().getName()); - return new ConnectorTableMetadata(schemaTableName, columns.build()); - } - - @Override - public List listTables(ConnectorSession session, Optional schemaName) - { - if (schemaName.isEmpty()) { - return Stream.of(AtopTable.values()) - .map(table -> new SchemaTableName(environment, table.getName())) - .collect(Collectors.toList()); - } - if (!listSchemaNames(session).contains(schemaName.get())) { - return ImmutableList.of(); - } - return Stream.of(AtopTable.values()) - .map(table -> new SchemaTableName(schemaName.get(), table.getName())) - .collect(Collectors.toList()); - } - - @Override - public Map getColumnHandles(ConnectorSession session, ConnectorTableHandle tableHandle) - { - AtopTableHandle atopTableHandle = (AtopTableHandle) tableHandle; - ImmutableMap.Builder columnHandles = ImmutableMap.builder(); - for (AtopColumn column : atopTableHandle.table().getColumns()) { - columnHandles.put(column.getName(), new AtopColumnHandle(column.getName())); - } - return columnHandles.buildOrThrow(); - } - - @Override - public Map> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix) - { - ImmutableMap.Builder> columns = ImmutableMap.builder(); - for (SchemaTableName tableName : listTables(session, prefix.getSchema())) { - ConnectorTableMetadata tableMetadata = getTableMetadata(session, getTableHandle(session, tableName, Optional.empty(), Optional.empty())); - columns.put(tableName, tableMetadata.getColumns()); - } - return columns.buildOrThrow(); - } - - @Override - public ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle columnHandle) - { - String columnName = ((AtopColumnHandle) columnHandle).name(); - - for (ColumnMetadata column : getTableMetadata(session, tableHandle).getColumns()) { - if (column.getName().equals(columnName)) { - return column; - } - } - - AtopTableHandle atopTableHandle = (AtopTableHandle) tableHandle; - SchemaTableName tableName = new SchemaTableName(atopTableHandle.schema(), atopTableHandle.table().getName()); - throw new ColumnNotFoundException(tableName, columnName); - } - - @Override - public Optional> applyFilter(ConnectorSession session, ConnectorTableHandle table, Constraint constraint) - { - AtopTableHandle handle = (AtopTableHandle) table; - - Map domains = constraint.getSummary().getDomains().orElseThrow(() -> new IllegalArgumentException("constraint summary is NONE")); - - Domain oldEndTimeDomain = handle.endTimeConstraint(); - Domain oldStartTimeDomain = handle.startTimeConstraint(); - Domain newEndTimeDomain = oldEndTimeDomain; - Domain newStartTimeDomain = oldStartTimeDomain; - - if (domains.containsKey(START_TIME_HANDLE)) { - newStartTimeDomain = domains.get(START_TIME_HANDLE).intersect(oldStartTimeDomain); - } - if (domains.containsKey(END_TIME_HANDLE)) { - newEndTimeDomain = domains.get(END_TIME_HANDLE).intersect(oldEndTimeDomain); - } - - if (oldEndTimeDomain.equals(newEndTimeDomain) && oldStartTimeDomain.equals(newStartTimeDomain)) { - return Optional.empty(); - } - - handle = new AtopTableHandle( - handle.schema(), - handle.table(), - newStartTimeDomain, - newEndTimeDomain); - - return Optional.of(new ConstraintApplicationResult<>(handle, constraint.getSummary(), constraint.getExpression(), false)); - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopModule.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopModule.java deleted file mode 100644 index 49fac8de7d0f3..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopModule.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.inject.Binder; -import com.google.inject.Module; -import com.google.inject.Scopes; -import io.trino.spi.NodeManager; -import io.trino.spi.type.TypeManager; - -import static io.airlift.configuration.ConfigBinder.configBinder; -import static java.util.Objects.requireNonNull; - -public class AtopModule - implements Module -{ - private final Class atopFactoryClass; - private final TypeManager typeManager; - private final NodeManager nodeManager; - private final String environment; - - public AtopModule(Class atopFactoryClass, TypeManager typeManager, NodeManager nodeManager, String environment) - { - this.atopFactoryClass = requireNonNull(atopFactoryClass, "atopFactoryClass is null"); - this.typeManager = requireNonNull(typeManager, "typeManager is null"); - this.nodeManager = requireNonNull(nodeManager, "nodeManager is null"); - this.environment = requireNonNull(environment, "environment is null"); - } - - @Override - public void configure(Binder binder) - { - binder.bind(TypeManager.class).toInstance(typeManager); - binder.bind(NodeManager.class).toInstance(nodeManager); - binder.bind(Environment.class).toInstance(new Environment(environment)); - binder.bind(AtopConnector.class).in(Scopes.SINGLETON); - binder.bind(AtopMetadata.class).in(Scopes.SINGLETON); - binder.bind(AtopSplitManager.class).in(Scopes.SINGLETON); - binder.bind(AtopFactory.class).to(atopFactoryClass).in(Scopes.SINGLETON); - binder.bind(AtopPageSourceProvider.class).in(Scopes.SINGLETON); - configBinder(binder).bindConfig(AtopConnectorConfig.class); - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPageSource.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPageSource.java deleted file mode 100644 index 776cf11110061..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPageSource.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.common.base.Splitter; -import com.google.common.collect.ImmutableList; -import io.airlift.slice.Slice; -import io.trino.plugin.atop.AtopTable.AtopColumn; -import io.trino.spi.Page; -import io.trino.spi.PageBuilder; -import io.trino.spi.connector.ConnectorPageSource; -import io.trino.spi.connector.ConnectorSession; -import io.trino.spi.type.Type; -import jakarta.annotation.Nullable; - -import java.time.ZonedDateTime; -import java.util.List; -import java.util.concurrent.Semaphore; - -import static com.google.common.base.Preconditions.checkArgument; -import static java.util.Objects.requireNonNull; - -public class AtopPageSource - implements ConnectorPageSource -{ - private final Semaphore readerPermits; - private final AtopFactory atopFactory; - private final ConnectorSession session; - private final Slice hostIp; - private final AtopTable table; - private final ZonedDateTime date; - private final List columns; - private final List types; - private final PageBuilder pageBuilder; - @Nullable - private Atop atop; - private boolean finished; - - public AtopPageSource(Semaphore readerPermits, AtopFactory atopFactory, ConnectorSession session, Slice hostIp, AtopTable table, ZonedDateTime date, List columns, List types) - { - this.readerPermits = requireNonNull(readerPermits, "readerPermits is null"); - this.atopFactory = requireNonNull(atopFactory, "atopFactory is null"); - this.session = requireNonNull(session, "session is null"); - this.hostIp = requireNonNull(hostIp, "hostIp is null"); - this.table = requireNonNull(table, "table is null"); - this.date = requireNonNull(date, "date is null"); - this.columns = ImmutableList.copyOf(requireNonNull(columns, "columns is null")); - this.types = ImmutableList.copyOf(requireNonNull(types, "types is null")); - checkArgument(columns.size() == types.size(), "columns (%s) does not match types (%s)", columns.size(), types.size()); - pageBuilder = new PageBuilder(types); - } - - @Override - public void close() - { - finished = true; - if (atop != null) { - try { - atop.close(); - } - finally { - atop = null; - readerPermits.release(); - } - } - } - - @Override - public long getCompletedBytes() - { - return 0; - } - - @Override - public long getReadTimeNanos() - { - return 0; - } - - @Override - public boolean isFinished() - { - return finished; - } - - @Override - public Page getNextPage() - { - if (atop == null) { - try { - readerPermits.acquire(); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new RuntimeException(e); - } - try { - atop = atopFactory.create(table, date); - } - catch (RuntimeException e) { - atop = null; - readerPermits.release(); - throw e; - } - } - - while (!pageBuilder.isFull()) { - if (!atop.hasNext()) { - close(); - break; - } - String row = atop.next(); - - if (row.equals("SEP")) { - continue; - } - - if (table == AtopTable.REBOOTS) { - // For the reboots table we're only interested in RESET events, and the event that follows them - if (!row.equals("RESET")) { - continue; - } - if (!atop.hasNext()) { - close(); - break; - } - row = atop.next(); - } - else { - if (row.equals("RESET")) { - if (atop.hasNext()) { - // Drop samples immediately after a RESET, since this will be a "since boot" event - // which tends to have a very long duration - atop.next(); - } - continue; - } - } - - List fields = Splitter.on(" ").splitToList(row); - pageBuilder.declarePosition(); - for (int i = 0; i < columns.size(); i++) { - if (columns.get(i) == AtopColumn.HOST_IP) { - types.get(i).writeSlice(pageBuilder.getBlockBuilder(i), hostIp); - } - else { - columns.get(i).getParser().parse(fields, types.get(i), pageBuilder.getBlockBuilder(i), session); - } - } - } - - Page page = pageBuilder.build(); - pageBuilder.reset(); - - return page; - } - - @Override - public long getMemoryUsage() - { - return 0; - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPageSourceProvider.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPageSourceProvider.java deleted file mode 100644 index e6ed9cbfd75d7..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPageSourceProvider.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import io.trino.plugin.atop.AtopTable.AtopColumn; -import io.trino.spi.connector.ColumnHandle; -import io.trino.spi.connector.ConnectorPageSource; -import io.trino.spi.connector.ConnectorPageSourceProvider; -import io.trino.spi.connector.ConnectorSession; -import io.trino.spi.connector.ConnectorSplit; -import io.trino.spi.connector.ConnectorTableHandle; -import io.trino.spi.connector.ConnectorTransactionHandle; -import io.trino.spi.connector.DynamicFilter; -import io.trino.spi.type.Type; -import io.trino.spi.type.TypeManager; - -import java.time.ZonedDateTime; -import java.util.List; -import java.util.concurrent.Semaphore; - -import static com.google.common.base.Preconditions.checkArgument; -import static io.airlift.slice.Slices.utf8Slice; -import static java.util.Objects.requireNonNull; - -public final class AtopPageSourceProvider - implements ConnectorPageSourceProvider -{ - private final Semaphore readerPermits; - private final AtopFactory atopFactory; - private final TypeManager typeManager; - - @Inject - public AtopPageSourceProvider(AtopConnectorConfig config, AtopFactory atopFactory, TypeManager typeManager) - { - readerPermits = new Semaphore(config.getConcurrentReadersPerNode()); - this.atopFactory = requireNonNull(atopFactory, "atopFactory is null"); - this.typeManager = requireNonNull(typeManager, "typeManager is null"); - } - - @Override - public ConnectorPageSource createPageSource( - ConnectorTransactionHandle transaction, - ConnectorSession session, - ConnectorSplit split, - ConnectorTableHandle table, - List columns, - DynamicFilter dynamicFilter) - { - AtopTableHandle tableHandle = (AtopTableHandle) table; - AtopSplit atopSplit = (AtopSplit) split; - - ImmutableList.Builder types = ImmutableList.builder(); - ImmutableList.Builder atopColumns = ImmutableList.builder(); - - for (ColumnHandle column : columns) { - AtopColumnHandle atopColumnHandle = (AtopColumnHandle) column; - AtopColumn atopColumn = tableHandle.table().getColumn(atopColumnHandle.name()); - atopColumns.add(atopColumn); - types.add(typeManager.getType(atopColumn.getType())); - } - - ZonedDateTime date = atopSplit.getDate(); - checkArgument(date.equals(date.withHour(0).withMinute(0).withSecond(0).withNano(0)), "Expected date to be at beginning of day"); - return new AtopPageSource(readerPermits, atopFactory, session, utf8Slice(atopSplit.getHost().getHostText()), tableHandle.table(), date, atopColumns.build(), types.build()); - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPlugin.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPlugin.java deleted file mode 100644 index 5482b4abf6ef9..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopPlugin.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.common.collect.ImmutableList; -import io.trino.spi.Plugin; -import io.trino.spi.connector.ConnectorFactory; - -public class AtopPlugin - implements Plugin -{ - @Override - public Iterable getConnectorFactories() - { - return ImmutableList.of(new AtopConnectorFactory(AtopProcessFactory.class, AtopPlugin.class.getClassLoader())); - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopProcessFactory.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopProcessFactory.java deleted file mode 100644 index 32c20f1c16ae1..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopProcessFactory.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.common.util.concurrent.SimpleTimeLimiter; -import com.google.common.util.concurrent.TimeLimiter; -import com.google.common.util.concurrent.UncheckedTimeoutException; -import com.google.inject.Inject; -import io.airlift.units.Duration; -import io.trino.spi.TrinoException; -import io.trino.spi.catalog.CatalogName; -import jakarta.annotation.PreDestroy; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; -import java.util.NoSuchElementException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.TimeUnit; - -import static com.google.common.base.Preconditions.checkArgument; -import static io.airlift.concurrent.Threads.daemonThreadsNamed; -import static io.trino.plugin.atop.AtopErrorCode.ATOP_CANNOT_START_PROCESS_ERROR; -import static io.trino.plugin.atop.AtopErrorCode.ATOP_READ_TIMEOUT; -import static java.lang.String.format; -import static java.nio.charset.Charset.defaultCharset; -import static java.util.Objects.requireNonNull; -import static java.util.concurrent.Executors.newFixedThreadPool; -import static java.util.concurrent.TimeUnit.MILLISECONDS; - -public class AtopProcessFactory - implements AtopFactory -{ - private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMdd"); - private final String executablePath; - private final ZoneId timeZone; - private final Duration readTimeout; - private final ExecutorService executor; - - @Inject - public AtopProcessFactory(AtopConnectorConfig config, CatalogName catalogName) - { - this.executablePath = config.getExecutablePath(); - this.timeZone = config.getTimeZoneId(); - this.readTimeout = config.getReadTimeout(); - this.executor = newFixedThreadPool(config.getConcurrentReadersPerNode(), daemonThreadsNamed("atop-" + catalogName + "executable-reader-%s")); - } - - @Override - public Atop create(AtopTable table, ZonedDateTime date) - { - checkArgument(date.getZone().getRules().equals(timeZone.getRules()), "Split date (%s) is not in the local timezone (%s)", date.getZone(), timeZone); - - ProcessBuilder processBuilder = new ProcessBuilder(executablePath); - processBuilder.command().add("-P"); - processBuilder.command().add(table.getAtopLabel()); - processBuilder.command().add("-r"); - processBuilder.command().add(DATE_FORMATTER.format(date)); - Process process; - try { - process = processBuilder.start(); - } - catch (IOException e) { - throw new TrinoException(ATOP_CANNOT_START_PROCESS_ERROR, format("Cannot start %s", processBuilder.command()), e); - } - return new AtopProcess(process, readTimeout, executor); - } - - @PreDestroy - public void shutdown() - { - executor.shutdownNow(); - } - - private static final class AtopProcess - implements Atop - { - private final Process process; - private final BufferedReader underlyingReader; - private final LineReader reader; - private String line; - - private AtopProcess(Process process, Duration readTimeout, ExecutorService executor) - { - this.process = requireNonNull(process, "process is null"); - underlyingReader = new BufferedReader(new InputStreamReader(process.getInputStream(), defaultCharset())); - TimeLimiter limiter = SimpleTimeLimiter.create(executor); - this.reader = limiter.newProxy(underlyingReader::readLine, LineReader.class, readTimeout.toMillis(), MILLISECONDS); - try { - // Ignore the first two lines, as they are an event since boot (RESET followed by event line) - this.reader.readLine(); - this.reader.readLine(); - // Read the first real line - line = this.reader.readLine(); - } - catch (IOException e) { - line = null; - } - catch (UncheckedTimeoutException e) { - throw new TrinoException(ATOP_READ_TIMEOUT, "Timeout reading from atop process"); - } - } - - @Override - public boolean hasNext() - { - return line != null; - } - - @Override - public String next() - { - if (line == null) { - throw new NoSuchElementException(); - } - String currentLine = line; - try { - line = reader.readLine(); - } - catch (IOException e) { - line = null; - } - catch (UncheckedTimeoutException e) { - throw new TrinoException(ATOP_READ_TIMEOUT, "Timeout reading from atop process"); - } - - return currentLine; - } - - @Override - public void close() - { - try { - underlyingReader.close(); - } - catch (IOException e) { - // Ignored - } - finally { - process.destroy(); - try { - if (!process.waitFor(5, TimeUnit.SECONDS)) { - process.destroyForcibly(); - } - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - process.destroyForcibly(); - } - } - } - } - - public interface LineReader - { - String readLine() - throws IOException; - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopSplit.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopSplit.java deleted file mode 100644 index a7c6b876e3fb5..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopSplit.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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.plugin.atop; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import io.trino.spi.HostAddress; -import io.trino.spi.connector.ConnectorSplit; - -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.util.List; -import java.util.Map; - -import static com.google.common.base.MoreObjects.toStringHelper; -import static io.airlift.slice.SizeOf.estimatedSizeOf; -import static io.airlift.slice.SizeOf.instanceSize; -import static java.time.Instant.ofEpochSecond; -import static java.util.Objects.requireNonNull; - -public class AtopSplit - implements ConnectorSplit -{ - private static final int INSTANCE_SIZE = instanceSize(AtopSplit.class); - - private final HostAddress host; - private final long epochSeconds; - private final String timeZoneId; - - @JsonCreator - public AtopSplit( - @JsonProperty("host") HostAddress host, - @JsonProperty("epochSeconds") long epochSeconds, - @JsonProperty("timeZoneId") String timeZoneId) - { - this.host = requireNonNull(host, "host is null"); - this.epochSeconds = epochSeconds; - this.timeZoneId = requireNonNull(timeZoneId, "timeZoneId is null"); - } - - @JsonProperty - public HostAddress getHost() - { - return host; - } - - @JsonProperty - public long getEpochSeconds() - { - return epochSeconds; - } - - @JsonProperty - public String getTimeZoneId() - { - return timeZoneId; - } - - public ZonedDateTime getDate() - { - return ZonedDateTime.ofInstant(ofEpochSecond(epochSeconds), ZoneId.of(timeZoneId)); - } - - @Override - public boolean isRemotelyAccessible() - { - return false; - } - - @Override - public List getAddresses() - { - // discard the port number - return ImmutableList.of(HostAddress.fromString(host.getHostText())); - } - - @Override - public Map getSplitInfo() - { - return ImmutableMap.of("host", host.toString(), "epochSeconds", String.valueOf(epochSeconds), "timeZoneId", timeZoneId); - } - - @Override - public long getRetainedSizeInBytes() - { - return INSTANCE_SIZE - + host.getRetainedSizeInBytes() - + estimatedSizeOf(timeZoneId); - } - - @Override - public String toString() - { - return toStringHelper(this) - .add("host", host) - .add("epochSeconds", epochSeconds) - .add("timeZoneId", timeZoneId) - .toString(); - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopSplitManager.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopSplitManager.java deleted file mode 100644 index 8bd240677b1ce..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopSplitManager.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.inject.Inject; -import io.trino.spi.Node; -import io.trino.spi.NodeManager; -import io.trino.spi.connector.ConnectorSession; -import io.trino.spi.connector.ConnectorSplit; -import io.trino.spi.connector.ConnectorSplitManager; -import io.trino.spi.connector.ConnectorSplitSource; -import io.trino.spi.connector.ConnectorTableHandle; -import io.trino.spi.connector.ConnectorTransactionHandle; -import io.trino.spi.connector.Constraint; -import io.trino.spi.connector.DynamicFilter; -import io.trino.spi.connector.FixedSplitSource; -import io.trino.spi.predicate.Domain; -import io.trino.spi.predicate.Range; -import io.trino.spi.predicate.ValueSet; - -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.util.ArrayList; -import java.util.List; - -import static io.trino.spi.type.DateTimeEncoding.packDateTimeWithZone; -import static io.trino.spi.type.TimeZoneKey.UTC_KEY; -import static io.trino.spi.type.TimestampWithTimeZoneType.TIMESTAMP_TZ_MILLIS; -import static java.util.Objects.requireNonNull; - -public class AtopSplitManager - implements ConnectorSplitManager -{ - private final NodeManager nodeManager; - private final ZoneId timeZone; - private final int maxHistoryDays; - - @Inject - public AtopSplitManager(NodeManager nodeManager, AtopConnectorConfig config) - { - this.nodeManager = requireNonNull(nodeManager, "nodeManager is null"); - timeZone = config.getTimeZoneId(); - maxHistoryDays = config.getMaxHistoryDays(); - } - - @Override - public ConnectorSplitSource getSplits( - ConnectorTransactionHandle transaction, - ConnectorSession session, - ConnectorTableHandle table, - DynamicFilter dynamicFilter, - Constraint constraint) - { - AtopTableHandle tableHandle = (AtopTableHandle) table; - - List splits = new ArrayList<>(); - ZonedDateTime end = ZonedDateTime.now(timeZone); - for (Node node : nodeManager.getWorkerNodes()) { - ZonedDateTime start = end.minusDays(maxHistoryDays - 1).withHour(0).withMinute(0).withSecond(0).withNano(0); - while (start.isBefore(end)) { - ZonedDateTime splitEnd = start.withHour(23).withMinute(59).withSecond(59).withNano(0); - Domain splitDomain = Domain.create( - ValueSet.ofRanges(Range.range( - TIMESTAMP_TZ_MILLIS, - packDateTimeWithZone(start.toInstant().toEpochMilli(), UTC_KEY), - true, - packDateTimeWithZone(splitEnd.toInstant().toEpochMilli(), UTC_KEY), - true)), - false); - if (tableHandle.startTimeConstraint().overlaps(splitDomain) && tableHandle.endTimeConstraint().overlaps(splitDomain)) { - splits.add(new AtopSplit(node.getHostAndPort(), start.toEpochSecond(), start.getZone().getId())); - } - start = start.plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0); - } - } - - return new FixedSplitSource(splits); - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopTable.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopTable.java deleted file mode 100644 index 26902c63a29c0..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopTable.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.common.collect.ImmutableList; -import io.airlift.slice.Slices; -import io.trino.spi.block.BlockBuilder; -import io.trino.spi.connector.ConnectorSession; -import io.trino.spi.type.Type; -import io.trino.spi.type.TypeSignature; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - -import static io.trino.plugin.atop.AtopTable.AtopColumn.END_TIME; -import static io.trino.plugin.atop.AtopTable.AtopColumn.HOST_IP; -import static io.trino.plugin.atop.AtopTable.AtopColumn.START_TIME; -import static io.trino.plugin.atop.AtopTable.AtopColumnParser.bigintParser; -import static io.trino.plugin.atop.AtopTable.AtopColumnParser.varcharParser; -import static io.trino.spi.type.BigintType.BIGINT; -import static io.trino.spi.type.DateTimeEncoding.packDateTimeWithZone; -import static io.trino.spi.type.DoubleType.DOUBLE; -import static io.trino.spi.type.StandardTypes.INTERVAL_DAY_TO_SECOND; -import static io.trino.spi.type.TimestampWithTimeZoneType.TIMESTAMP_TZ_MILLIS; -import static io.trino.spi.type.VarcharType.VARCHAR; -import static java.util.Objects.requireNonNull; - -public enum AtopTable -{ - DISKS("disks", "DSK", baseColumnsAnd( - new AtopColumn("device_name", VARCHAR.getTypeSignature(), varcharParser(6)), - new AtopColumn("utilization_percent", DOUBLE.getTypeSignature(), (fields, type, builder, session) -> { - long durationMillis = Long.valueOf(fields.get(5)) * 1000; - long ioMillis = Long.valueOf(fields.get(7)); - double utilization = Math.round(100.0 * ioMillis / (double) durationMillis); - if (utilization > 100) { - utilization = 100; - } - type.writeDouble(builder, utilization); - }), - new AtopColumn("io_time", new TypeSignature(INTERVAL_DAY_TO_SECOND), (fields, type, builder, session) -> { - long millis = Long.valueOf(fields.get(7)); - type.writeLong(builder, millis); - }), - new AtopColumn("read_requests", BIGINT.getTypeSignature(), bigintParser(8)), - new AtopColumn("sectors_read", BIGINT.getTypeSignature(), bigintParser(9)), - new AtopColumn("write_requests", BIGINT.getTypeSignature(), bigintParser(10)), - new AtopColumn("sectors_written", BIGINT.getTypeSignature(), bigintParser(11)))), - - REBOOTS("reboots", "DSK", ImmutableList.of(HOST_IP, new AtopColumn("power_on_time", TIMESTAMP_TZ_MILLIS.getTypeSignature(), (fields, type, builder, session) -> { - long millisUtc = Long.valueOf(fields.get(2)) * 1000; - long durationMillis = Long.valueOf(fields.get(5)) * 1000; - long value = packDateTimeWithZone(millisUtc - durationMillis, session.getTimeZoneKey()); - type.writeLong(builder, value); - }))); - - private final String name; - private final String atopLabel; - private final List columns; - private final Map columnIndex; - - AtopTable(String name, String atopLabel, List columns) - { - this.atopLabel = atopLabel; - this.name = requireNonNull(name, "name is null"); - this.columns = ImmutableList.copyOf(requireNonNull(columns, "columns is null")); - columnIndex = this.columns.stream().collect(Collectors.toMap(AtopColumn::getName, Function.identity())); - } - - private static List baseColumnsAnd(AtopColumn... additionalColumns) - { - ImmutableList.Builder columns = ImmutableList.builder(); - columns.add(HOST_IP); - // 0th field is the label (i.e. table name) - // 1st field is the name of the host, but isn't fully qualified - columns.add(START_TIME); - // 2nd field is the end timestamp as unix time - columns.add(END_TIME); - // 3rd field is the date, but we already have the epoch - // 4th field is the time, but we already have the epoch - // 5th field is the duration, and will be combined with 2 to compute start_time - columns.addAll(Arrays.asList(additionalColumns)); - return columns.build(); - } - - public String getName() - { - return name; - } - - public String getAtopLabel() - { - return atopLabel; - } - - public AtopColumn getColumn(String name) - { - return columnIndex.get(name); - } - - public List getColumns() - { - return columns; - } - - public static class AtopColumn - { - public static final AtopColumn HOST_IP = new AtopColumn("host_ip", VARCHAR.getTypeSignature(), (fields, type, builder, session) -> { - throw new UnsupportedOperationException(); - }); - - public static final AtopColumn START_TIME = new AtopColumn("start_time", TIMESTAMP_TZ_MILLIS.getTypeSignature(), (fields, type, builder, session) -> { - long millisUtc = Long.valueOf(fields.get(2)) * 1000; - long durationMillis = Long.valueOf(fields.get(5)) * 1000; - long value = packDateTimeWithZone(millisUtc - durationMillis, session.getTimeZoneKey()); - type.writeLong(builder, value); - }); - - public static final AtopColumn END_TIME = new AtopColumn("end_time", TIMESTAMP_TZ_MILLIS.getTypeSignature(), (fields, type, builder, session) -> { - long millisUtc = Long.valueOf(fields.get(2)) * 1000; - type.writeLong(builder, packDateTimeWithZone(millisUtc, session.getTimeZoneKey())); - }); - - private final String name; - private final TypeSignature type; - private final AtopColumnParser parser; - - private AtopColumn(String name, TypeSignature type, AtopColumnParser parser) - { - this.name = requireNonNull(name, "name is null"); - this.type = requireNonNull(type, "type is null"); - this.parser = requireNonNull(parser, "parser is null"); - } - - public String getName() - { - return name; - } - - public TypeSignature getType() - { - return type; - } - - public AtopColumnParser getParser() - { - return parser; - } - } - - public interface AtopColumnParser - { - void parse(List fields, Type type, BlockBuilder builder, ConnectorSession session); - - static AtopColumnParser varcharParser(int index) - { - return (fields, type, builder, session) -> type.writeSlice(builder, Slices.utf8Slice(fields.get(index))); - } - - static AtopColumnParser bigintParser(int index) - { - return (fields, type, builder, session) -> type.writeLong(builder, Long.valueOf(fields.get(index))); - } - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopTableHandle.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopTableHandle.java deleted file mode 100644 index 283be9f3da68b..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopTableHandle.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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.plugin.atop; - -import io.trino.spi.connector.ConnectorTableHandle; -import io.trino.spi.predicate.Domain; - -import static io.trino.spi.type.TimestampWithTimeZoneType.TIMESTAMP_TZ_MILLIS; -import static java.util.Objects.requireNonNull; - -public record AtopTableHandle( - String schema, - AtopTable table, - Domain startTimeConstraint, - Domain endTimeConstraint) - implements ConnectorTableHandle -{ - public AtopTableHandle(String schema, AtopTable table) - { - this(schema, table, Domain.all(TIMESTAMP_TZ_MILLIS), Domain.all(TIMESTAMP_TZ_MILLIS)); - } - - public AtopTableHandle - { - requireNonNull(schema, "schema is null"); - requireNonNull(table, "table is null"); - requireNonNull(startTimeConstraint, "startTimeConstraint is null"); - requireNonNull(endTimeConstraint, "endTimeConstraint is null"); - } - @Override - public String toString() - { - return schema + ":" + table; - } -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopTransactionHandle.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopTransactionHandle.java deleted file mode 100644 index a94b567926d33..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/AtopTransactionHandle.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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.plugin.atop; - -import io.trino.spi.connector.ConnectorTransactionHandle; - -public enum AtopTransactionHandle - implements ConnectorTransactionHandle -{ - INSTANCE -} diff --git a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/Environment.java b/plugin/trino-atop/src/main/java/io/trino/plugin/atop/Environment.java deleted file mode 100644 index 53777bf62f33b..0000000000000 --- a/plugin/trino-atop/src/main/java/io/trino/plugin/atop/Environment.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.plugin.atop; - -import static java.util.Objects.requireNonNull; - -public final class Environment -{ - private final String name; - - public Environment(String name) - { - this.name = requireNonNull(name, "name is null"); - } - - @Override - public String toString() - { - return name; - } -} diff --git a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/AtopQueryRunner.java b/plugin/trino-atop/src/test/java/io/trino/plugin/atop/AtopQueryRunner.java deleted file mode 100644 index 59c60c239161a..0000000000000 --- a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/AtopQueryRunner.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import io.trino.Session; -import io.trino.spi.Plugin; -import io.trino.spi.connector.ConnectorFactory; -import io.trino.spi.type.TimeZoneKey; -import io.trino.testing.QueryRunner; -import io.trino.testing.StandaloneQueryRunner; - -import java.util.Map; -import java.util.TimeZone; - -import static io.airlift.testing.Closeables.closeAllSuppress; -import static io.trino.testing.TestingSession.testSessionBuilder; - -public final class AtopQueryRunner -{ - private AtopQueryRunner() {} - - public static QueryRunner createQueryRunner() - { - return createQueryRunner(ImmutableMap.of("atop.executable-path", "/dev/null"), TestingAtopFactory.class); - } - - public static QueryRunner createQueryRunner(Map catalogProperties, Class factoryClass) - { - Session session = testSessionBuilder() - .setCatalog("atop") - .setSchema("default") - .setTimeZoneKey(TimeZoneKey.getTimeZoneKey(TimeZone.getDefault().getID())) - .build(); - - QueryRunner queryRunner = new StandaloneQueryRunner(session); - - try { - queryRunner.installPlugin(new TestingAtopPlugin(factoryClass)); - queryRunner.createCatalog("atop", "atop", ImmutableMap.builder() - .putAll(catalogProperties) - .put("atop.max-history-days", "1").buildOrThrow()); - return queryRunner; - } - catch (Exception e) { - closeAllSuppress(e, queryRunner); - throw e; - } - } - - private record TestingAtopPlugin(Class atopFactoryClass) - implements Plugin - { - @Override - public Iterable getConnectorFactories() - { - return ImmutableList.of(new AtopConnectorFactory(atopFactoryClass, AtopQueryRunner.class.getClassLoader())); - } - } -} diff --git a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopConnectorConfig.java b/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopConnectorConfig.java deleted file mode 100644 index b78ac7f468b0f..0000000000000 --- a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopConnectorConfig.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.common.collect.ImmutableMap; -import io.airlift.units.Duration; -import io.trino.plugin.atop.AtopConnectorConfig.AtopSecurity; -import org.junit.jupiter.api.Test; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Map; -import java.util.TimeZone; - -import static io.airlift.configuration.testing.ConfigAssertions.assertFullMapping; -import static io.airlift.configuration.testing.ConfigAssertions.assertRecordedDefaults; -import static io.airlift.configuration.testing.ConfigAssertions.recordDefaults; -import static java.util.concurrent.TimeUnit.MINUTES; - -public class TestAtopConnectorConfig -{ - @Test - public void testDefaults() - { - assertRecordedDefaults(recordDefaults(AtopConnectorConfig.class) - .setExecutablePath("atop") - .setConcurrentReadersPerNode(1) - .setSecurity(AtopSecurity.ALLOW_ALL) - .setReadTimeout(new Duration(5, MINUTES)) - .setMaxHistoryDays(30) - .setTimeZone(TimeZone.getDefault().getID())); - } - - @Test - public void testExplicitPropertyMappings() - throws IOException - { - Path atopExecutable = Files.createTempFile(null, null); - - Map properties = ImmutableMap.builder() - .put("atop.executable-path", atopExecutable.toString()) - .put("atop.concurrent-readers-per-node", "10") - .put("atop.executable-read-timeout", "1m") - .put("atop.security", "file") - .put("atop.max-history-days", "10") - .put("atop.time-zone", "PST") - .buildOrThrow(); - - AtopConnectorConfig expected = new AtopConnectorConfig() - .setExecutablePath(atopExecutable.toString()) - .setConcurrentReadersPerNode(10) - .setSecurity(AtopSecurity.FILE) - .setReadTimeout(new Duration(1, MINUTES)) - .setMaxHistoryDays(10) - .setTimeZone("PST"); - - assertFullMapping(properties, expected); - } -} diff --git a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopHang.java b/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopHang.java deleted file mode 100644 index 5133558fa95bc..0000000000000 --- a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopHang.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.common.collect.ImmutableMap; -import com.google.common.io.Resources; -import io.trino.testing.QueryRunner; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; - -import static com.google.common.io.Resources.toByteArray; -import static io.trino.plugin.atop.AtopErrorCode.ATOP_READ_TIMEOUT; -import static io.trino.plugin.atop.AtopQueryRunner.createQueryRunner; -import static io.trino.testing.assertions.TrinoExceptionAssert.assertTrinoExceptionThrownBy; -import static java.nio.file.Files.createTempDirectory; -import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS; - -@TestInstance(PER_CLASS) -public class TestAtopHang -{ - private QueryRunner queryRunner; - - @BeforeAll - public void setUp() - throws Exception - { - Path tempPath = createTempDirectory(null); - copyExecutable("hanging_atop.sh", tempPath.toFile()); - queryRunner = createQueryRunner(ImmutableMap.of("atop.executable-path", tempPath + "/hanging_atop.sh", "atop.executable-read-timeout", "1s"), AtopProcessFactory.class); - } - - @AfterAll - public void tearDown() - { - queryRunner.close(); - queryRunner = null; - } - - @Test - @Timeout(60) - public void testTimeout() - { - assertTrinoExceptionThrownBy(() -> queryRunner.execute("SELECT * FROM disks")) - .hasErrorCode(ATOP_READ_TIMEOUT); - } - - private void copyExecutable(String name, File target) - throws IOException - { - byte[] bytes = toByteArray(Resources.getResource(getClass(), name)); - Path path = target.toPath().resolve(new File(name).getName()); - Files.write(path, bytes); - if (!path.toFile().setExecutable(true)) { - throw new IOException("failed to make executable: " + path); - } - } -} diff --git a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopPlugin.java b/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopPlugin.java deleted file mode 100644 index 09665c2e662ff..0000000000000 --- a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopPlugin.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.common.collect.ImmutableMap; -import io.trino.spi.Plugin; -import io.trino.spi.connector.ConnectorFactory; -import io.trino.testing.TestingConnectorContext; -import org.junit.jupiter.api.Test; - -import java.nio.file.Files; -import java.nio.file.Path; - -import static com.google.common.collect.Iterables.getOnlyElement; -import static io.airlift.testing.Assertions.assertInstanceOf; - -public class TestAtopPlugin -{ - @Test - public void testCreateConnector() - throws Exception - { - Plugin plugin = new AtopPlugin(); - assertInstanceOf(getOnlyElement(plugin.getConnectorFactories()), AtopConnectorFactory.class); - - ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories()); - - Path atopExecutable = Files.createTempFile(null, null); - factory.create( - "test", - ImmutableMap.of( - "atop.executable-path", atopExecutable.toString(), - "bootstrap.quiet", "true"), - new TestingConnectorContext()).shutdown(); - } -} diff --git a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopSecurity.java b/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopSecurity.java deleted file mode 100644 index 445ddc79bb808..0000000000000 --- a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopSecurity.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.common.collect.ImmutableMap; -import com.google.common.io.Resources; -import io.trino.Session; -import io.trino.spi.security.Identity; -import io.trino.testing.QueryRunner; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInstance; - -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Path; - -import static io.trino.plugin.atop.AtopQueryRunner.createQueryRunner; -import static io.trino.spi.StandardErrorCode.PERMISSION_DENIED; -import static io.trino.testing.TestingSession.testSessionBuilder; -import static io.trino.testing.assertions.TrinoExceptionAssert.assertTrinoExceptionThrownBy; -import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS; - -@TestInstance(PER_CLASS) -public class TestAtopSecurity -{ - private QueryRunner queryRunner; - - @BeforeAll - public void setUp() - throws Exception - { - Path atopExecutable = Files.createTempFile(null, null); - String path = new File(Resources.getResource(getClass(), "security.json").toURI()).getPath(); - queryRunner = createQueryRunner(ImmutableMap.of("atop.security", "file", "security.config-file", path, "atop.executable-path", atopExecutable.toString()), TestingAtopFactory.class); - } - - @AfterAll - public void tearDown() - { - queryRunner.close(); - queryRunner = null; - } - - @Test - public void testAdminCanRead() - { - Session admin = getSession("admin"); - queryRunner.execute(admin, "SELECT * FROM disks"); - } - - @Test - public void testNonAdminCannotRead() - { - Session bob = getSession("bob"); - assertTrinoExceptionThrownBy(() -> queryRunner.execute(bob, "SELECT * FROM disks")) - .hasErrorCode(PERMISSION_DENIED) - .hasMessageMatching("Access Denied:.*"); - } - - private Session getSession(String user) - { - return testSessionBuilder() - .setCatalog(queryRunner.getDefaultSession().getCatalog()) - .setSchema(queryRunner.getDefaultSession().getSchema()) - .setIdentity(Identity.ofUser(user)) - .build(); - } -} diff --git a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopSmoke.java b/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopSmoke.java deleted file mode 100644 index ec2fcfbfac984..0000000000000 --- a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopSmoke.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.common.collect.Iterables; -import io.trino.testing.MaterializedResult; -import io.trino.testing.MaterializedRow; -import io.trino.testing.QueryRunner; -import org.intellij.lang.annotations.Language; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInstance; - -import static io.trino.plugin.atop.AtopQueryRunner.createQueryRunner; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS; - -@TestInstance(PER_CLASS) -public class TestAtopSmoke -{ - private QueryRunner queryRunner; - - @BeforeAll - public void setUp() - { - queryRunner = createQueryRunner(); - } - - @AfterAll - public void tearDown() - { - queryRunner.close(); - queryRunner = null; - } - - @Test - public void testDisks() - { - assertThatQueryReturnsValue("SELECT device_name FROM disks LIMIT 1", "sda"); - } - - @Test - public void testPredicatePushdown() - { - assertThatQueryReturnsValue("SELECT device_name FROM disks WHERE start_time < current_timestamp LIMIT 1", "sda"); - assertThatQueryReturnsValue("SELECT device_name FROM disks WHERE start_time > current_timestamp - INTERVAL '2' DAY LIMIT 1", "sda"); - } - - @Test - public void testReboots() - { - assertThatQueryReturnsValue("SELECT count(*) FROM reboots WHERE CAST(power_on_time AS date) = current_date", 2L); - } - - private void assertThatQueryReturnsValue(@Language("SQL") String sql, Object expected) - { - MaterializedResult rows = queryRunner.execute(sql); - MaterializedRow materializedRow = Iterables.getOnlyElement(rows); - assertThat(materializedRow.getFieldCount()) - .as("column count") - .isEqualTo(1); - assertThat(materializedRow.getField(0)).isEqualTo(expected); - } -} diff --git a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopSplit.java b/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopSplit.java deleted file mode 100644 index a317dbae25a2f..0000000000000 --- a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopSplit.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.plugin.atop; - -import io.airlift.json.JsonCodec; -import io.trino.spi.HostAddress; -import org.junit.jupiter.api.Test; - -import java.time.ZoneId; -import java.time.ZonedDateTime; - -import static org.assertj.core.api.Assertions.assertThat; - -public class TestAtopSplit -{ - @Test - public void testSerialization() - { - JsonCodec codec = JsonCodec.jsonCodec(AtopSplit.class); - ZonedDateTime now = ZonedDateTime.now(ZoneId.of("+01:23")); - AtopSplit split = new AtopSplit(HostAddress.fromParts("localhost", 123), now.toEpochSecond(), now.getZone().getId()); - AtopSplit decoded = codec.fromJson(codec.toJson(split)); - assertThat(decoded.getHost()).isEqualTo(split.getHost()); - assertThat(decoded.getDate()).isEqualTo(split.getDate()); - assertThat(decoded.getEpochSeconds()).isEqualTo(split.getEpochSeconds()); - assertThat(decoded.getTimeZoneId()).isEqualTo(split.getTimeZoneId()); - } -} diff --git a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestingAtopFactory.java b/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestingAtopFactory.java deleted file mode 100644 index d804d37ed1eb8..0000000000000 --- a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestingAtopFactory.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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.plugin.atop; - -import com.google.common.base.Joiner; -import com.google.common.base.Splitter; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.UncheckedIOException; -import java.time.ZonedDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.NoSuchElementException; - -import static java.lang.String.format; -import static java.nio.charset.StandardCharsets.UTF_8; -import static java.util.Objects.requireNonNull; - -public class TestingAtopFactory - implements AtopFactory -{ - @Override - public Atop create(AtopTable table, ZonedDateTime date) - { - InputStream data = TestingAtopFactory.class.getResourceAsStream(table.name().toLowerCase(Locale.ENGLISH) + ".txt"); - requireNonNull(data, format("No data found for %s", table)); - return new TestingAtop(data, date); - } - - private static final class TestingAtop - implements Atop - { - private final BufferedReader reader; - private final ZonedDateTime date; - private String line; - - private TestingAtop(InputStream dataStream, ZonedDateTime date) - { - this.date = date; - this.reader = new BufferedReader(new InputStreamReader(dataStream, UTF_8)); - try { - line = reader.readLine(); - } - catch (IOException e) { - line = null; - } - } - - @Override - public boolean hasNext() - { - return line != null; - } - - @Override - public String next() - { - if (line == null) { - throw new NoSuchElementException(); - } - String currentLine = line; - try { - line = reader.readLine(); - } - catch (IOException e) { - line = null; - } - - if (currentLine.equals("SEP") || currentLine.equals("RESET")) { - return currentLine; - } - - List fields = new ArrayList<>(Splitter.on(" ").splitToList(currentLine)); - - // Timestamps in file are delta encoded - long secondsSinceEpoch = date.toEpochSecond(); - secondsSinceEpoch += Integer.parseInt(fields.get(2)); - fields.set(2, String.valueOf(secondsSinceEpoch)); - - return Joiner.on(" ").join(fields); - } - - @Override - public void close() - { - try { - reader.close(); - } - catch (IOException e) { - throw new UncheckedIOException(e); - } - } - } -} diff --git a/plugin/trino-atop/src/test/resources/io/trino/plugin/atop/disks.txt b/plugin/trino-atop/src/test/resources/io/trino/plugin/atop/disks.txt deleted file mode 100644 index f1dcd22540ef1..0000000000000 --- a/plugin/trino-atop/src/test/resources/io/trino/plugin/atop/disks.txt +++ /dev/null @@ -1,36 +0,0 @@ -DSK testhost 3 N/A N/A 5 sda 202 0 0 20 10184 -SEP -DSK testhost 8 N/A N/A 5 sda 163 0 0 12 960 -SEP -DSK testhost 13 N/A N/A 5 sda 122 1 16 9 1080 -SEP -DSK testhost 18 N/A N/A 5 sda 87 0 0 8 2376 -SEP -DSK testhost 23 N/A N/A 5 sda 1000 0 0 174 2504 -SEP -DSK testhost 28 N/A N/A 5 sda 99 0 0 6 560 -SEP -DSK testhost 33 N/A N/A 5 sda 80 0 0 8 576 -SEP -DSK testhost 38 N/A N/A 5 sda 220 0 0 19 1280 -SEP -DSK testhost 43 N/A N/A 5 sda 192 0 0 14 856 -SEP -DSK testhost 48 N/A N/A 5 sda 105 0 0 11 736 -SEP -DSK testhost 53 N/A N/A 5 sda 156 0 0 16 1576 -SEP -DSK testhost 58 N/A N/A 5 sda 765 0 0 115 12856 -SEP -DSK testhost 63 N/A N/A 5 sda 4129 0 0 420 208984 -SEP -DSK testhost 68 N/A N/A 5 sda 3507 0 0 359 178888 -SEP -DSK testhost 73 N/A N/A 5 sda 133 0 0 17 6736 -SEP -DSK testhost 78 N/A N/A 5 sda 56 0 0 5 448 -SEP -DSK testhost 83 N/A N/A 5 sda 170 0 0 17 704 -SEP -DSK testhost 88 N/A N/A 5 sda 115 1 8 10 1960 -SEP \ No newline at end of file diff --git a/plugin/trino-atop/src/test/resources/io/trino/plugin/atop/hanging_atop.sh b/plugin/trino-atop/src/test/resources/io/trino/plugin/atop/hanging_atop.sh deleted file mode 100644 index 59db78a637073..0000000000000 --- a/plugin/trino-atop/src/test/resources/io/trino/plugin/atop/hanging_atop.sh +++ /dev/null @@ -1 +0,0 @@ -sleep 60 \ No newline at end of file diff --git a/plugin/trino-atop/src/test/resources/io/trino/plugin/atop/reboots.txt b/plugin/trino-atop/src/test/resources/io/trino/plugin/atop/reboots.txt deleted file mode 100644 index f0d8a02df9e63..0000000000000 --- a/plugin/trino-atop/src/test/resources/io/trino/plugin/atop/reboots.txt +++ /dev/null @@ -1,38 +0,0 @@ -DSK testhost 3 2016/04/07 13:35:03 5 sda 202 0 0 20 10184 -SEP -DSK testhost 8 2016/04/07 13:35:08 5 sda 163 0 0 12 960 -SEP -DSK testhost 13 2016/04/07 13:35:13 5 sda 122 1 16 9 1080 -SEP -DSK testhost 18 2016/04/07 13:35:18 5 sda 87 0 0 8 2376 -SEP -RESET -DSK testhost 23 2016/04/07 13:35:23 5 sda 1000 0 0 174 2504 -SEP -DSK testhost 28 2016/04/07 13:35:28 5 sda 99 0 0 6 560 -SEP -DSK testhost 33 2016/04/07 13:35:33 5 sda 80 0 0 8 576 -SEP -DSK testhost 38 2016/04/07 13:35:38 5 sda 220 0 0 19 1280 -SEP -DSK testhost 43 2016/04/07 13:35:43 5 sda 192 0 0 14 856 -SEP -RESET -DSK testhost 48 2016/04/07 13:35:48 5 sda 105 0 0 11 736 -SEP -DSK testhost 53 2016/04/07 13:35:53 5 sda 156 0 0 16 1576 -SEP -DSK testhost 58 2016/04/07 13:35:58 5 sda 765 0 0 115 12856 -SEP -DSK testhost 63 2016/04/07 13:36:03 5 sda 4129 0 0 420 208984 -SEP -DSK testhost 68 2016/04/07 13:36:08 5 sda 3507 0 0 359 178888 -SEP -DSK testhost 73 2016/04/07 13:36:13 5 sda 133 0 0 17 6736 -SEP -DSK testhost 78 2016/04/07 13:36:18 5 sda 56 0 0 5 448 -SEP -DSK testhost 83 2016/04/07 13:36:23 5 sda 170 0 0 17 704 -SEP -DSK testhost 88 2016/04/07 13:36:28 5 sda 115 1 8 10 1960 -SEP \ No newline at end of file diff --git a/plugin/trino-atop/src/test/resources/io/trino/plugin/atop/security.json b/plugin/trino-atop/src/test/resources/io/trino/plugin/atop/security.json deleted file mode 100644 index c91403870ad45..0000000000000 --- a/plugin/trino-atop/src/test/resources/io/trino/plugin/atop/security.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "tables": [ - { - "user": "admin", - "privileges": ["SELECT"] - } - ] -} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 6ab39ea9ebd48..2a351d2cfb400 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,6 @@ lib/trino-record-decoder plugin/trino-accumulo plugin/trino-accumulo-iterators - plugin/trino-atop plugin/trino-base-jdbc plugin/trino-bigquery plugin/trino-blackhole diff --git a/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/environment/EnvMultinodeAllConnectors.java b/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/environment/EnvMultinodeAllConnectors.java index 491428f8be030..ba3dd24027f1a 100644 --- a/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/environment/EnvMultinodeAllConnectors.java +++ b/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/environment/EnvMultinodeAllConnectors.java @@ -48,7 +48,6 @@ public void extendEnvironment(Environment.Builder builder) List.of( // TODO accumulo needs to connect to ZooKeeper, it won't start otherwise //"accumulo", - "atop", "bigquery", "cassandra", "clickhouse", diff --git a/testing/trino-product-tests-launcher/src/main/resources/docker/presto-product-tests/conf/environment/multinode-all/atop.properties b/testing/trino-product-tests-launcher/src/main/resources/docker/presto-product-tests/conf/environment/multinode-all/atop.properties deleted file mode 100644 index c20378d407f1f..0000000000000 --- a/testing/trino-product-tests-launcher/src/main/resources/docker/presto-product-tests/conf/environment/multinode-all/atop.properties +++ /dev/null @@ -1,2 +0,0 @@ -connector.name=atop -atop.executable-path=/usr/bin/true