-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Workload Management] QueryGroup Stats API Logic #15777
base: main
Are you sure you want to change the base?
Conversation
88c9cff
to
b66823c
Compare
❌ Gradle check result for f647487: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
b66823c
to
9c241b7
Compare
❌ Gradle check result for 88c9cff: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for b66823c: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 02cf095: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
} | ||
|
||
@Override | ||
protected List<QueryGroupStats> readNodesFrom(StreamInput in) throws IOException { |
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.
Will this send the node_id along with the QueryGroupStats
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 returns List<QueryGroupStats>
but we can use queryGroupStats.getNode().getId()
to get node_id
* Inner QueryGroupStatsRequest | ||
* | ||
* @opensearch.experimental | ||
*/ | ||
public static class NodeQueryGroupStatsRequest extends TransportRequest { | ||
|
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 this as this wrapper is not doing anything additional and the underlying object type is already TransportRequest
?
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.
I'm following the structure of TransportNodesStatsAction
. NodeQueryGroupStatsRequest
is used as a per-node action handler inside Transport Action, and QueryGroupStatsRequest represents the action for all nodes as a whole. The NodeQueryGroupStatsRequest
serves as the container for the request sent to each node, allowing the framework to serialize and execute that request on the individual nodes.
* QueryGroup stats of the cluster. | ||
* | ||
* @param request The QueryGroupStatsRequest | ||
* @param listener A listener to be notified with a result | ||
*/ | ||
void queryGroupStats(QueryGroupStatsRequest request, ActionListener<QueryGroupStatsResponse> listener); | ||
|
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.
Why should we add this method in the ClusterAdmin interface ? I think this API should be accessible to all so does it make sense to add to AbstractClient
since NodeClient
extends it.
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.
the actual implementation is in AbstractClient
. I see nodeStats is also following this pattern (abstract function in ClusterAdminClient.java
and implementation in AbstractClient.java
)
server/src/main/java/org/opensearch/rest/action/admin/cluster/RestQueryGroupStatsAction.java
Outdated
Show resolved
Hide resolved
*/ | ||
public class QueryGroupService { | ||
// This map does not need to be concurrent since we will process the cluster state change serially and update | ||
// this map with new additions and deletions of entries. QueryGroupState is thread safe | ||
private final Map<String, QueryGroupState> queryGroupStateMap; | ||
private final TransportService transportService; |
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.
I think we should rely on just a Supplier<String>
as we only need nodeId here
...r/src/test/java/org/opensearch/action/support/nodes/TransportQueryGroupStatsActionTests.java
Outdated
Show resolved
Hide resolved
caec681
to
6144198
Compare
❌ Gradle check result for caec681: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 6144198: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
a8bb3a5
to
5240274
Compare
❕ Gradle check result for a8bb3a5: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
❕ Gradle check result for 5240274: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15777 +/- ##
============================================
- Coverage 71.89% 71.82% -0.07%
- Complexity 64211 64227 +16
============================================
Files 5272 5277 +5
Lines 300578 300670 +92
Branches 43432 43436 +4
============================================
- Hits 216086 215959 -127
- Misses 66707 66945 +238
+ Partials 17785 17766 -19 ☔ View full report in Codecov by Sentry. |
@ruai0511 @kaushalmahi12 |
If we use |
9bbc037
to
41aadb5
Compare
❌ Gradle check result for 9bbc037: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
I think it is upto user what kind of naming they want to use. In that case they can also use I think having |
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
41aadb5
to
9714571
Compare
❌ Gradle check result for 9714571: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
|
||
public QueryGroupService() { | ||
this(new HashMap<>()); | ||
@Inject |
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.
Is @Inject
needed here since we are creating the instance in Node.java
❌ Gradle check result for 2df37a3: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Description
This change introduces the QueryGroup Stats API as part of this RFC: #12342.
The QueryGroup Stats API schema is:
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.