Deprecate local parameter for get field mapping request#55014
Deprecate local parameter for get field mapping request#55014ywangd merged 9 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/es-core-features (:Core/Features/Indices APIs) |
martijnvg
left a comment
There was a problem hiding this comment.
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.
Maybe add a space between the two sentences?
martijnvg
left a comment
There was a problem hiding this comment.
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.
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.
Added. Thanks for the heads up about the migrate doc. Will do for 7.x.
| // end::get-field-mappings-request-local | ||
|
|
||
| { | ||
| final RequestOptions requestOptions = RequestOptions.DEFAULT.toBuilder().setWarningsHandler(WarningsHandler.PERMISSIVE).build(); |
There was a problem hiding this comment.
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.
I think a space would need to be added here, otherwise this test will fail.
There was a problem hiding this comment.
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
localparameter 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.