-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Chunked encoding for cluster state API #92285
Chunked encoding for cluster state API #92285
Conversation
Pinging @elastic/es-distributed (Team:Distributed) |
NB most of these changes are just to add support for XContent fragments throughout. Kind of noisy. I could make it a separate API instead of adding a boolean parameter, maybe that would be nicer. |
#92534 will fix the failure; @elasticmachine please run elasticsearch-ci/part-1 |
@original-brownbear I've merged this with |
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.
Phew did my best to carefully read all the steps here, couldn't find any spot where the format would change or where we'd still serialize a problematically huge chunk => LGTM :)
metrics.contains(Metric.CUSTOMS) | ||
? Iterators.flatMap( | ||
customs.entrySet().iterator(), | ||
cursor -> 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.
NIT: could use org.elasticsearch.common.xcontent.ChunkedToXContentHelper#wrapWithObject
here to shorten this a little
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.
++ thanks, see c5bc46d
* Response listener for REST requests which dispatches the serialization of the response off of the thread on which the response was | ||
* received, since that thread is often a transport thread and XContent serialization might be expensive. | ||
*/ | ||
public class DispatchingRestToXContentListener<Response extends ToXContentObject> extends RestActionListener<Response> { |
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.
🎉
The cluster reroute API (optionally) returns the cluster state in its response, which can therefore be rather large. elastic#92285 enables a chunked encoding of the cluster state, and this commit adjusts the reroute API to make use of this encoding too.
The cluster reroute API (optionally) returns the cluster state in its response, which can therefore be rather large. #92285 enables a chunked encoding of the cluster state, and this commit adjusts the reroute API to make use of this encoding too.
Relates #89838