OpenSearch/modules
Alan Woodward 67a27e2b9d Add declarative parameters to FieldMappers (#58663)
The FieldMapper infrastructure currently has a bunch of shared parameters, many of which
are only applicable to a subset of the 41 mapper implementations we ship with. Merging,
parsing and serialization of these parameters are spread around the class hierarchy, with
much repetitive boilerplate code required. It would be much easier to reason about these
things if we could declare the parameter set of each FieldMapper directly in the implementing
class, and share the parsing, merging and serialization logic instead.

This commit is a first effort at introducing a declarative parameter style. It adds a new FieldMapper
subclass, ParametrizedFieldMapper, and refactors two mappers, Boolean and Binary, to use it.
Parameters are declared on Builder classes, with the declaration including the parameter name,
whether or not it is updateable, a default value, how to parse it from mappings, and how to
extract it from another mapper at merge time. Builders have a getParameters method, which
returns a list of the declared parameters; this is then used for parsing, merging and serialization.
Merging is achieved by constructing a new Builder from the existing Mapper, and merging in
values from the merging Mapper; conflicts are all caught at this point, and if none exist then a new,
merged, Mapper can be built from the Builder. This allows all values on the Mapper to be final.

Other mappers can be gradually migrated to this new style, and once they have all been refactored
we can merge ParametrizedFieldMapper and FieldMapper entirely.
2020-07-09 11:43:21 +01:00
..
aggs-matrix-stats Improve cardinality measure used to build aggs (#56533) (#59107) 2020-07-08 08:42:23 -04:00
analysis-common 7.x - Create plugin for yamlTest task (#56841) (#59090) 2020-07-06 14:16:26 -05:00
geo 7.x - Create plugin for yamlTest task (#56841) (#59090) 2020-07-06 14:16:26 -05:00
ingest-common 7.x - Create plugin for yamlTest task (#56841) (#59090) 2020-07-06 14:16:26 -05:00
ingest-geoip 7.x - Create plugin for yamlTest task (#56841) (#59090) 2020-07-06 14:16:26 -05:00
ingest-user-agent 7.x - Create plugin for yamlTest task (#56841) (#59090) 2020-07-06 14:16:26 -05:00
kibana Replace compile configuration usage with api (7.x backport) (#58721) 2020-06-30 15:57:41 +02:00
lang-expression upgrade to lucene-8.6.0-snapshot-6a715e2ecc3 (#59091) (#59120) 2020-07-07 12:07:41 +02:00
lang-mustache 7.x - Create plugin for yamlTest task (#56841) (#59090) 2020-07-06 14:16:26 -05:00
lang-painless Remove misc dependency related deprecation warnings (7.x backport) (#59122) 2020-07-07 17:10:31 +02:00
mapper-extras 7.x - Create plugin for yamlTest task (#56841) (#59090) 2020-07-06 14:16:26 -05:00
parent-join Improve cardinality measure used to build aggs (#56533) (#59107) 2020-07-08 08:42:23 -04:00
percolator Add declarative parameters to FieldMappers (#58663) 2020-07-09 11:43:21 +01:00
rank-eval 7.x - Create plugin for yamlTest task (#56841) (#59090) 2020-07-06 14:16:26 -05:00
reindex Fix the timestamp field of a data stream to @timestamp (#59210) 2020-07-08 17:30:46 +02:00
repository-url Add Check for Metadata Existence in BlobStoreRepository (#59141) (#59216) 2020-07-08 14:25:01 +02:00
systemd Encapsulate systemd extender 2020-04-20 21:17:42 -04:00
tasks Reintroduce system index APIs for Kibana (#54935) 2020-04-08 09:08:49 -06:00
transport-netty4 7.x - Create plugin for yamlTest task (#56841) (#59090) 2020-07-06 14:16:26 -05:00
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00