timoninmaxim commented on code in PR #12376:
URL: https://github.com/apache/ignite/pull/12376#discussion_r2392157113
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java:
##########
@@ -683,63 +676,17 @@ private FieldsResult executeFieldsQuery(CacheQuery<?>
qry, @Nullable Object[] ar
args,
securitySubjectId(cctx),
taskName));
- }
-
- // Attempt to get result from cache.
- resKey = new T2<>(qry.clause(), F.asList(args));
-
- res = (FieldsResult)qryResCache.get(resKey);
-
- if (res != null && res.addRecipient(rcpt))
- return res; // Cached result found.
-
- res = new FieldsResult(rcpt);
-
- if (qryResCache.putIfAbsent(resKey, res) != null)
- resKey = null; // Failed to cache result.
}
- else {
- assert qry.type() == SPI : "Unexpected query type: " + qry.type();
-
- if (cctx.events().isRecordable(EVT_CACHE_QUERY_EXECUTED)) {
- cctx.gridEvents().record(new CacheQueryExecutedEvent<>(
- cctx.localNode(),
- "SPI query executed.",
- EVT_CACHE_QUERY_EXECUTED,
- CacheQueryType.SPI.name(),
- cctx.name(),
- null,
- null,
- null,
- null,
- args,
- securitySubjectId(cctx),
- taskName));
- }
- res = new FieldsResult(rcpt);
- }
+ // Attempt to get result from cache.
+ T2<String, List<Object>> resKey = new T2<>(qry.clause(),
F.asList(args));
- try {
- if (qry.type() == SPI) {
- IgniteSpiCloseableIterator<?> iter =
cctx.kernalContext().indexing().query(cacheName, F.asList(args),
- filter(qry));
+ FieldsResult res = (FieldsResult) qryResCache.get(resKey);
- res.onDone(iter);
- }
- else {
- assert qry.type() == SQL_FIELDS;
+ if (res != null && res.addRecipient(rcpt))
+ return res; // Cached result found.
- throw new IllegalStateException("Should never be called.");
- }
- }
- catch (Exception e) {
- res.onDone(e);
- }
- finally {
- if (resKey != null)
- qryResCache.remove(resKey, res);
- }
+ res = new FieldsResult(rcpt);
Review Comment:
just `return new FieldsResult(rcpt)`
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java:
##########
@@ -939,7 +886,7 @@ protected void runFieldsQuery(final GridCacheQueryInfo
qryInfo) {
String taskName =
cctx.kernalContext().task().resolveTaskName(qry.taskHash());
res = qryInfo.local() ?
- executeFieldsQuery(qry, qryInfo.arguments(),
qryInfo.local(), taskName,
Review Comment:
compilation fails here
--
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]