forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Construct dynamic updates directly via object builders (elastic#81449)
Currently, dynamic updates are built in the DocumentParser using a stack of possibly-dynamic object mappers. This logic, spread across a number of static methods, frequently assumes that the parents of a mapper can be found by splitting its name on dots, an assumption that will fail to hold once we allow objects to hold fields that have dots in their names. As a pre-requisite for the dots in field names effort, this commit refactors the construction of dynamic updates into object mapper builders. Now, to build an update, we start with a new dynamic root builder, and then call addUpdate on it with each dynamically built mapper in turn. The builder will examine the mapper and see if it can just add it to its own set of mappers directly; and if not, it will retrieve or build an appropriate intermediate object mapper and recursively call addUpdate on it with the original mapper. As a side-effect of this change, ObjectMapper itself no longer updates its map of child mappers except during construction via merging, and so we can safely replace CopyOnWriteHashMap here.
- Loading branch information
1 parent
533f6e0
commit 002f506
Showing
16 changed files
with
209 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.