Skip to content

Conversation

@romseygeek
Copy link
Contributor

IndexTemplateMetaData x-content serialization is a bit confused and trappy at the
moment, with multiple static methods on the Builder object which may or may not
emit the template name and/or mapping types. This commit consolidates everything
into a single toXContent() method on the base class, with different options passed
through as ToXContent.Params. Deserialization is converted to use an ObjectParser,
taking the template name as a context.

@romseygeek romseygeek added :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >refactoring v8.0.0 labels Mar 23, 2020
@romseygeek romseygeek self-assigned this Mar 23, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/CRUD)

@romseygeek
Copy link
Contributor Author

This should make it easier to detect when a template has multiple mapping types, and optionally throw exceptions that will cause a master node to fail to start up. We could also plausibly backport it to 7.x as it's a nice general cleanup, but there's no rush to make feature freeze for 7.7

@romseygeek romseygeek requested a review from andreidan March 24, 2020 10:53
Copy link
Contributor

@andreidan andreidan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice refactoring @romseygeek

@romseygeek romseygeek merged commit 04c21af into elastic:master Mar 24, 2020
@romseygeek romseygeek deleted the types-removal/templates-xcontent branch March 24, 2020 12:50
romseygeek added a commit that referenced this pull request Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >refactoring v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants