-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
160 additions
and
5 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
40 changes: 40 additions & 0 deletions
40
server/src/main/java/org/opensearch/rest/action/admin/cluster/ClusterTask.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,40 @@ | ||
|
||
/* | ||
* 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.rest.action.admin.cluster; | ||
|
||
import org.opensearch.common.annotation.PublicApi; | ||
import org.opensearch.common.unit.TimeValue; | ||
import org.opensearch.core.tasks.TaskId; | ||
import org.opensearch.tasks.CancellableTask; | ||
|
||
import java.util.Map; | ||
|
||
import static org.opensearch.search.SearchService.NO_TIMEOUT; | ||
/** | ||
* Task storing information about a currently running ClusterRequest. | ||
* | ||
* @opensearch.api | ||
*/ | ||
@PublicApi(since = "1.0.0") | ||
public class ClusterTask extends CancellableTask { | ||
|
||
public ClusterTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers) { | ||
this(id, type, action, parentTaskId, headers, NO_TIMEOUT); | ||
} | ||
|
||
public ClusterTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers, TimeValue cancelAfterTimeInterval) { | ||
super(id, type, action, null, parentTaskId, headers, cancelAfterTimeInterval); | ||
} | ||
|
||
@Override | ||
public boolean shouldCancelChildrenOnCancellation() { | ||
return true; | ||
} | ||
} |
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