-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
150 changed files
with
5,143 additions
and
358 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
14 | ||
17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1fc0f91e2b93778a974339d2c24363d7f34f90b4 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
dependencies { | ||
api project(':libs:opensearch-common') | ||
|
||
testImplementation "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" | ||
testImplementation "junit:junit:${versions.junit}" | ||
testImplementation "org.hamcrest:hamcrest:${versions.hamcrest}" | ||
testImplementation(project(":test:framework")) { | ||
exclude group: 'org.opensearch', module: 'opensearch-task-commons' | ||
} | ||
} | ||
|
||
tasks.named('forbiddenApisMain').configure { | ||
replaceSignatureFiles 'jdk-signatures' | ||
} |
103 changes: 103 additions & 0 deletions
103
libs/task-commons/src/main/java/org/opensearch/task/commons/clients/TaskListRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.task.commons.clients; | ||
|
||
import org.opensearch.task.commons.task.TaskStatus; | ||
import org.opensearch.task.commons.task.TaskType; | ||
import org.opensearch.task.commons.worker.WorkerNode; | ||
|
||
/** | ||
* Request object for listing tasks | ||
*/ | ||
public class TaskListRequest { | ||
|
||
/** | ||
* Filters listTasks response by specific task status' | ||
*/ | ||
private TaskStatus[] taskStatus; | ||
|
||
/** | ||
* Filter listTasks response by specific task types | ||
*/ | ||
private TaskType[] taskTypes; | ||
|
||
/** | ||
* Filter listTasks response by specific worker node | ||
*/ | ||
private WorkerNode workerNodes; | ||
|
||
/** | ||
* Depicts the start page number for the list call. | ||
* | ||
* @see TaskManagerClient#listTasks(TaskListRequest) | ||
*/ | ||
private int startPageNumber; | ||
|
||
/** | ||
* Depicts the page size for the list call. | ||
* | ||
* @see TaskManagerClient#listTasks(TaskListRequest) | ||
*/ | ||
private int pageSize; | ||
|
||
/** | ||
* Default constructor | ||
*/ | ||
public TaskListRequest() {} | ||
|
||
/** | ||
* Update task types to filter with in the request | ||
* @param taskTypes TaskType[] | ||
* @return ListTaskRequest | ||
*/ | ||
public TaskListRequest taskType(TaskType... taskTypes) { | ||
this.taskTypes = taskTypes; | ||
return this; | ||
} | ||
|
||
/** | ||
* Update task status to filter with in the request | ||
* @param taskStatus TaskStatus[] | ||
* @return ListTaskRequest | ||
*/ | ||
public TaskListRequest taskType(TaskStatus... taskStatus) { | ||
this.taskStatus = taskStatus; | ||
return this; | ||
} | ||
|
||
/** | ||
* Update worker node to filter with in the request | ||
* @param workerNode WorkerNode | ||
* @return ListTaskRequest | ||
*/ | ||
private TaskListRequest workerNode(WorkerNode workerNode) { | ||
this.workerNodes = workerNode; | ||
return this; | ||
} | ||
|
||
/** | ||
* Update page number to start with when fetching the list of tasks | ||
* @param startPageNumber startPageNumber | ||
* @return ListTaskRequest | ||
*/ | ||
public TaskListRequest startPageNumber(int startPageNumber) { | ||
this.startPageNumber = startPageNumber; | ||
return this; | ||
} | ||
|
||
/** | ||
* Update page size for the list tasks response | ||
* @param pageSize int | ||
* @return ListTaskRequest | ||
*/ | ||
public TaskListRequest pageSize(int pageSize) { | ||
this.pageSize = pageSize; | ||
return this; | ||
} | ||
} |
Oops, something went wrong.