Skip to content

Commit

Permalink
Adapt bwc serialization in FieldSortBuilder (#40095)
Browse files Browse the repository at this point in the history
This change adapts the bwc version check for the new numeric_type option of the FieldSortBuilder.
Since this change needs to be backported to 7x, all bwc tests are temporary disabled
until #40084 is merged.

Relates #38095
  • Loading branch information
jimczi authored Mar 18, 2019
1 parent 1bc2b77 commit 4872983
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ task verifyVersions {
* after the backport of the backcompat code is complete.
*/

boolean bwc_tests_enabled = true
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
boolean bwc_tests_enabled = false
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/40084" /* place a PR link here when committing bwc changes */
if (bwc_tests_enabled == false) {
if (bwc_tests_disabled_issue.isEmpty()) {
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public FieldSortBuilder(StreamInput in) throws IOException {
sortMode = in.readOptionalWriteable(SortMode::readFromStream);
unmappedType = in.readOptionalString();
nestedSort = in.readOptionalWriteable(NestedSortBuilder::new);
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
if (in.getVersion().onOrAfter(Version.V_7_1_0)) {
numericType = in.readOptionalString();
}
}
Expand All @@ -143,7 +143,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalWriteable(sortMode);
out.writeOptionalString(unmappedType);
out.writeOptionalWriteable(nestedSort);
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_1_0)) {
out.writeOptionalString(numericType);
}
}
Expand Down

0 comments on commit 4872983

Please sign in to comment.