-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Add high-level client methods that accept RequestOptions #31069
Changes from 7 commits
26bd57c
caf3bfc
2347cdf
519e45b
53be62b
cb6331b
cabeea9
aee9dd3
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 |
---|---|---|
|
@@ -41,23 +41,55 @@ public final class ClusterClient { | |
} | ||
|
||
/** | ||
* Updates cluster wide specific settings using the Cluster Update Settings API | ||
* Updates cluster wide specific settings using the Cluster Update Settings API. | ||
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html"> Cluster Update Settings | ||
* API on elastic.co</a> | ||
* @param clusterUpdateSettingsRequest the request | ||
* @param options the request options (e.g. headers), or {@link RequestOptions#DEFAULT} if nothing needs to be customized | ||
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. s/or/use/ ? |
||
* @return the response | ||
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. I don't think the 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. agreed, I added them for consistency reasons, given that we added param tags it felt weird not to have also the return one. |
||
* @throws IOException in case there is a problem sending the request or parsing back the response | ||
*/ | ||
public ClusterUpdateSettingsResponse putSettings(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, RequestOptions options) | ||
throws IOException { | ||
return restHighLevelClient.performRequestAndParseEntity(clusterUpdateSettingsRequest, RequestConverters::clusterPutSettings, | ||
options, ClusterUpdateSettingsResponse::fromXContent, emptySet()); | ||
} | ||
|
||
/** | ||
* Updates cluster wide specific settings using the Cluster Update Settings API. | ||
* <p> | ||
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html"> Cluster Update Settings | ||
* API on elastic.co</a> | ||
* @deprecated Prefer {@link #putSettings(ClusterUpdateSettingsRequest, RequestOptions)} | ||
*/ | ||
@Deprecated | ||
public ClusterUpdateSettingsResponse putSettings(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, Header... headers) | ||
throws IOException { | ||
return restHighLevelClient.performRequestAndParseEntity(clusterUpdateSettingsRequest, RequestConverters::clusterPutSettings, | ||
ClusterUpdateSettingsResponse::fromXContent, emptySet(), headers); | ||
} | ||
|
||
/** | ||
* Asynchronously updates cluster wide specific settings using the Cluster Update Settings API | ||
* Asynchronously updates cluster wide specific settings using the Cluster Update Settings API. | ||
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html"> Cluster Update Settings | ||
* API on elastic.co</a> | ||
* @param clusterUpdateSettingsRequest the request | ||
* @param options the request options (e.g. headers), or {@link RequestOptions#DEFAULT} if nothing needs to be customized | ||
* @param listener the listener to be notified upon request completion | ||
*/ | ||
public void putSettingsAsync(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, RequestOptions options, | ||
ActionListener<ClusterUpdateSettingsResponse> listener) { | ||
restHighLevelClient.performRequestAsyncAndParseEntity(clusterUpdateSettingsRequest, RequestConverters::clusterPutSettings, | ||
options, ClusterUpdateSettingsResponse::fromXContent, listener, emptySet()); | ||
} | ||
/** | ||
* Asynchronously updates cluster wide specific settings using the Cluster Update Settings API. | ||
* <p> | ||
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html"> Cluster Update Settings | ||
* API on elastic.co</a> | ||
* @deprecated Prefer {@link #putSettingsAsync(ClusterUpdateSettingsRequest, RequestOptions, ActionListener)} | ||
*/ | ||
@Deprecated | ||
public void putSettingsAsync(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, | ||
ActionListener<ClusterUpdateSettingsResponse> listener, Header... headers) { | ||
restHighLevelClient.performRequestAsyncAndParseEntity(clusterUpdateSettingsRequest, RequestConverters::clusterPutSettings, | ||
|
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure this needs a param tag but it doesn't hurt anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went for having all the param tags rather than only some of them