-
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
Feature/QueryGroup Add Create API in plugin #14459
Feature/QueryGroup Add Create API in plugin #14459
Conversation
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
…odes Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
a2bd381
to
cb836d7
Compare
❌ Gradle check result for a2bd381: 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 5b53934: 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? |
A couple high level comments:
|
Thanks for the info! I'll look into it |
- [QueryGroup] Add QueryGroup CRUD APIs ([#13315](https://github.com/opensearch-project/OpenSearch/pull/13315)) | ||
- [QueryGroup] Add QueryGroup Create API ([#14459](https://github.com/opensearch-project/OpenSearch/pull/14459)) |
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.
Merge issue?
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.plugin.wlm; |
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.
Should package be plugin.wlm.action
? That would be consistent with the structure in core, I guess.
/** | ||
* Name for CreateQueryGroupAction | ||
*/ | ||
public static final String NAME = "cluster:admin/opensearch/query_group/wlm/_create"; |
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.
Should we have wlm
prior to query_group
in the action path?
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 that is the right way since wlm is the umbrella under which these query groups come.
plugins/workload-management/src/main/java/org/opensearch/plugin/wlm/CreateQueryGroupAction.java
Show resolved
Hide resolved
...ns/workload-management/src/main/java/org/opensearch/plugin/wlm/CreateQueryGroupResponse.java
Show resolved
Hide resolved
...ns/workload-management/src/main/java/org/opensearch/plugin/wlm/CreateQueryGroupResponse.java
Show resolved
Hide resolved
private final QueryGroup queryGroup; | ||
private RestStatus restStatus; |
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 there any other class example that follows this data object, restStatus response object model?
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 one is NotSerializableExceptionWrapper. But I also see other classes that don't store reststatus and only store data.
plugins/workload-management/src/main/java/org/opensearch/plugin/wlm/CreateQueryGroupAction.java
Show resolved
Hide resolved
/** | ||
* Name for CreateQueryGroupAction | ||
*/ | ||
public static final String NAME = "cluster:admin/opensearch/query_group/wlm/_create"; |
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 that is the right way since wlm is the umbrella under which these query groups come.
...ins/workload-management/src/main/java/org/opensearch/plugin/wlm/CreateQueryGroupRequest.java
Show resolved
Hide resolved
...ins/workload-management/src/main/java/org/opensearch/plugin/wlm/CreateQueryGroupRequest.java
Show resolved
Hide resolved
...ns/workload-management/src/main/java/org/opensearch/plugin/wlm/CreateQueryGroupResponse.java
Show resolved
Hide resolved
for (String resourceName : resourceLimitMapOne.keySet()) { | ||
assertTrue(resourceLimitMapTwo.containsKey(resourceName)); | ||
assertEquals(resourceLimitMapOne.get(resourceName), resourceLimitMapTwo.get(resourceName)); |
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.
We can replace this with
for (String resourceName : resourceLimitMapOne.keySet()) { | |
assertTrue(resourceLimitMapTwo.containsKey(resourceName)); | |
assertEquals(resourceLimitMapOne.get(resourceName), resourceLimitMapTwo.get(resourceName)); | |
assertTrue(resourceLimitMapOne.keySet().containsAll(resourceLimitMapTwo.keySet())); | |
assertTrue(resourceLimitMapOne.values().containsAll(resourceLimitMapTwo.values())); |
for (QueryGroup groupOne : listOne) { | ||
String groupOneName = groupOne.getName(); | ||
List<QueryGroup> groupTwoList = listTwo.stream().filter(sb -> sb.getName().equals(groupOneName)).collect(Collectors.toList()); | ||
assertEquals(1, groupTwoList.size()); | ||
QueryGroup groupTwo = groupTwoList.get(0); | ||
assertEquals(groupOne.getName(), groupTwo.getName()); | ||
assertEquals(groupOne.get_id(), groupTwo.get_id()); | ||
compareResourceLimits(groupOne.getResourceLimits(), groupTwo.getResourceLimits()); | ||
assertEquals(groupOne.getMode(), groupTwo.getMode()); | ||
assertEquals(groupOne.getUpdatedAtInMillis(), groupTwo.getUpdatedAtInMillis()); | ||
} |
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.
How about sorting these two lists and then doing the index wise comparison I think that would be more efficient ?
If the query group already implements equalsTo
method then we should leverage that.
...management/src/main/java/org/opensearch/plugin/wlm/service/QueryGroupPersistenceService.java
Show resolved
Hide resolved
Move this to #14680 and close this PR |
Description
This change introduces the Create QueryGroup API which we will use to enforce node level resiliency as part of this RFC: #12342.
The Create QueryGroup 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.