Skip to content
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

[Backport 2.x] [Refactor] XContentFactory contentType introspection to MediaTypeRegistry (#8826) #9050

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

nknize
Copy link
Collaborator

@nknize nknize commented Aug 1, 2023

Backport 36c37ac from #8826.

…erRegistry (opensearch-project#8826)

XContentFactory is tightly coupled to concrete XContentType. This commit
builds on the MediaType abstractions, specifically
MediaTypeParserRegistry, to decouple contentType introspection (e.g.,
determining type from byte streams) from concrete XContentTypes. This
enables downstream extensions (e.g., serverless or cloud native
implementations) to register their own custom XContentType and define
the serialization format for proper content introspection. This also
removes the tight coupling of :libs:opensearch-x-content with abstract
interface contracts further enabling modularity.

Signed-off-by: Nicholas Walter Knize <[email protected]>
(cherry picked from commit 36c37ac)
@nknize nknize added enhancement Enhancement or improvement to existing feature or request backport PRs or issues specific to backporting features or enhancments skip-changelog v2.10.0 labels Aug 1, 2023
@nknize nknize changed the title [Backport 2.x] [Refactor] XContentFactory contentType introspection to MediaTypeParserRegistry (#8826) [Backport 2.x] [Refactor] XContentFactory contentType introspection to MediaTypeRegistry (#8826) Aug 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      2 org.opensearch.search.SearchWeightedRoutingIT.testStrictWeightedRoutingWithCustomString

@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Merging #9050 (410ac63) into 2.x (2d67a53) will increase coverage by 0.04%.
The diff coverage is 71.50%.

@@             Coverage Diff              @@
##                2.x    #9050      +/-   ##
============================================
+ Coverage     70.80%   70.84%   +0.04%     
+ Complexity    57422    57420       -2     
============================================
  Files          4749     4749              
  Lines        271380   271376       -4     
  Branches      40048    40051       +3     
============================================
+ Hits         192156   192263     +107     
+ Misses        62735    62615     -120     
- Partials      16489    16498       +9     
Files Changed Coverage Δ
...n/java/org/opensearch/core/xcontent/MediaType.java 100.00% <ø> (ø)
...script/mustache/TransportSearchTemplateAction.java 0.00% <0.00%> (ø)
.../index/reindex/AbstractBulkByQueryRestHandler.java 8.57% <0.00%> (ø)
...nsearch/action/termvectors/TermVectorsRequest.java 67.97% <0.00%> (+1.42%) ⬆️
...in/java/org/opensearch/indices/IndicesService.java 70.15% <0.00%> (+0.60%) ⬆️
server/src/main/java/org/opensearch/node/Node.java 86.06% <ø> (ø)
...nsearch/search/suggest/phrase/PhraseSuggester.java 3.89% <0.00%> (-0.06%) ⬇️
.../java/org/opensearch/tasks/TaskResultsService.java 9.45% <0.00%> (ø)
.../opensearch/common/compress/CompressorFactory.java 66.66% <33.33%> (+9.52%) ⬆️
...java/org/opensearch/index/get/ShardGetService.java 60.25% <33.33%> (ø)
... and 35 more

... and 474 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport PRs or issues specific to backporting features or enhancments enhancement Enhancement or improvement to existing feature or request skip-changelog v2.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants