-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Simplify EsqlQueryResponse #129031
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
Simplify EsqlQueryResponse #129031
Conversation
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
| public Profile(List<DriverProfile> drivers) { | ||
| this.drivers = drivers; | ||
| } | ||
| public record Profile(List<DriverProfile> drivers) implements Writeable { |
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 wonder if we even need that? May be it is worth in-lining List instead?
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 believe I wrote it as a record because I expected we'd add other List<PlanProfile> and List<SomeOtherThingProfile> to it. Mostly, I thought it'd have plan profile in it.
nik9000
left a comment
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.
This is helpful, though I think it'd be even more readable to do it the old school way.
| public Profile(List<DriverProfile> drivers) { | ||
| this.drivers = drivers; | ||
| } | ||
| public record Profile(List<DriverProfile> drivers) implements Writeable { |
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 believe I wrote it as a record because I expected we'd add other List<PlanProfile> and List<SomeOtherThingProfile> to it. Mostly, I thought it'd have plan profile in it.
| Iterator<ToXContent> executionInfoRender = executionInfo != null && executionInfo.hasMetadataToReport() | ||
| ? ChunkedToXContentHelper.field("_clusters", executionInfo, params) | ||
| : Collections.emptyIterator(); | ||
| return Iterators.concat( |
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 this'd be more readable as a traditional
List<ToXContent> all = new ArrayList<>();
addAsyncProperties(all);
all.add(took)
...
I think so.
But that could be because I'm old. |
This change tries to simplify EsqlQueryResponse:
conditionalChunkedXContentand migrate all usages to it.List<DriverProfile>. Here I am converting it to record.