-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add source mode stats to MappingStats #117463
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
Conversation
30d80ce to
00ad196
Compare
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
| Map<?, ?> sourceFieldDefinition = (Map<?, ?>) map.get("_source"); | ||
| if (sourceFieldDefinition.containsKey("mode")) { | ||
| String mode = (String) sourceFieldDefinition.get("mode"); | ||
| mappingSourceModeUsageCount.compute(mode.toString().toLowerCase(Locale.ENGLISH), (k, v) -> v == null ? 1 : v + 1); |
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.
Is it possible to account for indices with _source.mode specified twice?
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.
Here we iterate over all unique MappingMetadata instances, so I don't think we see same mappings multiple times? So I don't we account same indices multiple times in mappingSourceModeUsageCount? We can under account, when mappings are identical between indices.
If both index.mappings.source.mode index setting and _source.mode mapping attribute is used then this change picks either the source mode stats or index mode stats.
I'm also ok with just accounting source mode from index.mappings.source.mode index setting, since _source.mode is on its way out and only tech preview synthetic source usages are configured that way. Maybe account _source.mode usages is not worth the complexity?
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.
Maybe account _source.mode usages is not worth the complexity?
++
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.
🚢 Thanks Martijn!
| AnalysisStats.countMapping(mappingCounts, indexMetadata); | ||
|
|
||
| var sourceMode = SourceFieldMapper.INDEX_MAPPER_SOURCE_MODE_SETTING.get(indexMetadata.getSettings()); | ||
| sourceModeUsageCount.compute(sourceMode.toString().toLowerCase(Locale.ENGLISH), (k, v) -> v == null ? 1 : v + 1); |
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: maybe use map.merge() instead.
|
The 8.15.6 bwc ci job failed with the following transient failure: The other 19 bwc ci jobs completed successfully Ignoring this. Ignoring this failure. |
💔 Backport failed
You can use sqren/backport to manually backport by running |
Backporting #117463 to 8.x branch.
* Add source mode stats to MappingStats (#117463) * update bwc logic for 8.17
No description provided.