ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-4436 WIP.
Date Wed, 25 Jan 2017 11:10:18 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-4436-2 7166237b0 -> 9cd6cda9c


IGNITE-4436 WIP.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9cd6cda9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9cd6cda9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9cd6cda9

Branch: refs/heads/ignite-4436-2
Commit: 9cd6cda9cfeb9c737cffa6570f9c23d06270d326
Parents: 7166237
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Wed Jan 25 18:11:09 2017 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Wed Jan 25 18:11:09 2017 +0700

----------------------------------------------------------------------
 .../processors/query/GridQueryIndexing.java     |  8 ++++++-
 .../processors/query/h2/IgniteH2Indexing.java   |  9 ++++++--
 .../h2/twostep/GridReduceQueryExecutor.java     | 23 ++++++++++++++++----
 3 files changed, 33 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9cd6cda9/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
index df73231..1df21b2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
@@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.util.Collection;
 import java.util.List;
+import java.util.UUID;
 import javax.cache.Cache;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.cache.query.QueryCursor;
@@ -244,7 +245,12 @@ public interface GridQueryIndexing {
      * @param duration Duration to check.
      * @return Collection of long running queries.
      */
-    public Collection<String> longRunningQueries(long duration);
+    public Collection<IgniteBiTuple<UUID, String>> longRunningQueries(long duration);
+
+    /**
+     *
+     */
+    public void cancelQueries(Collection<UUID> queries);
 
     /**
      * Cancels all executing queries.

http://git-wip-us.apache.org/repos/asf/ignite/blob/9cd6cda9/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 32ac4af..a1b1395 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -3147,8 +3147,13 @@ public class IgniteH2Indexing implements GridQueryIndexing {
     }
 
     /** {@inheritDoc} */
-    @Override public Collection<String> longRunningQueries(long duration) {
-        return null;
+    @Override public Collection<IgniteBiTuple<UUID, String>> longRunningQueries(long
duration) {
+        return null; // TODO IGNITE-4436
+    }
+
+    /** {@inheritDoc} */
+    @Override public void cancelQueries(Collection<UUID> queries) {
+        // TODO IGNITE-4436
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/9cd6cda9/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index cdae6ec..c10ce12 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -1320,7 +1320,7 @@ public class GridReduceQueryExecutor {
         private final int pageSize;
 
         /** */
-        private final long start;
+        private final long startTime;
 
         /** */
         private final GridQueryCancel cancel;
@@ -1332,13 +1332,14 @@ public class GridReduceQueryExecutor {
          * @param conn Connection.
          * @param idxsCnt Number of indexes.
          * @param pageSize Page size.
-         * @param start Start time.
+         * @param startTime Start time.
+         * @param cancel Query cancel handler.
          */
-        private QueryRun(Connection conn, int idxsCnt, int pageSize, long start, GridQueryCancel
cancel) {
+        private QueryRun(Connection conn, int idxsCnt, int pageSize, long startTime, GridQueryCancel
cancel) {
             this.conn = (JdbcConnection)conn;
             this.idxs = new ArrayList<>(idxsCnt);
             this.pageSize = pageSize > 0 ? pageSize : GridCacheTwoStepQuery.DFLT_PAGE_SIZE;
-            this.start = start;
+            this.startTime = startTime;
             this.cancel = cancel;
         }
 
@@ -1373,6 +1374,20 @@ public class GridReduceQueryExecutor {
             for (GridMergeIndex idx : idxs) // Fail all merge indexes.
                 idx.fail(e);
         }
+
+        /**
+         * @return Query duration.
+         */
+        long duration() {
+            return U.currentTimeMillis() - startTime;
+        }
+
+        /**
+         * Cancel query;
+         */
+        void cancel() {
+            cancel.cancel();
+        }
     }
 
     /**


Mime
View raw message