You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ko...@apache.org on 2024/05/23 07:40:53 UTC
(ignite-3) 01/01: review fixes
This is an automated email from the ASF dual-hosted git repository.
korlov pushed a commit to branch ignite-22263
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit 5df33200af3eba3de2780b9a9c173a98d156d340
Author: korlov42 <ko...@apache.com>
AuthorDate: Thu May 23 10:30:12 2024 +0300
review fixes
- make AsyncSqlCursor extends AsyncDataCursor
- create local variable for tx context to make it clear there is no difference in arguments
---
.../ignite/internal/sql/engine/AsyncSqlCursor.java | 22 ++--------------------
.../internal/sql/engine/SqlQueryProcessor.java | 10 +++-------
2 files changed, 5 insertions(+), 27 deletions(-)
diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/AsyncSqlCursor.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/AsyncSqlCursor.java
index 78ef17f467..397863372e 100644
--- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/AsyncSqlCursor.java
+++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/AsyncSqlCursor.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.sql.engine;
import java.util.NoSuchElementException;
import java.util.concurrent.CompletableFuture;
-import org.apache.ignite.internal.util.AsyncCursor;
+import org.apache.ignite.internal.sql.engine.exec.AsyncDataCursor;
import org.apache.ignite.sql.ResultSetMetadata;
/**
@@ -27,7 +27,7 @@ import org.apache.ignite.sql.ResultSetMetadata;
*
* @param <T> Type of elements.
*/
-public interface AsyncSqlCursor<T> extends AsyncCursor<T> {
+public interface AsyncSqlCursor<T> extends AsyncDataCursor<T> {
/**
* Returns query type.
*/
@@ -44,24 +44,6 @@ public interface AsyncSqlCursor<T> extends AsyncCursor<T> {
*/
boolean hasNextResult();
- /**
- * Returns {@link CompletableFuture} that will be completed when cursor is closed.
- *
- * <p>The future will be completed with {@link null} if cursor was completed successfully,
- * or with an exception otherwise.
- *
- * @return A future representing result of operation.
- */
- CompletableFuture<Void> onClose();
-
- /**
- * Returns {@link CompletableFuture} that will be completed when first page is fetched and ready
- * to be returned to user.
- *
- * @return A future representing result of operation.
- */
- CompletableFuture<Void> onFirstPageReady();
-
/**
* Returns the future for the next statement of the query.
*
diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/SqlQueryProcessor.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/SqlQueryProcessor.java
index 917ca59ea6..717522086a 100644
--- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/SqlQueryProcessor.java
+++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/SqlQueryProcessor.java
@@ -136,7 +136,6 @@ import org.apache.ignite.sql.SqlException;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
-
/**
* Main implementation of {@link QueryProcessor}.
*/
@@ -499,15 +498,12 @@ public class SqlQueryProcessor implements QueryProcessor {
try {
SqlProperties properties0 = SqlPropertiesHelper.chain(properties, DEFAULT_PROPERTIES);
+ QueryTransactionContext txContext = new QueryTransactionContextImpl(txManager, observableTimeTracker, transaction);
if (Commons.isMultiStatementQueryAllowed(properties0)) {
- return queryScript(
- properties0, new QueryTransactionContextImpl(txManager, observableTimeTracker, transaction), qry, params
- );
+ return queryScript(properties0, txContext, qry, params);
} else {
- return querySingle(
- properties0, new QueryTransactionContextImpl(txManager, observableTimeTracker, transaction), qry, params
- );
+ return querySingle(properties0, txContext, qry, params);
}
} finally {
busyLock.leaveBusy();