-
Notifications
You must be signed in to change notification settings - Fork 2k
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/QuerySandbox(ResourceLimitGroup) Add sandbox schema and tracking framework #13311
Changes from all commits
ac8b002
7f5bac5
eba0060
ba237c1
62f501d
d886fe9
44e9d11
5ba7535
d2a19ee
3afd9db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
import org.opensearch.common.annotation.PublicApi; | ||
import org.opensearch.common.unit.TimeValue; | ||
import org.opensearch.core.tasks.TaskId; | ||
import org.opensearch.search.resource_limit_group.ResourceLimitGroupTask; | ||
import org.opensearch.tasks.CancellableTask; | ||
import org.opensearch.tasks.SearchBackpressureTask; | ||
|
||
|
@@ -49,10 +50,11 @@ | |
* @opensearch.api | ||
*/ | ||
@PublicApi(since = "1.0.0") | ||
public class SearchTask extends CancellableTask implements SearchBackpressureTask { | ||
public class SearchTask extends CancellableTask implements SearchBackpressureTask, ResourceLimitGroupTask { | ||
// generating description in a lazy way since source can be quite big | ||
private final Supplier<String> descriptionSupplier; | ||
private SearchProgressListener progressListener = SearchProgressListener.NOOP; | ||
private String resourceLimitGroupId; | ||
|
||
public SearchTask( | ||
long id, | ||
|
@@ -106,4 +108,12 @@ public final SearchProgressListener getProgressListener() { | |
public boolean shouldCancelChildrenOnCancellation() { | ||
return true; | ||
} | ||
|
||
public String getResourceLimitGroupName() { | ||
return resourceLimitGroupId; | ||
} | ||
|
||
public void setResourceLimitGroupName(String resourceLimitGroupId) { | ||
this.resourceLimitGroupId = resourceLimitGroupId; | ||
} | ||
Comment on lines
+112
to
+118
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as SearchShardTask There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, so basically the tasks are created by |
||
} |
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 class does not have any other setters. Why not set the
resourceLimitGroupId
within the constructor itself?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't do that because of following reasons
TaskAwareRequest
interfaceSo we won't have the resourceLiimitGroupId
but we will change the information is coming in the searchRequest so this will likely not be present in final change.