-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Tidy up Netty4 HTTP response interfaces #104675
Tidy up Netty4 HTTP response interfaces #104675
Conversation
Renames `Netty4RestResponse` to `Netty4HttpResponse` and removes some unused super-interfaces and methods.
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
@Override | ||
public void addHeader(String name, String value) { | ||
headers().add(name, value); | ||
} | ||
|
||
@Override | ||
public boolean containsHeader(String name) { | ||
return headers().contains(name); | ||
} |
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.
Personally I feel it is natural for Netty4HttpResponse
to extend HttpResponse
so that these methods can be kept at interface level. Or we should have a comment somewhere to explain why future refactor should not make such change.
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'm currently working on a (possible) enhancement that would allow us to split responses over multiple such messages, for which it only makes sense for the first message in the sequence to extend HttpResponse
and carry stuff like headers. If that lands then this'll explain why we've cut down this interface, and if it doesn't then we can pull these back up to the super-interface.
FWIW this was opened to prepare things for #104851. |
Renames
Netty4RestResponse
toNetty4HttpResponse
and removes someunused super-interfaces and methods.