You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2017/08/14 10:30:20 UTC

[10/50] ignite git commit: WIP on flags.

WIP on flags.


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

Branch: refs/heads/ignite-5991-6019
Commit: 8fcc88009e2cb49b0b03f186a6f8409e9410ef5a
Parents: 34fa8a0
Author: devozerov <vo...@gridgain.com>
Authored: Thu Aug 10 15:56:22 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Aug 10 15:56:22 2017 +0300

----------------------------------------------------------------------
 .../query/h2/twostep/GridMapQueryExecutor.java  |  6 ++--
 .../h2/twostep/GridReduceQueryExecutor.java     |  6 ++--
 .../h2/twostep/msg/GridH2QueryRequest.java      | 38 ++++----------------
 3 files changed, 12 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8fcc8800/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index b0d40cc..4a52ee2 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -424,7 +424,7 @@ public class GridMapQueryExecutor {
         final boolean enforceJoinOrder = req.isFlagSet(GridH2QueryRequest.FLAG_ENFORCE_JOIN_ORDER);
         final boolean explain = req.isFlagSet(GridH2QueryRequest.FLAG_EXPLAIN);
         final boolean replicated = req.isFlagSet(GridH2QueryRequest.FLAG_REPLICATED);
-        final boolean streaming = req.streaming();
+        final boolean lazy = req.isFlagSet(GridH2QueryRequest.FLAG_LAZY);
 
         final List<Integer> cacheIds = req.caches();
 
@@ -457,7 +457,7 @@ public class GridMapQueryExecutor {
                             false,
                             req.timeout(),
                             params,
-                            streaming);
+                            lazy);
 
                         return null;
                     }
@@ -481,7 +481,7 @@ public class GridMapQueryExecutor {
             replicated,
             req.timeout(),
             params,
-            streaming);
+            lazy);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/8fcc8800/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 2b5f649..cacba36 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
@@ -712,6 +712,9 @@ public class GridReduceQueryExecutor {
                 if (isReplicatedOnly)
                     flags |= GridH2QueryRequest.FLAG_REPLICATED;
 
+                if (streaming && mapQrys.size() == 1)
+                    flags |= GridH2QueryRequest.FLAG_LAZY;
+
                 GridH2QueryRequest req = new GridH2QueryRequest()
                     .requestId(qryReqId)
                     .topologyVersion(topVer)
@@ -725,9 +728,6 @@ public class GridReduceQueryExecutor {
                     .timeout(timeoutMillis)
                     .schemaName(schemaName);
 
-                if (mapQrys.size() == 1 && streaming)
-                    req.streaming(true);
-
                 if (send(nodes, req, parts == null ? null : new ExplicitPartitionsSpecializer(qryMap), false)) {
                     awaitAllReplies(r, nodes, cancel);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8fcc8800/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2QueryRequest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2QueryRequest.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2QueryRequest.java
index 6719f1e..94a3cc1 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2QueryRequest.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2QueryRequest.java
@@ -78,6 +78,11 @@ public class GridH2QueryRequest implements Message, GridCacheQueryMarshallable {
      */
     public static final int FLAG_REPLICATED = 1 << 4;
 
+    /**
+     * If lazy execution is enabled.
+     */
+    public static final int FLAG_LAZY = 1 << 5;
+
     /** */
     private long reqId;
 
@@ -128,9 +133,6 @@ public class GridH2QueryRequest implements Message, GridCacheQueryMarshallable {
     /** Schema name. */
     private String schemaName;
 
-    /** Streaming flag. */
-    private boolean streaming;
-
     /**
      * Required by {@link Externalizable}
      */
@@ -367,20 +369,6 @@ public class GridH2QueryRequest implements Message, GridCacheQueryMarshallable {
         return this;
     }
 
-    /**
-     * @return Streaming flag.
-     */
-    public boolean streaming() {
-        return streaming;
-    }
-
-    /**
-     * @param streaming Streaming flag.
-     */
-    public void streaming(boolean streaming) {
-        this.streaming = streaming;
-    }
-
     /** {@inheritDoc} */
     @Override public void marshall(Marshaller m) {
         if (paramsBytes != null)
@@ -502,12 +490,6 @@ public class GridH2QueryRequest implements Message, GridCacheQueryMarshallable {
                     return false;
 
                 writer.incrementState();
-
-            case 12:
-                if (!writer.writeBoolean("streaming", streaming))
-                    return false;
-
-                writer.incrementState();
         }
 
         return true;
@@ -617,14 +599,6 @@ public class GridH2QueryRequest implements Message, GridCacheQueryMarshallable {
                     return false;
 
                 reader.incrementState();
-
-            case 12:
-                streaming = reader.readBoolean("streaming");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
         }
 
         return reader.afterMessageRead(GridH2QueryRequest.class);
@@ -637,7 +611,7 @@ public class GridH2QueryRequest implements Message, GridCacheQueryMarshallable {
 
     /** {@inheritDoc} */
     @Override public byte fieldsCount() {
-        return 13;
+        return 12;
     }
 
     /** {@inheritDoc} */