From 342a15f7c318b8f8d393d042520a2464a2aaf1a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Osipiuk?= Date: Fri, 13 May 2022 14:17:03 +0200 Subject: [PATCH] Clarify the meaning of retryMode in ConnectorMetadata JavaDoc --- .../spi/connector/ConnectorMetadata.java | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java b/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java index 1a6c28993314..832a8b6e3fbc 100644 --- a/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java +++ b/core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java @@ -95,6 +95,13 @@ default ConnectorTableHandle getTableHandleForStatisticsCollection(ConnectorSess /** * Create initial handle for execution of table procedure. The handle will be used through planning process. It will be converted to final * handle used for execution via @{link {@link ConnectorMetadata#beginTableExecute} + * + *

+ * If connector does not support execution with retries, the method should throw: + *

+     *     new TrinoException(NOT_SUPPORTED, "This connector does not support query retries")
+     * 
+ * unless {@code retryMode} is set to {@code NO_RETRIES}. */ default Optional getTableHandleForExecute( ConnectorSession session, @@ -464,6 +471,13 @@ default void finishStatisticsCollection(ConnectorSession session, ConnectorTable /** * Begin the atomic creation of a table with data. + * + *

+ * If connector does not support execution with retries, the method should throw: + *

+     *     new TrinoException(NOT_SUPPORTED, "This connector does not support query retries")
+     * 
+ * unless {@code retryMode} is set to {@code NO_RETRIES}. */ default ConnectorOutputTableHandle beginCreateTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, Optional layout, RetryMode retryMode) { @@ -491,6 +505,13 @@ default void cleanupQuery(ConnectorSession session) {} /** * Begin insert query. + * + *

+ * If connector does not support execution with retries, the method should throw: + *

+     *     new TrinoException(NOT_SUPPORTED, "This connector does not support query retries")
+     * 
+ * unless {@code retryMode} is set to {@code NO_RETRIES}. */ default ConnectorInsertTableHandle beginInsert(ConnectorSession session, ConnectorTableHandle tableHandle, List columns, RetryMode retryMode) { @@ -531,6 +552,13 @@ default CompletableFuture refreshMaterializedView(ConnectorSession session, S /** * Begin materialized view query. + * + *

+ * If connector does not support execution with retries, the method should throw: + *

+     *     new TrinoException(NOT_SUPPORTED, "This connector does not support query retries")
+     * 
+ * unless {@code retryMode} is set to {@code NO_RETRIES}. */ default ConnectorInsertTableHandle beginRefreshMaterializedView(ConnectorSession session, ConnectorTableHandle tableHandle, List sourceTableHandles, RetryMode retryMode) { @@ -573,6 +601,13 @@ default ColumnHandle getUpdateRowIdColumnHandle(ConnectorSession session, Connec /** * Begin delete query. + * + *

+ * If connector does not support execution with retries, the method should throw: + *

+     *     new TrinoException(NOT_SUPPORTED, "This connector does not support query retries")
+     * 
+ * unless {@code retryMode} is set to {@code NO_RETRIES}. */ default ConnectorTableHandle beginDelete(ConnectorSession session, ConnectorTableHandle tableHandle, RetryMode retryMode) { @@ -593,6 +628,13 @@ default void finishDelete(ConnectorSession session, ConnectorTableHandle tableHa * Do whatever is necessary to start an UPDATE query, returning the {@link ConnectorTableHandle} * instance that will be passed to split generation, and to the {@link #finishUpdate} method. * + *

+ * If connector does not support execution with retries, the method should throw: + *

+     *     new TrinoException(NOT_SUPPORTED, "This connector does not support query retries")
+     * 
+ * unless {@code retryMode} is set to {@code NO_RETRIES}. + * * @param session The session in which to start the update operation. * @param tableHandle A ConnectorTableHandle for the table to be updated. * @param updatedColumns A list of the ColumnHandles of columns that will be updated by this UPDATE