-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Deprecate local parameter for get field mapping request #55014
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
Deprecate local parameter for get field mapping request #55014
Conversation
Pinging @elastic/es-core-features (:Core/Features/Indices APIs) |
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.
Looks good. Left a comment and also the org.elasticsearch.client.indices.GetFieldMappingsRequest
class in HLRC module should be modified. I suggest keeping the local(...)
methods with a @Deprecated
annotation, but not serializing/sending the local parameter.
if (request.hasParam("local")) { | ||
deprecationLogger.deprecatedAndMaybeLog("get_field_mapping_local", | ||
"Use [local] in get field mapping requests is deprecated." | ||
+ "The parameter will be removed in the next major version"); |
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.
Maybe add a space between the two sentences?
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.
Yep, added.
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.
Left two minor comments, otherwise LGTM.
deprecated:[7.8.0, Field mappings are always retrieved locally] | ||
(Optional, boolean) If `true`, the request retrieves information from the local | ||
node only. Defaults to `false`, which means information is retrieved from | ||
the master node. |
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 would add that the parameter currently is just a noop.
Can you also update the migrate_7_8.asciidoc file when backporting this change to the 7.x branch?
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.
Added. Thanks for the heads up about the migrate doc. Will do for 7.x.
@@ -705,11 +707,12 @@ public void testGetFieldMapping() throws IOException, InterruptedException { | |||
request.local(true); // <1> | |||
// end::get-field-mappings-request-local | |||
|
|||
{ | |||
final RequestOptions requestOptions = RequestOptions.DEFAULT.toBuilder().setWarningsHandler(WarningsHandler.PERMISSIVE).build(); |
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.
👍
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.
Followed your suggestion to add deprecated annotation to GetFieldMappingsRequest#local(..)
methods and removed it from the conversion. It works better and this change to RequestOptions is no longer necessary.
node_selector: | ||
version: "7.8.0 - " | ||
warnings: | ||
- "Use [local] in get field mapping requests is deprecated.The parameter will be removed in the next major version" |
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 think a space would need to be added here, otherwise this test will fail.
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.
Good catch. It indeed failed for many of the CI tests ...
The usage of local parameter for GetFieldMappingRequest has been removed from the underlying transport action since v2.0. This PR deprecates the parameter from rest layer. It will be removed in next major version.
Backported:
|
Relates: elastic#55014 This commit deprecates the local param in get_mapping.json. This parameter is a no-op and field mappings are always retrieved locally.
Relates: #55014 This commit deprecates the local param in get_mapping.json. This parameter is a no-op and field mappings are always retrieved locally.
The `local` param for the `GetFieldMapping` API was deprecated in elastic#55014 and I think elastic#57265 aimed to propogate that deprecation to the REST API spec, but it changed `get_mapping.json` instead of `get_field_mapping.json`. elastic#55100 removed the `local` param for the _field_ mapping API so we can safely remove the field from the spec and remove the YAML test.
The `local` param for the `GetFieldMapping` API was deprecated in #55014 and I think #57265 aimed to propogate that deprecation to the REST API spec, but it changed `get_mapping.json` instead of `get_field_mapping.json`. #55100 removed the `local` param for the _field_ mapping API so we can safely remove the field from the spec and remove the YAML test.
The usage of
local
parameter for GetFieldMappingRequest has been removed from the underlying transport action since v2.0.This PR deprecate the parameter from rest layer. It will be removed in next major version.