You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by al...@apache.org on 2022/03/23 16:01:53 UTC

[ignite] branch sql-calcite updated: Cleanup

This is an automated email from the ASF dual-hosted git repository.

alexpl pushed a commit to branch sql-calcite
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/sql-calcite by this push:
     new 0e27de9  Cleanup
0e27de9 is described below

commit 0e27de96adf58cb3b8b85d0a7856c131460f0e00
Author: Aleksey Plekhanov <pl...@gmail.com>
AuthorDate: Wed Mar 23 19:00:48 2022 +0300

    Cleanup
---
 .../query/calcite/exec/ExecutionContext.java       | 24 ----------------------
 .../query/calcite/exec/QueryTaskExecutor.java      | 14 -------------
 .../query/calcite/exec/QueryTaskExecutorImpl.java  |  6 ------
 .../thread/IgniteStripedThreadPoolExecutor.java    | 16 ---------------
 modules/core/src/test/config/log4j-test.xml        |  4 ----
 5 files changed, 64 deletions(-)

diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/ExecutionContext.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/ExecutionContext.java
index 71fbeb6..fd0cf9e 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/ExecutionContext.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/ExecutionContext.java
@@ -21,7 +21,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.UUID;
-import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.function.Consumer;
 import org.apache.calcite.DataContext;
@@ -283,29 +282,6 @@ public class ExecutionContext<Row> extends AbstractQueryContext implements DataC
         });
     }
 
-    /**
-     * Submits a Runnable task for execution and returns a Future
-     * representing that task. The Future's {@code get} method will
-     * return {@code null} upon <em>successful</em> completion.
-     *
-     * @param task the task to submit.
-     * @return a {@link CompletableFuture} representing pending task
-     */
-    public CompletableFuture<?> submit(RunnableX task, Consumer<Throwable> onError) {
-        assert !isCancelled() : "Call submit after execution was cancelled.";
-
-        return executor.submit(qryId, fragmentId(), () -> {
-            try {
-                task.run();
-            }
-            catch (Throwable e) {
-                onError.accept(e);
-
-                throw new IgniteException("Unexpected exception", e);
-            }
-        });
-    }
-
     /** */
     @FunctionalInterface
     public interface RunnableX {
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/QueryTaskExecutor.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/QueryTaskExecutor.java
index 830a4d2..6891cde 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/QueryTaskExecutor.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/QueryTaskExecutor.java
@@ -18,8 +18,6 @@
 package org.apache.ignite.internal.processors.query.calcite.exec;
 
 import java.util.UUID;
-import java.util.concurrent.CompletableFuture;
-
 import org.apache.ignite.internal.processors.query.calcite.util.Service;
 
 /**
@@ -34,16 +32,4 @@ public interface QueryTaskExecutor extends Service {
      * @param qryTask Query task.
      */
     void execute(UUID qryId, long fragmentId, Runnable qryTask);
-
-    /**
-     * Returns a new CompletableFuture that is asynchronously completed
-     * by a task running in the given executor after it runs the given
-     * action.
-     *
-     * @param qryId Id of the query this task created for.
-     * @param fragmentId Id of the particular fragment this task created for.
-     * @param qryTask The task to submit.
-     * @return the new CompletableFuture
-     */
-    CompletableFuture<?> submit(UUID qryId, long fragmentId, Runnable qryTask);
 }
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/QueryTaskExecutorImpl.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/QueryTaskExecutorImpl.java
index ddbd1ee..c572901 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/QueryTaskExecutorImpl.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/QueryTaskExecutorImpl.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.query.calcite.exec;
 
 import java.util.Objects;
 import java.util.UUID;
-import java.util.concurrent.CompletableFuture;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor;
 import org.apache.ignite.internal.processors.query.calcite.util.AbstractService;
@@ -80,11 +79,6 @@ public class QueryTaskExecutorImpl extends AbstractService implements QueryTaskE
     }
 
     /** {@inheritDoc} */
-    @Override public CompletableFuture<?> submit(UUID qryId, long fragmentId, Runnable qryTask) {
-        return stripedThreadPoolExecutor.submit(qryTask, hash(qryId, fragmentId));
-    }
-
-    /** {@inheritDoc} */
     @Override public void onStart(GridKernalContext ctx) {
         exceptionHandler(ctx.uncaughtExceptionHandler());
 
diff --git a/modules/core/src/main/java/org/apache/ignite/thread/IgniteStripedThreadPoolExecutor.java b/modules/core/src/main/java/org/apache/ignite/thread/IgniteStripedThreadPoolExecutor.java
index 4bfad68..cc28c00 100644
--- a/modules/core/src/main/java/org/apache/ignite/thread/IgniteStripedThreadPoolExecutor.java
+++ b/modules/core/src/main/java/org/apache/ignite/thread/IgniteStripedThreadPoolExecutor.java
@@ -23,7 +23,6 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.Callable;
-import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
 import java.util.concurrent.LinkedBlockingQueue;
@@ -109,21 +108,6 @@ public class IgniteStripedThreadPoolExecutor implements ExecutorService, Metrics
     }
 
     /**
-     * Submits a {@link Runnable} task for execution and returns a {@link CompletableFuture} representing that task.
-     * The command with the same {@code index} will be executed in the same thread.
-     *
-     * @param task The task to submit.
-     * @param idx Task index.
-     * @return a {@link Future} representing pending completion of the task.
-     * @throws RejectedExecutionException if the task cannot be
-     *         scheduled for execution.
-     * @throws NullPointerException if the task is {@code null}.
-     */
-    public CompletableFuture<?> submit(Runnable task, int idx) {
-        return CompletableFuture.runAsync(task, execs[threadId(idx)]);
-    }
-
-    /**
      * @param idx Index.
      * @return Stripped thread ID.
      */
diff --git a/modules/core/src/test/config/log4j-test.xml b/modules/core/src/test/config/log4j-test.xml
index 91a8919..e82c103 100755
--- a/modules/core/src/test/config/log4j-test.xml
+++ b/modules/core/src/test/config/log4j-test.xml
@@ -133,10 +133,6 @@
     -->
 
     <!-- Disable all open source debugging. -->
-<!--    <category name="org.apache.calcite">-->
-<!--        <level value="DEBUG"/>-->
-<!--    </category>-->
-
     <category name="org">
         <level value="INFO"/>
     </category>