timoninmaxim commented on a change in pull request #9081:
URL: https://github.com/apache/ignite/pull/9081#discussion_r726932960



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
##########
@@ -523,57 +488,27 @@ else if (!cancelled.contains(res.requestId()))
     }
 
     /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
     @Override public CacheQueryFuture<?> queryDistributed(GridCacheQueryBean 
qry, final Collection<ClusterNode> nodes) {
+        return queryDistributed(qry, nodes, false);
+    }
+
+    /** */
+    private CacheQueryFuture<?> queryDistributed(GridCacheQueryBean qry, final 
Collection<ClusterNode> nodes, boolean fields) {
         assert cctx.config().getCacheMode() != LOCAL;
 
         if (log.isDebugEnabled())
             log.debug("Executing distributed query: " + qry);
 
         long reqId = cctx.io().nextIoId();
 
-        final GridCacheDistributedQueryFuture<K, V, ?> fut =
-            new GridCacheDistributedQueryFuture<>(cctx, reqId, qry, nodes);
+        final GridCacheDistributedQueryFuture fut = fields ?
+            new GridCacheDistributedFieldsQueryFuture(cctx, reqId, qry, nodes) 
:
+            new GridCacheDistributedQueryFuture(cctx, reqId, qry, nodes);
 
         try {
-            qry.query().validate();
-
-            String clsName = qry.query().queryClassName();
-            Boolean dataPageScanEnabled = qry.query().isDataPageScanEnabled();
-            MvccSnapshot mvccSnapshot = qry.query().mvccSnapshot();
-
-            boolean deployFilterOrTransformer = (qry.query().scanFilter() != 
null || qry.query().transform() != null
-                || qry.query().idxQryDesc() != null) && 
cctx.gridDeploy().enabled();
-
-            final GridCacheQueryRequest req = new GridCacheQueryRequest(
-                cctx.cacheId(),
-                reqId,
-                cctx.name(),
-                qry.query().type(),
-                false,
-                qry.query().clause(),
-                qry.query().idxQryDesc(),
-                qry.query().limit(),
-                clsName,
-                qry.query().scanFilter(),
-                qry.query().partition(),
-                qry.reducer(),
-                qry.transform(),
-                qry.query().pageSize(),
-                qry.query().includeBackups(),
-                qry.arguments(),
-                false,
-                qry.query().keepBinary(),
-                qry.query().taskHash(),
-                queryTopologyVersion(),
-                mvccSnapshot,
-                // Force deployment anyway if scan query is used.
-                cctx.deploymentEnabled() || deployFilterOrTransformer,
-                dataPageScanEnabled);
+            fut.qry.query().validate();

Review comment:
       Use #startQuery for start distributed query. #execute is OK for local 
future as it naturally executes full query locally. For distributed query we 
can just start query on remote nodes. And then we just put future to collection 
of futures and return iterator to user. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to