-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Recommission api level support #4604
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
Changes from all commits
8e1056a
c614b9a
55c4b42
74758e6
d76f281
686a9a2
c74a18c
ebb0d1a
07cd63a
746100a
9d60fd6
1011f35
0aca81b
091f2ea
9fddb62
3dde9b4
3ee67fc
7f988f8
4c3ed86
91d8a69
34d3989
2117249
1a80293
201e64d
baae7fb
2695198
2fa306c
e7388e3
a052dad
bfe13cb
0d98d0c
d572494
97df22d
28e5c69
69a281a
2981de5
9557048
9bd1717
760aaaf
3d842ef
6305812
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 |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "cluster.delete_decommission_awareness": { | ||
| "documentation": { | ||
| "url": "https://opensearch.org/docs/latest/opensearch/rest-api/decommission/", | ||
|
Member
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. This link redirects to docs. Is the documentation work in progress? or Am I missing something? |
||
| "description": "Delete any existing decommission." | ||
| }, | ||
| "stability": "experimental", | ||
|
Contributor
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. why is it experimental?
Contributor
Author
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. We will be marking this to stable once all meta issues are resolved we already have task identified for same. |
||
| "url": { | ||
| "paths": [ | ||
| { | ||
| "path": "/_cluster/decommission/awareness/", | ||
| "methods": [ | ||
| "DELETE" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| 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. | ||
| */ | ||
|
|
||
| package org.opensearch.action.admin.cluster.decommission.awareness.delete; | ||
|
|
||
| import org.opensearch.action.ActionType; | ||
|
|
||
| /** | ||
| * Delete decommission state action. | ||
| * | ||
| * @opensearch.internal | ||
| */ | ||
| public class DeleteDecommissionStateAction extends ActionType<DeleteDecommissionStateResponse> { | ||
| public static final DeleteDecommissionStateAction INSTANCE = new DeleteDecommissionStateAction(); | ||
| public static final String NAME = "cluster:admin/decommission/awareness/delete"; | ||
|
|
||
| private DeleteDecommissionStateAction() { | ||
| super(NAME, DeleteDecommissionStateResponse::new); | ||
| } | ||
| } |
| 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.action.admin.cluster.decommission.awareness.delete; | ||
|
|
||
| import org.opensearch.action.ActionRequestValidationException; | ||
| import org.opensearch.action.support.clustermanager.ClusterManagerNodeRequest; | ||
| import org.opensearch.common.io.stream.StreamInput; | ||
| import org.opensearch.common.io.stream.StreamOutput; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| /** | ||
| * Request for deleting decommission request. | ||
| * | ||
| * @opensearch.internal | ||
| */ | ||
| public class DeleteDecommissionStateRequest extends ClusterManagerNodeRequest<DeleteDecommissionStateRequest> { | ||
pranikum marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| public DeleteDecommissionStateRequest() {} | ||
|
|
||
| public DeleteDecommissionStateRequest(StreamInput in) throws IOException { | ||
| super(in); | ||
| } | ||
|
|
||
| @Override | ||
| public ActionRequestValidationException validate() { | ||
| return null; | ||
| } | ||
|
|
||
| @Override | ||
| public void writeTo(StreamOutput out) throws IOException { | ||
| super.writeTo(out); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /* | ||
| * 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.action.admin.cluster.decommission.awareness.delete; | ||
|
|
||
| import org.opensearch.action.support.clustermanager.ClusterManagerNodeOperationRequestBuilder; | ||
| import org.opensearch.client.OpenSearchClient; | ||
|
|
||
| /** | ||
| * Builder for Delete decommission request. | ||
| * | ||
| * @opensearch.internal | ||
| */ | ||
| public class DeleteDecommissionStateRequestBuilder extends ClusterManagerNodeOperationRequestBuilder< | ||
| DeleteDecommissionStateRequest, | ||
| DeleteDecommissionStateResponse, | ||
| DeleteDecommissionStateRequestBuilder> { | ||
|
|
||
| public DeleteDecommissionStateRequestBuilder(OpenSearchClient client, DeleteDecommissionStateAction action) { | ||
| super(client, action, new DeleteDecommissionStateRequest()); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * 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.action.admin.cluster.decommission.awareness.delete; | ||
|
|
||
| import org.opensearch.action.support.master.AcknowledgedResponse; | ||
| import org.opensearch.common.io.stream.StreamInput; | ||
| import org.opensearch.common.io.stream.StreamOutput; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| /** | ||
| * Response returned after deletion of decommission request. | ||
| * | ||
| * @opensearch.internal | ||
| */ | ||
| public class DeleteDecommissionStateResponse extends AcknowledgedResponse { | ||
|
|
||
| public DeleteDecommissionStateResponse(StreamInput in) throws IOException { | ||
| super(in); | ||
| } | ||
|
|
||
| public DeleteDecommissionStateResponse(boolean acknowledged) { | ||
| super(acknowledged); | ||
| } | ||
|
|
||
| @Override | ||
| public void writeTo(StreamOutput out) throws IOException { | ||
| super.writeTo(out); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| /* | ||
| * 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.action.admin.cluster.decommission.awareness.delete; | ||
|
|
||
| import org.apache.logging.log4j.LogManager; | ||
| import org.apache.logging.log4j.Logger; | ||
| import org.opensearch.action.ActionListener; | ||
| import org.opensearch.action.support.ActionFilters; | ||
| import org.opensearch.action.support.clustermanager.TransportClusterManagerNodeAction; | ||
| import org.opensearch.cluster.ClusterState; | ||
| import org.opensearch.cluster.block.ClusterBlockException; | ||
| import org.opensearch.cluster.block.ClusterBlockLevel; | ||
| import org.opensearch.cluster.decommission.DecommissionService; | ||
| import org.opensearch.cluster.metadata.IndexNameExpressionResolver; | ||
| import org.opensearch.cluster.service.ClusterService; | ||
| import org.opensearch.common.inject.Inject; | ||
| import org.opensearch.common.io.stream.StreamInput; | ||
| import org.opensearch.threadpool.ThreadPool; | ||
| import org.opensearch.transport.TransportService; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| /** | ||
| * Transport action for delete decommission. | ||
| * | ||
| * @opensearch.internal | ||
| */ | ||
| public class TransportDeleteDecommissionStateAction extends TransportClusterManagerNodeAction< | ||
| DeleteDecommissionStateRequest, | ||
| DeleteDecommissionStateResponse> { | ||
|
|
||
| private static final Logger logger = LogManager.getLogger(TransportDeleteDecommissionStateAction.class); | ||
| private final DecommissionService decommissionService; | ||
|
|
||
| @Inject | ||
| public TransportDeleteDecommissionStateAction( | ||
| TransportService transportService, | ||
| ClusterService clusterService, | ||
| ThreadPool threadPool, | ||
| ActionFilters actionFilters, | ||
| IndexNameExpressionResolver indexNameExpressionResolver, | ||
| DecommissionService decommissionService | ||
| ) { | ||
| super( | ||
| DeleteDecommissionStateAction.NAME, | ||
| transportService, | ||
| clusterService, | ||
| threadPool, | ||
| actionFilters, | ||
| DeleteDecommissionStateRequest::new, | ||
| indexNameExpressionResolver | ||
| ); | ||
| this.decommissionService = decommissionService; | ||
| } | ||
|
|
||
| @Override | ||
| protected String executor() { | ||
| return ThreadPool.Names.SAME; | ||
| } | ||
|
|
||
| @Override | ||
| protected DeleteDecommissionStateResponse read(StreamInput in) throws IOException { | ||
| return new DeleteDecommissionStateResponse(in); | ||
| } | ||
|
|
||
| @Override | ||
| protected ClusterBlockException checkBlock(DeleteDecommissionStateRequest request, ClusterState state) { | ||
| return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_WRITE); | ||
| } | ||
|
|
||
| @Override | ||
| protected void clusterManagerOperation( | ||
| DeleteDecommissionStateRequest request, | ||
| ClusterState state, | ||
| ActionListener<DeleteDecommissionStateResponse> listener | ||
| ) { | ||
| logger.info("Received delete decommission Request [{}]", request); | ||
| this.decommissionService.startRecommissionAction(listener); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
|
|
||
| /** Delete decommission transport handlers. */ | ||
| package org.opensearch.action.admin.cluster.decommission.awareness.delete; |
Uh oh!
There was an error while loading. Please reload this page.