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

Remove BytesArray and BytesReference usage from XContentFactory #29151

Merged
merged 2 commits into from
Mar 20, 2018

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Mar 19, 2018

This removes the usage of BytesArray and BytesReference from
XContentFactory. Instead, a regular byte[] should be passed. To assist with
this a helper has been added to XContentHelper that will preserve the offset
and length from the underlying BytesReference.

This is part of ongoing work to separate the XContent parts from ES so they can
be factored into their own jar.

Relates to #28504

This removes the usage of `BytesArray` and `BytesReference` from
`XContentFactory`. Instead, a regular `byte[]` should be passed. To assist with
this a helper has been added to `XContentHelper` that will preserve the offset
and length from the underlying BytesReference.

This is part of ongoing work to separate the XContent parts from ES so they can
be factored into their own jar.

Relates to elastic#28504
@dakrone dakrone added >non-issue :Core/Infra/Core Core issues without another label v7.0.0 v6.3.0 labels Mar 19, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@@ -436,4 +437,10 @@ public static BytesReference toXContent(ToXContent toXContent, XContentType xCon
return BytesReference.bytes(builder);
}
}

@Deprecated
public static XContentType xContentType(BytesReference bytes) {
Copy link
Member

Choose a reason for hiding this comment

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

Probably deserves javadoc too.

@dakrone dakrone merged commit b4af451 into elastic:master Mar 20, 2018
dakrone added a commit that referenced this pull request Mar 20, 2018
* Remove BytesArray and BytesReference usage from XContentFactory

This removes the usage of `BytesArray` and `BytesReference` from
`XContentFactory`. Instead, a regular `byte[]` should be passed. To assist with
this a helper has been added to `XContentHelper` that will preserve the offset
and length from the underlying BytesReference.

This is part of ongoing work to separate the XContent parts from ES so they can
be factored into their own jar.

Relates to #28504
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Mar 21, 2018
* master:
  [Docs] Update api.asciidoc (elastic#29166)
  Docs: Add note about missing mapping for doc values field (elastic#29036)
  Fix BWC issue for PreSyncedFlushResponse
  Remove BytesArray and BytesReference usage from XContentFactory (elastic#29151)
  Add pluggable XContentBuilder writers and human readable writers (elastic#29120)
  Add unreleased version 6.2.4 (elastic#29171)
  Add unreleased version 6.1.5 (elastic#29168)
  Add a note about using the `retry_failed` flag before accepting data loss (elastic#29160)
  Fix typo in percolate-query.asciidoc (elastic#29155)
  Require HTTP::Tiny 0.070 for release notes script
martijnvg added a commit that referenced this pull request Mar 21, 2018
* es/master: (50 commits)
  Reject updates to the `_default_` mapping. (#29165)
  Improve similarity docs. (#29089)
  [Docs] Update api.asciidoc (#29166)
  Docs: Add note about missing mapping for doc values field (#29036)
  Fix BWC issue for PreSyncedFlushResponse
  Remove BytesArray and BytesReference usage from XContentFactory (#29151)
  Add pluggable XContentBuilder writers and human readable writers (#29120)
  Add unreleased version 6.2.4 (#29171)
  Add unreleased version 6.1.5 (#29168)
  Add a note about using the `retry_failed` flag before accepting data loss (#29160)
  Fix typo in percolate-query.asciidoc (#29155)
  Require HTTP::Tiny 0.070 for release notes script
  Set Java 9 checkstyle to depend on checkstyle conf (#28383)
  REST high-level client: add clear cache API (#28866)
  Docs: Add example of resetting index setting (#29048)
  Plugins: Fix module name conflict check for meta plugins (#29146)
  Build: Fix meta plugin bundled plugin names (#29147)
  Build: Simplify rest spec hack configuration (#29149)
  Build: Fix meta modules to not install as plugin in tests (#29150)
  Fix javadoc warning in Strings for missing parameter description
  ...
martijnvg added a commit that referenced this pull request Mar 21, 2018
* es/6.x: (46 commits)
  Docs: Add note about missing mapping for doc values field (#29036)
  [DOCS] Removed 6.1.4, 6.2.2, and 6.2.3 coming tags
  Remove BytesArray and BytesReference usage from XContentFactory (#29151)
  Fix BWC issue for PreSyncedFlushResponse
  Add pluggable XContentBuilder writers and human readable writers (#29120)
  Add unreleased version 6.2.4 (#29171)
  Add unreleased version 6.1.5 (#29168)
  Add a note about using the `retry_failed` flag before accepting data loss (#29160)
  Fix typo in percolate-query.asciidoc (#29155)
  Add release notes for 6.1.4 and 6.2.3
  Require HTTP::Tiny 0.070 for release notes script
  REST high-level client: add clear cache API (#28866)
  Relax remote check for bwc project checkouts (#28666)
  Set Java 9 checkstyle to depend on checkstyle conf (#28383)
  Docs: Add example of resetting index setting (#29048)
  Plugins: Fix module name conflict check for meta plugins (#29146)
  Build: Fix meta plugin bundled plugin names (#29147)
  Build: Simplify rest spec hack configuration (#29149)
  CLI: Close subcommands in MultiCommand (#28954)
  Build: Fix meta modules to not install as plugin in tests (#29150)
  ...
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Mar 27, 2018
* master:
  Fix BWC issue for PreSyncedFlushResponse
  Remove BytesArray and BytesReference usage from XContentFactory (elastic#29151)
  Add pluggable XContentBuilder writers and human readable writers (elastic#29120)
  Add unreleased version 6.2.4 (elastic#29171)
  Add unreleased version 6.1.5 (elastic#29168)
  Add a note about using the `retry_failed` flag before accepting data loss (elastic#29160)
  Fix typo in percolate-query.asciidoc (elastic#29155)
  Require HTTP::Tiny 0.070 for release notes script
@dakrone dakrone deleted the remove-ba-xcontentfactory branch April 19, 2018 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants