New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNITE-22183 Recording of Index query events added #11342
Conversation
@@ -1203,7 +1219,7 @@ protected void runQuery(GridCacheQueryInfo qryInfo) { | |||
break; | |||
} | |||
|
|||
if (type == SCAN || type == INDEX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change might affect IndexQuery performance due to useless generics handling. Let's check how ScanQuery record this event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recording of Index query object reading events moved to IndexQueryProcessor#queryLocal
.
.../test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
Show resolved
Hide resolved
…IndexQueryProcessor#queryLocal
…teCacheAbstractQuerySelfTest#testIndexQueryEvents
|
||
CacheObjectContext objCtx = cctx.cacheObjectContext(); | ||
|
||
K key0 = (K)CacheObjectUtils.unwrapBinaryIfNeeded(objCtx, key, keepBinary, false, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code duplicates code in the onHasNext
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this section of code more concise by using the unwrap()
method.
...les/core/src/main/java/org/apache/ignite/internal/cache/query/index/IndexQueryProcessor.java
Outdated
Show resolved
Hide resolved
...les/core/src/main/java/org/apache/ignite/internal/cache/query/index/IndexQueryProcessor.java
Outdated
Show resolved
Hide resolved
@@ -125,14 +132,39 @@ public <K, V> IndexQueryResult<K, V> queryLocal( | |||
|
|||
IgniteBiTuple<K, V> row = currVal; | |||
|
|||
if (isRecordable) { | |||
K k = unwrap(row.getKey(), keepBinary); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code duplication, you already have the K and V in onHasNext
. Just move events to this method. Note, that filtered entries should not raise the event
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Events moved to onHasNext
.
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summary
whereXXXX
- number of JIRA issue.(see the Maintainers list)
the
green visa
attached to the JIRA ticket (see TC.Bot: Check PR)Notes
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.