Skip to content

Commit

Permalink
Support deprecated master_timeout parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
msfroh committed Apr 10, 2023
1 parent 744d5f9 commit 5ba734e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public List<Route> routes() {
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
DeleteSearchPipelineRequest request = new DeleteSearchPipelineRequest(restRequest.param("id"));
request.clusterManagerNodeTimeout(restRequest.paramAsTime("cluster_manager_timeout", request.clusterManagerNodeTimeout()));
parseDeprecatedMasterTimeoutParameter(request, restRequest);
request.timeout(restRequest.paramAsTime("timeout", request.timeout()));
return channel -> client.admin().cluster().deleteSearchPipeline(request, new RestToXContentListener<>(channel));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public List<Route> routes() {
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
GetSearchPipelineRequest request = new GetSearchPipelineRequest(Strings.splitStringByCommaToArray(restRequest.param("id")));
request.clusterManagerNodeTimeout(restRequest.paramAsTime("cluster_manager_timeout", request.clusterManagerNodeTimeout()));
parseDeprecatedMasterTimeoutParameter(request, restRequest);
return channel -> client.admin().cluster().getSearchPipeline(request, new RestStatusToXContentListener<>(channel));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient
Tuple<XContentType, BytesReference> sourceTuple = restRequest.contentOrSourceParam();
PutSearchPipelineRequest request = new PutSearchPipelineRequest(restRequest.param("id"), sourceTuple.v2(), sourceTuple.v1());
request.clusterManagerNodeTimeout(restRequest.paramAsTime("cluster_manager_timeout", request.clusterManagerNodeTimeout()));
parseDeprecatedMasterTimeoutParameter(request, restRequest);
request.timeout(restRequest.paramAsTime("timeout", request.timeout()));
return channel -> client.admin().cluster().putSearchPipeline(request, new RestToXContentListener<>(channel));
}
Expand Down

0 comments on commit 5ba734e

Please sign in to comment.