-
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 reroute API #92615
Chunked encoding for cluster reroute API #92615
Conversation
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.
Pinging @elastic/es-distributed (Team:Distributed) |
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.
LGTM.
* Similar to {@link #toXContentChunked} but for the {@link RestApiVersion#V_7} API. Note that chunked response bodies cannot send | ||
* deprecation warning headers once transmission has started, so implementations must check for deprecated feature use before returning. |
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 the deprecation warning warning should go into the class javadocs instead. The usage added in this PR emits a warning in toXContentChunked
, not the v7 one, and I think it applies equally to both.
} | ||
int actualChunks = 0; | ||
final var iterator = response.toXContentChunked(params); | ||
while (iterator.hasNext()) { |
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.
Can we assert that only toXContentChunked
outputs deprecations warnings? We may have to stop filtering warnings, but that seems desirable anyway.
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.