Skip to content

Commit

Permalink
Remove BWC layer for number of reduce phases
Browse files Browse the repository at this point in the history
Both PRs below have been backported to 5.4 such that we can enable
BWC tests of this feature as well as remove version dependend serialization
for search request / responses.

Relates to elastic#23288
Relates to elastic#23253
  • Loading branch information
s1monw committed Feb 22, 2017
1 parent 148be11 commit 7d7a318
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.elasticsearch.action.search;

import org.elasticsearch.Version;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest;
Expand Down Expand Up @@ -342,9 +341,7 @@ public void readFrom(StreamInput in) throws IOException {
types = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
requestCache = in.readOptionalBoolean();
if (in.getVersion().onOrAfter(Version.V_6_0_0_alpha1_UNRELEASED)) {
batchedReduceSize = in.readVInt();
}
batchedReduceSize = in.readVInt();
}

@Override
Expand All @@ -362,9 +359,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeStringArray(types);
indicesOptions.writeIndicesOptions(out);
out.writeOptionalBoolean(requestCache);
if (out.getVersion().onOrAfter(Version.V_6_0_0_alpha1_UNRELEASED)) {
out.writeVInt(batchedReduceSize);
}
out.writeVInt(batchedReduceSize);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.elasticsearch.search.internal;

import org.elasticsearch.Version;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Streamable;
Expand Down Expand Up @@ -144,11 +143,7 @@ public void readFrom(StreamInput in) throws IOException {
timedOut = in.readBoolean();
terminatedEarly = in.readOptionalBoolean();
profileResults = in.readOptionalWriteable(SearchProfileShardResults::new);
if (in.getVersion().onOrAfter(Version.V_6_0_0_alpha1_UNRELEASED)) {
numReducePhases = in.readVInt();
} else {
numReducePhases = 1;
}
numReducePhases = in.readVInt();
}

@Override
Expand All @@ -169,8 +164,6 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(timedOut);
out.writeOptionalBoolean(terminatedEarly);
out.writeOptionalWriteable(profileResults);
if (out.getVersion().onOrAfter(Version.V_6_0_0_alpha1_UNRELEASED)) {
out.writeVInt(numReducePhases);
}
out.writeVInt(numReducePhases);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ setup:
---
"batched_reduce_size lower limit":
- skip:
version: " - 5.99.99"
reason: this was added in 6.0.0
version: " - 5.3.99"
reason: this was added in 5.4.0
- do:
catch: /batchedReduceSize must be >= 2/
search:
Expand All @@ -27,8 +27,8 @@ setup:
---
"batched_reduce_size 2 with 5 shards":
- skip:
version: " - 5.99.99"
reason: this was added in 6.0.0
version: " - 5.3.99"
reason: this was added in 5.4.0
- do:
index:
index: test_1
Expand Down

0 comments on commit 7d7a318

Please sign in to comment.