Cleaning up the new ingest builders#105149
Merged
masseyke merged 3 commits intoelastic:mainfrom Feb 5, 2024
Merged
Conversation
Collaborator
|
Pinging @elastic/es-distributed (Team:Distributed) |
joegallo
approved these changes
Feb 5, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As originally written in #104927 and #104636, the new ingest request builder objects held onto whatever was passed to them, using that to create the request in the
request()method. However, this held onto a lot more memory than the old builders in some cases because XContentBuilders use a lot more memory than the corresponding BytesReference (the object type used by the request itself) would. #105091 fixed the most urgent problem by switching IndexRequestBuilder to only use BytesReference for source data. This PR follows up on that by doing the same for UpdateRequestBuilder. For the sake of consistency with this change, this PR also changes all builders to only hold a single representation for any given request field (e.g. it removes refreshPolicyString and uses only refreshPolicy). This also simplified/removed a lot of the field validation because it is no longer possible to have two different representations of the same field.