Skip to content

Commit

Permalink
Change serialization version of doc-value fields.
Browse files Browse the repository at this point in the history
Relates #29639
  • Loading branch information
jpountz committed May 23, 2018
1 parent fcd54cd commit 405eb7a
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ setup:
"Nested doc version and seqIDs":

- skip:
version: " - 6.99.99" # TODO change to 6.3.99 on backport
version: " - 6.3.99"
reason: "object notation for docvalue_fields was introduced in 6.4"

- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ setup:
---
"docvalue_fields":
- skip:
version: " - 6.99.99" # TODO: change version on backport
version: " - 6.3.99"
reason: format option was added in 6.4
features: warnings
- do:
Expand All @@ -148,7 +148,7 @@ setup:
---
"docvalue_fields as url param":
- skip:
version: " - 6.99.99" # TODO: change version on backport
version: " - 6.3.99"
reason: format option was added in 6.4
features: warnings
- do:
Expand All @@ -161,7 +161,7 @@ setup:
---
"docvalue_fields with default format":
- skip:
version: " - 6.99.99" # TODO: change version on backport
version: " - 6.3.99"
reason: format option was added in 6.4
- do:
search:
Expand All @@ -174,7 +174,7 @@ setup:
---
"docvalue_fields with explicit format":
- skip:
version: " - 6.99.99" # TODO: change version on backport
version: " - 6.3.99"
reason: format option was added in 6.4
- do:
search:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ setup:
"Docvalues_fields size limit":

- skip:
version: " - 6.99.99" # TODO: change to 6.3.99 on backport
version: " - 6.3.99"
reason: "The object notation for docvalue_fields is only supported on 6.4+"
- do:
catch: /Trying to retrieve too many docvalue_fields\. Must be less than or equal to[:] \[2\] but was \[3\]\. This limit can be set by changing the \[index.max_docvalue_fields_search\] index level setting\./
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public InnerHitBuilder(StreamInput in) throws IOException {
version = in.readBoolean();
trackScores = in.readBoolean();
storedFieldsContext = in.readOptionalWriteable(StoredFieldsContext::new);
if (in.getVersion().before(Version.V_7_0_0_alpha1)) { // TODO: change to 6.4.0 after backport
if (in.getVersion().before(Version.V_6_4_0)) {
List<String> fieldList = (List<String>) in.readGenericValue();
if (fieldList == null) {
docValueFields = null;
Expand Down Expand Up @@ -188,7 +188,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(version);
out.writeBoolean(trackScores);
out.writeOptionalWriteable(storedFieldsContext);
if (out.getVersion().before(Version.V_7_0_0_alpha1)) { // TODO: change to 6.4.0 after backport
if (out.getVersion().before(Version.V_6_4_0)) {
out.writeGenericValue(docValueFields == null
? null
: docValueFields.stream().map(ff -> ff.field).collect(Collectors.toList()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public SearchSourceBuilder(StreamInput in) throws IOException {
aggregations = in.readOptionalWriteable(AggregatorFactories.Builder::new);
explain = in.readOptionalBoolean();
fetchSourceContext = in.readOptionalWriteable(FetchSourceContext::new);
if (in.getVersion().before(Version.V_7_0_0_alpha1)) { // TODO: change to 6.4.0 after backport
if (in.getVersion().before(Version.V_6_4_0)) {
List<String> dvFields = (List<String>) in.readGenericValue();
if (dvFields == null) {
docValueFields = null;
Expand Down Expand Up @@ -263,7 +263,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalWriteable(aggregations);
out.writeOptionalBoolean(explain);
out.writeOptionalWriteable(fetchSourceContext);
if (out.getVersion().before(Version.V_7_0_0_alpha1)) { // TODO: change to 6.4.0 after backport
if (out.getVersion().before(Version.V_6_4_0)) {
out.writeGenericValue(docValueFields == null
? null
: docValueFields.stream().map(ff -> ff.field).collect(Collectors.toList()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public FieldAndFormat(String field, @Nullable String format) {
/** Serialization constructor. */
public FieldAndFormat(StreamInput in) throws IOException {
this.field = in.readString();
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { // TODO: change to 6.4.0 after backport
if (in.getVersion().onOrAfter(Version.V_6_4_0)) {
format = in.readOptionalString();
} else {
format = null;
Expand All @@ -90,7 +90,7 @@ public FieldAndFormat(StreamInput in) throws IOException {
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeString(field);
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { // TODO: change to 6.4.0 after backport
if (out.getVersion().onOrAfter(Version.V_6_4_0)) {
out.writeOptionalString(format);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
"Translate SQL":
- skip:
version: " - 6.99.99" # TODO: change version on backport
version: " - 6.3.99"
reason: format option was added in 6.4
features: warnings

Expand Down

0 comments on commit 405eb7a

Please sign in to comment.