-
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
Share XContent rendering code in terms aggs #23680
Share XContent rendering code in terms aggs #23680
Conversation
873c5ef
to
3c43b32
Compare
return builder; | ||
} | ||
|
||
protected abstract XContentBuilder doXContentKey(XContentBuilder builder) throws IOException; |
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: we named such methods "innerToXContent()" at some other places, worth to reuse the same 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.
I'd like to keep key
in the name, I find innerToXContent
very generic , how about keyToXContent
?
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.
My comment was more about name coherency than pure naming. I'm fine with both doXContentKey or keyToXContent with a preference for the later.
The output of the different implementations of terms aggs is always very similar. The toXContent methods for each of those classes though was duplicating almost the same code multiple times. This commit centralizes the code for rendering XContent to a single place, which can be reused from the different terms aggs implementations.
3c43b32
to
4457aff
Compare
The output of the different implementations of terms aggs is always very similar. The toXContent methods for each of those classes though was duplicating almost the same code multiple times. This commit centralizes the code for rendering XContent to a single place, which can be reused from the different terms aggs implementations.
* master: [API] change wait_for_completion defaults according to docs (elastic#23672) Share XContent rendering code in terms aggs (elastic#23680) Update ingest-node.asciidoc [DOCS] Update the docs about the fact that global ordinals for _parent field are loaded eagerly instead of lazily by default. Build: remove progress logger hack for gradle 2.13 (elastic#23679) Test: Add dump of integ test cluster logs on failure (elastic#23688) Plugins: Add plugin cli specific exit codes (elastic#23599) Plugins: Output better error message when existing plugin is incompatible (elastic#23562) Reindex: wait for cleanup before responding (elastic#23677) Packaging: Remove classpath ordering hack (elastic#23596) Docs: Add note about updating plugins requiring removal and reinstallation (elastic#23597) Build: Make plugin list for smoke tester dynamic (elastic#23601) [TEST] Propertly cleans up failing restore test
The output of the different implementations of terms aggs is always very similar. The
toXContent
methods for each of those classes though was duplicating almost the same code multiple times. This commit centralizes the code for renderingXContent
to a single place, which can be reused from the different terms aggs implementations.