timoninmaxim commented on code in PR #11317:
URL: https://github.com/apache/ignite/pull/11317#discussion_r1587206258
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/CacheQueryType.java:
##########
@@ -43,5 +43,8 @@ public enum CacheQueryType {
CONTINUOUS,
/** SPI query. */
- SPI
+ SPI,
+
+ /** Index query. */
+ INDEX
Review Comment:
Looks like now we need a test for new QueryType
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java:
##########
@@ -1458,11 +1466,7 @@ protected GridCloseableIterator scanQueryLocal(final
GridCacheQueryAdapter qry,
taskName));
}
- IgniteClosure transformer = qry.transform();
-
- injectResources(transformer);
-
- GridCloseableIterator it = scanIterator(qry, transformer, true);
+ GridCloseableIterator it = qrySupplier.get();
updateStatistics = false;
Review Comment:
This setting doesn't affect anything
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java:
##########
@@ -1434,22 +1439,25 @@ protected GridCloseableIterator scanQueryLocal(final
GridCacheQueryAdapter qry,
new InternalScanFilter<>(qry.scanFilter()) : null;
try {
- assert qry.type() == SCAN;
+ assert qry.type() == SCAN || qry.type() == INDEX;
if (log.isDebugEnabled())
- log.debug("Running local SCAN query: " + qry);
-
- final String taskName =
cctx.kernalContext().task().resolveTaskName(qry.taskHash());
Review Comment:
Please, revert changes that actually does not change anything.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java:
##########
@@ -1434,22 +1439,25 @@ protected GridCloseableIterator scanQueryLocal(final
GridCacheQueryAdapter qry,
new InternalScanFilter<>(qry.scanFilter()) : null;
try {
- assert qry.type() == SCAN;
+ assert qry.type() == SCAN || qry.type() == INDEX;
if (log.isDebugEnabled())
- log.debug("Running local SCAN query: " + qry);
-
- final String taskName =
cctx.kernalContext().task().resolveTaskName(qry.taskHash());
- final ClusterNode locNode = cctx.localNode();
+ log.debug("Running local " + qry.type() + " query: " + qry);
if (cctx.events().isRecordable(EVT_CACHE_QUERY_EXECUTED)) {
+ final String taskName =
cctx.kernalContext().task().resolveTaskName(qry.taskHash());
+
+ final ClusterNode locNode = cctx.localNode();
+
+ final String clsName = qry.queryClassName();
+
cctx.gridEvents().record(new CacheQueryExecutedEvent<>(
locNode,
- "Scan query executed.",
+ qry.type() + " query executed.",
EVT_CACHE_QUERY_EXECUTED,
- CacheQueryType.SCAN.name(),
+ qry.type() == SCAN ? CacheQueryType.SCAN.name() :
CacheQueryType.INDEX.name(),
Review Comment:
`qry.type().name()`?
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java:
##########
@@ -1434,22 +1439,25 @@ protected GridCloseableIterator scanQueryLocal(final
GridCacheQueryAdapter qry,
new InternalScanFilter<>(qry.scanFilter()) : null;
try {
- assert qry.type() == SCAN;
+ assert qry.type() == SCAN || qry.type() == INDEX;
if (log.isDebugEnabled())
- log.debug("Running local SCAN query: " + qry);
-
- final String taskName =
cctx.kernalContext().task().resolveTaskName(qry.taskHash());
- final ClusterNode locNode = cctx.localNode();
+ log.debug("Running local " + qry.type() + " query: " + qry);
if (cctx.events().isRecordable(EVT_CACHE_QUERY_EXECUTED)) {
+ final String taskName =
cctx.kernalContext().task().resolveTaskName(qry.taskHash());
+
+ final ClusterNode locNode = cctx.localNode();
+
+ final String clsName = qry.queryClassName();
+
cctx.gridEvents().record(new CacheQueryExecutedEvent<>(
locNode,
- "Scan query executed.",
+ qry.type() + " query executed.",
EVT_CACHE_QUERY_EXECUTED,
- CacheQueryType.SCAN.name(),
+ qry.type() == SCAN ? CacheQueryType.SCAN.name() :
CacheQueryType.INDEX.name(),
namex,
- null,
+ clsName,
Review Comment:
Why do you need this change?
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java:
##########
@@ -1483,6 +1487,62 @@ protected GridCloseableIterator scanQueryLocal(final
GridCacheQueryAdapter qry,
}
}
+ /**
+ * Process local scan query.
+ *
+ * @param qry Query.
+ * @param updateStatistics Update statistics flag.
+ * @return GridCloseableIterator.
+ */
+ @SuppressWarnings({"unchecked"})
+ protected GridCloseableIterator scanQueryLocal(final GridCacheQueryAdapter
qry,
+ boolean updateStatistics) throws IgniteCheckedException {
+ return queryFunc(() -> {
+ try {
+ IgniteClosure transformer = qry.transform();
+
+ injectResources(transformer);
+
+ return scanIterator(qry, transformer, true);
+ }
+ catch (Exception e) {
+ throw new RuntimeException(e);
Review Comment:
It looks like you change exception class.
--
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]