Modifying ingest request builders#104636
Merged
masseyke merged 32 commits intoelastic:mainfrom Feb 2, 2024
Merged
Conversation
Collaborator
|
Hi @masseyke, I've created a changelog YAML for you. |
…search into fixing-request-builders
Collaborator
|
Pinging @elastic/es-data-management (Team:Data Management) |
joegallo
reviewed
Jan 31, 2024
| } | ||
|
|
||
| private UpdateByQueryRequest(SearchRequest search, boolean setDefaults) { | ||
| public UpdateByQueryRequest(SearchRequest search, boolean setDefaults) { |
Contributor
There was a problem hiding this comment.
Nit: can this be less than public?
joegallo
reviewed
Jan 31, 2024
| super.apply(request); | ||
| request.id(id); | ||
| if (sourceMap != null) { | ||
| if (sourceContentType == null) { |
Contributor
There was a problem hiding this comment.
I think these might scan better if you insisted on != null checks throughout. Then for example this top one would become:
if (sourceMap != null && sourceContentType != null) {
request.source(sourceMap, sourceContentType);
else if (sourceContentType != null) {
request.source(sourceMap);
}
joegallo
approved these changes
Feb 2, 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.
This changes all of our ingest-related builders other than BulkRequestBuilder (which was already changed in #104927) to inherit from ActionRequestLazyBuilder (added in #104927) rather than ActionRequestBuilder. This means that the requests will not be created until the builder's request() method is called, making upcoming ref counting work much more feasible.