-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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-24323 SQL Calcite: Add query blocking tasks executor (allows t… #11833
Conversation
d8c8b98
to
80e7f30
Compare
…o execute SQL inside UDF)
80e7f30
to
dfc23ed
Compare
...src/main/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessor.java
Outdated
Show resolved
Hide resolved
...te/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/task/QueryKey.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/ignite/internal/processors/query/calcite/exec/task/QueryTasksQueue.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/ignite/internal/processors/query/calcite/exec/task/QueryAwareTask.java
Outdated
Show resolved
Hide resolved
...org/apache/ignite/internal/processors/query/calcite/exec/task/QueryBlockingTaskExecutor.java
Outdated
Show resolved
Hide resolved
eHnd = ctx.uncaughtExceptionHandler(); | ||
|
||
executor = new IgniteThreadPoolExecutor( | ||
"calciteQry", |
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.
All other pools names starts with capital letter.
Let's call it CalciteQueryAwareExecutor
and the default one CalciteExecutor
.
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.
It's not a pool name, it's thread prefix. All other thread prefixes start with non-capital letters.
…o execute SQL inside UDF)
...main/java/org/apache/ignite/internal/processors/query/calcite/exec/task/QueryTasksQueue.java
Outdated
Show resolved
Hide resolved
for (Node pred = head, cur = pred.next; cur != null; pred = cur, cur = cur.next) { | ||
if (!blockedQrys.contains(cur.item.queryKey())) { // Skip tasks for blocked queries. | ||
QueryAwareTask res = cur.item; | ||
|
||
unlink(cur, pred); | ||
|
||
return res; | ||
} | ||
} |
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.
Let's rewite this with the while as it simplify the flow.
for (Node pred = head, cur = pred.next; cur != null; pred = cur, cur = cur.next) { | |
if (!blockedQrys.contains(cur.item.queryKey())) { // Skip tasks for blocked queries. | |
QueryAwareTask res = cur.item; | |
unlink(cur, pred); | |
return res; | |
} | |
} | |
Node pred = head; | |
Node cur = pred.next; | |
while (cur != null) { | |
if (!blockedQrys.contains(cur.item.queryKey())) { // Skip tasks for blocked queries. | |
QueryAwareTask res = cur.item; | |
unlink(cur, pred); | |
return res; | |
} | |
pred = cur; | |
cur = cur.next; | |
} |
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.
It's a matter of taste, I think there is no simplification with while
...main/java/org/apache/ignite/internal/processors/query/calcite/exec/task/QueryTasksQueue.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/ignite/internal/processors/query/calcite/exec/task/QueryTasksQueue.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/ignite/internal/processors/query/calcite/exec/task/QueryTasksQueue.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/ignite/internal/processors/query/calcite/exec/task/QueryTasksQueue.java
Outdated
Show resolved
Hide resolved
|
||
try { | ||
for (Node pred = head, cur = pred.next; cur != null; pred = cur, cur = cur.next) { | ||
if (task.equals(cur.item)) { |
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.
Do we really need equals here? Not ==
?
Quality Gate passedIssues Measures |
…o execute SQL inside UDF)
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 [email protected] or ask anу advice on http://asf.slack.com #ignite channel.