-
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.
add documentation & TaskWorker interface
- Loading branch information
Showing
9 changed files
with
94 additions
and
18 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
23 changes: 23 additions & 0 deletions
23
libs/offline-tasks/src/main/java/org/opensearch/offline_tasks/task/TaskParams.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,23 @@ | ||
/* | ||
* 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.offline_tasks.task; | ||
|
||
import org.opensearch.common.annotation.ExperimentalApi; | ||
|
||
/** | ||
* Base class for all TaskParams implementation of various TaskTypes | ||
*/ | ||
@ExperimentalApi | ||
public abstract class TaskParams { | ||
|
||
/** | ||
* Default constructor | ||
*/ | ||
public TaskParams() {} | ||
} |
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
31 changes: 31 additions & 0 deletions
31
libs/offline-tasks/src/main/java/org/opensearch/offline_tasks/worker/TaskWorker.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,31 @@ | ||
/* | ||
* 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.offline_tasks.worker; | ||
|
||
import org.opensearch.common.annotation.ExperimentalApi; | ||
import org.opensearch.offline_tasks.task.Task; | ||
import org.opensearch.offline_tasks.task.TaskParams; | ||
|
||
/** | ||
* Task Worker that executes the Task | ||
* | ||
* @opensearch.experimental | ||
*/ | ||
@ExperimentalApi | ||
public interface TaskWorker { | ||
|
||
/** | ||
* Execute the Task | ||
* | ||
* @param task Task to be execute | ||
* @param taskParams TaskParams to be used while executing the task | ||
*/ | ||
void executeTask(Task task, TaskParams taskParams); | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
libs/offline-tasks/src/main/java/org/opensearch/offline_tasks/worker/package-info.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,12 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* Contains task worker related classes | ||
*/ | ||
package org.opensearch.offline_tasks.worker; |
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