Add version 5.1.1
This commit removes the version constant for 5.1.0 (due to an inadvertent release) and adds the version constant for 5.1.1. Relates #21890
This commit is contained in:
parent
f5ac27a20d
commit
6c45695d52
|
@ -719,7 +719,7 @@ public class ElasticsearchException extends RuntimeException implements ToXConte
|
||||||
STATUS_EXCEPTION(org.elasticsearch.ElasticsearchStatusException.class, org.elasticsearch.ElasticsearchStatusException::new, 145,
|
STATUS_EXCEPTION(org.elasticsearch.ElasticsearchStatusException.class, org.elasticsearch.ElasticsearchStatusException::new, 145,
|
||||||
UNKNOWN_VERSION_ADDED),
|
UNKNOWN_VERSION_ADDED),
|
||||||
TASK_CANCELLED_EXCEPTION(org.elasticsearch.tasks.TaskCancelledException.class,
|
TASK_CANCELLED_EXCEPTION(org.elasticsearch.tasks.TaskCancelledException.class,
|
||||||
org.elasticsearch.tasks.TaskCancelledException::new, 146, Version.V_5_1_0_UNRELEASED),
|
org.elasticsearch.tasks.TaskCancelledException::new, 146, Version.V_5_1_1_UNRELEASED),
|
||||||
SHARD_LOCK_OBTAIN_FAILED_EXCEPTION(org.elasticsearch.env.ShardLockObtainFailedException.class,
|
SHARD_LOCK_OBTAIN_FAILED_EXCEPTION(org.elasticsearch.env.ShardLockObtainFailedException.class,
|
||||||
org.elasticsearch.env.ShardLockObtainFailedException::new, 147, Version.V_5_0_2);
|
org.elasticsearch.env.ShardLockObtainFailedException::new, 147, Version.V_5_0_2);
|
||||||
|
|
||||||
|
|
|
@ -99,8 +99,9 @@ public class Version {
|
||||||
public static final Version V_5_0_2 = new Version(V_5_0_2_ID, org.apache.lucene.util.Version.LUCENE_6_2_1);
|
public static final Version V_5_0_2 = new Version(V_5_0_2_ID, org.apache.lucene.util.Version.LUCENE_6_2_1);
|
||||||
public static final int V_5_0_3_ID_UNRELEASED = 5000399;
|
public static final int V_5_0_3_ID_UNRELEASED = 5000399;
|
||||||
public static final Version V_5_0_3_UNRELEASED = new Version(V_5_0_3_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_3_0);
|
public static final Version V_5_0_3_UNRELEASED = new Version(V_5_0_3_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_3_0);
|
||||||
public static final int V_5_1_0_ID_UNRELEASED = 5010099;
|
// no version constant for 5.1.0 due to inadvertent release
|
||||||
public static final Version V_5_1_0_UNRELEASED = new Version(V_5_1_0_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_3_0);
|
public static final int V_5_1_1_ID_UNRELEASED = 5010199;
|
||||||
|
public static final Version V_5_1_1_UNRELEASED = new Version(V_5_1_1_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_3_0);
|
||||||
public static final int V_5_2_0_ID_UNRELEASED = 5020099;
|
public static final int V_5_2_0_ID_UNRELEASED = 5020099;
|
||||||
public static final Version V_5_2_0_UNRELEASED = new Version(V_5_2_0_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_3_0);
|
public static final Version V_5_2_0_UNRELEASED = new Version(V_5_2_0_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_3_0);
|
||||||
public static final int V_6_0_0_alpha1_ID_UNRELEASED = 6000001;
|
public static final int V_6_0_0_alpha1_ID_UNRELEASED = 6000001;
|
||||||
|
@ -125,8 +126,8 @@ public class Version {
|
||||||
return V_6_0_0_alpha1_UNRELEASED;
|
return V_6_0_0_alpha1_UNRELEASED;
|
||||||
case V_5_2_0_ID_UNRELEASED:
|
case V_5_2_0_ID_UNRELEASED:
|
||||||
return V_5_2_0_UNRELEASED;
|
return V_5_2_0_UNRELEASED;
|
||||||
case V_5_1_0_ID_UNRELEASED:
|
case V_5_1_1_ID_UNRELEASED:
|
||||||
return V_5_1_0_UNRELEASED;
|
return V_5_1_1_UNRELEASED;
|
||||||
case V_5_0_3_ID_UNRELEASED:
|
case V_5_0_3_ID_UNRELEASED:
|
||||||
return V_5_0_3_UNRELEASED;
|
return V_5_0_3_UNRELEASED;
|
||||||
case V_5_0_2_ID:
|
case V_5_0_2_ID:
|
||||||
|
|
|
@ -134,7 +134,7 @@ public class ClusterSearchShardsRequest extends MasterNodeReadRequest<ClusterSea
|
||||||
routing = in.readOptionalString();
|
routing = in.readOptionalString();
|
||||||
preference = in.readOptionalString();
|
preference = in.readOptionalString();
|
||||||
|
|
||||||
if (in.getVersion().onOrBefore(Version.V_5_1_0_UNRELEASED)) {
|
if (in.getVersion().onOrBefore(Version.V_5_1_1_UNRELEASED)) {
|
||||||
//types
|
//types
|
||||||
in.readStringArray();
|
in.readStringArray();
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ public class ClusterSearchShardsRequest extends MasterNodeReadRequest<ClusterSea
|
||||||
out.writeOptionalString(routing);
|
out.writeOptionalString(routing);
|
||||||
out.writeOptionalString(preference);
|
out.writeOptionalString(preference);
|
||||||
|
|
||||||
if (out.getVersion().onOrBefore(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().onOrBefore(Version.V_5_1_1_UNRELEASED)) {
|
||||||
//types
|
//types
|
||||||
out.writeStringArray(Strings.EMPTY_ARRAY);
|
out.writeStringArray(Strings.EMPTY_ARRAY);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class ClusterSearchShardsResponse extends ActionResponse implements ToXCo
|
||||||
for (int i = 0; i < nodes.length; i++) {
|
for (int i = 0; i < nodes.length; i++) {
|
||||||
nodes[i] = new DiscoveryNode(in);
|
nodes[i] = new DiscoveryNode(in);
|
||||||
}
|
}
|
||||||
if (in.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (in.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
int size = in.readVInt();
|
int size = in.readVInt();
|
||||||
indicesAndFilters = new HashMap<>();
|
indicesAndFilters = new HashMap<>();
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
|
@ -93,7 +93,7 @@ public class ClusterSearchShardsResponse extends ActionResponse implements ToXCo
|
||||||
for (DiscoveryNode node : nodes) {
|
for (DiscoveryNode node : nodes) {
|
||||||
node.writeTo(out);
|
node.writeTo(out);
|
||||||
}
|
}
|
||||||
if (out.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
out.writeVInt(indicesAndFilters.size());
|
out.writeVInt(indicesAndFilters.size());
|
||||||
for (Map.Entry<String, AliasFilter> entry : indicesAndFilters.entrySet()) {
|
for (Map.Entry<String, AliasFilter> entry : indicesAndFilters.entrySet()) {
|
||||||
out.writeString(entry.getKey());
|
out.writeString(entry.getKey());
|
||||||
|
|
|
@ -214,11 +214,11 @@ public class QueryStringQueryBuilder extends AbstractQueryBuilder<QueryStringQue
|
||||||
autoGeneratePhraseQueries = in.readBoolean();
|
autoGeneratePhraseQueries = in.readBoolean();
|
||||||
allowLeadingWildcard = in.readOptionalBoolean();
|
allowLeadingWildcard = in.readOptionalBoolean();
|
||||||
analyzeWildcard = in.readOptionalBoolean();
|
analyzeWildcard = in.readOptionalBoolean();
|
||||||
if (in.getVersion().before(Version.V_5_1_0_UNRELEASED)) {
|
if (in.getVersion().before(Version.V_5_1_1_UNRELEASED)) {
|
||||||
in.readBoolean(); // lowercase_expanded_terms
|
in.readBoolean(); // lowercase_expanded_terms
|
||||||
}
|
}
|
||||||
enablePositionIncrements = in.readBoolean();
|
enablePositionIncrements = in.readBoolean();
|
||||||
if (in.getVersion().before(Version.V_5_1_0_UNRELEASED)) {
|
if (in.getVersion().before(Version.V_5_1_1_UNRELEASED)) {
|
||||||
in.readString(); // locale
|
in.readString(); // locale
|
||||||
}
|
}
|
||||||
fuzziness = new Fuzziness(in);
|
fuzziness = new Fuzziness(in);
|
||||||
|
@ -234,7 +234,7 @@ public class QueryStringQueryBuilder extends AbstractQueryBuilder<QueryStringQue
|
||||||
timeZone = in.readOptionalTimeZone();
|
timeZone = in.readOptionalTimeZone();
|
||||||
escape = in.readBoolean();
|
escape = in.readBoolean();
|
||||||
maxDeterminizedStates = in.readVInt();
|
maxDeterminizedStates = in.readVInt();
|
||||||
if (in.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (in.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
splitOnWhitespace = in.readBoolean();
|
splitOnWhitespace = in.readBoolean();
|
||||||
useAllFields = in.readOptionalBoolean();
|
useAllFields = in.readOptionalBoolean();
|
||||||
} else {
|
} else {
|
||||||
|
@ -258,11 +258,11 @@ public class QueryStringQueryBuilder extends AbstractQueryBuilder<QueryStringQue
|
||||||
out.writeBoolean(this.autoGeneratePhraseQueries);
|
out.writeBoolean(this.autoGeneratePhraseQueries);
|
||||||
out.writeOptionalBoolean(this.allowLeadingWildcard);
|
out.writeOptionalBoolean(this.allowLeadingWildcard);
|
||||||
out.writeOptionalBoolean(this.analyzeWildcard);
|
out.writeOptionalBoolean(this.analyzeWildcard);
|
||||||
if (out.getVersion().before(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().before(Version.V_5_1_1_UNRELEASED)) {
|
||||||
out.writeBoolean(true); // lowercase_expanded_terms
|
out.writeBoolean(true); // lowercase_expanded_terms
|
||||||
}
|
}
|
||||||
out.writeBoolean(this.enablePositionIncrements);
|
out.writeBoolean(this.enablePositionIncrements);
|
||||||
if (out.getVersion().before(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().before(Version.V_5_1_1_UNRELEASED)) {
|
||||||
out.writeString(Locale.ROOT.toLanguageTag()); // locale
|
out.writeString(Locale.ROOT.toLanguageTag()); // locale
|
||||||
}
|
}
|
||||||
this.fuzziness.writeTo(out);
|
this.fuzziness.writeTo(out);
|
||||||
|
@ -278,7 +278,7 @@ public class QueryStringQueryBuilder extends AbstractQueryBuilder<QueryStringQue
|
||||||
out.writeOptionalTimeZone(timeZone);
|
out.writeOptionalTimeZone(timeZone);
|
||||||
out.writeBoolean(this.escape);
|
out.writeBoolean(this.escape);
|
||||||
out.writeVInt(this.maxDeterminizedStates);
|
out.writeVInt(this.maxDeterminizedStates);
|
||||||
if (out.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
out.writeBoolean(this.splitOnWhitespace);
|
out.writeBoolean(this.splitOnWhitespace);
|
||||||
out.writeOptionalBoolean(this.useAllFields);
|
out.writeOptionalBoolean(this.useAllFields);
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,19 +159,19 @@ public class SimpleQueryStringBuilder extends AbstractQueryBuilder<SimpleQuerySt
|
||||||
flags = in.readInt();
|
flags = in.readInt();
|
||||||
analyzer = in.readOptionalString();
|
analyzer = in.readOptionalString();
|
||||||
defaultOperator = Operator.readFromStream(in);
|
defaultOperator = Operator.readFromStream(in);
|
||||||
if (in.getVersion().before(Version.V_5_1_0_UNRELEASED)) {
|
if (in.getVersion().before(Version.V_5_1_1_UNRELEASED)) {
|
||||||
in.readBoolean(); // lowercase_expanded_terms
|
in.readBoolean(); // lowercase_expanded_terms
|
||||||
}
|
}
|
||||||
settings.lenient(in.readBoolean());
|
settings.lenient(in.readBoolean());
|
||||||
if (in.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (in.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
this.lenientSet = in.readBoolean();
|
this.lenientSet = in.readBoolean();
|
||||||
}
|
}
|
||||||
settings.analyzeWildcard(in.readBoolean());
|
settings.analyzeWildcard(in.readBoolean());
|
||||||
if (in.getVersion().before(Version.V_5_1_0_UNRELEASED)) {
|
if (in.getVersion().before(Version.V_5_1_1_UNRELEASED)) {
|
||||||
in.readString(); // locale
|
in.readString(); // locale
|
||||||
}
|
}
|
||||||
minimumShouldMatch = in.readOptionalString();
|
minimumShouldMatch = in.readOptionalString();
|
||||||
if (in.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (in.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
settings.quoteFieldSuffix(in.readOptionalString());
|
settings.quoteFieldSuffix(in.readOptionalString());
|
||||||
useAllFields = in.readOptionalBoolean();
|
useAllFields = in.readOptionalBoolean();
|
||||||
}
|
}
|
||||||
|
@ -188,19 +188,19 @@ public class SimpleQueryStringBuilder extends AbstractQueryBuilder<SimpleQuerySt
|
||||||
out.writeInt(flags);
|
out.writeInt(flags);
|
||||||
out.writeOptionalString(analyzer);
|
out.writeOptionalString(analyzer);
|
||||||
defaultOperator.writeTo(out);
|
defaultOperator.writeTo(out);
|
||||||
if (out.getVersion().before(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().before(Version.V_5_1_1_UNRELEASED)) {
|
||||||
out.writeBoolean(true); // lowercase_expanded_terms
|
out.writeBoolean(true); // lowercase_expanded_terms
|
||||||
}
|
}
|
||||||
out.writeBoolean(settings.lenient());
|
out.writeBoolean(settings.lenient());
|
||||||
if (out.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
out.writeBoolean(lenientSet);
|
out.writeBoolean(lenientSet);
|
||||||
}
|
}
|
||||||
out.writeBoolean(settings.analyzeWildcard());
|
out.writeBoolean(settings.analyzeWildcard());
|
||||||
if (out.getVersion().before(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().before(Version.V_5_1_1_UNRELEASED)) {
|
||||||
out.writeString(Locale.ROOT.toLanguageTag()); // locale
|
out.writeString(Locale.ROOT.toLanguageTag()); // locale
|
||||||
}
|
}
|
||||||
out.writeOptionalString(minimumShouldMatch);
|
out.writeOptionalString(minimumShouldMatch);
|
||||||
if (out.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
out.writeOptionalString(settings.quoteFieldSuffix());
|
out.writeOptionalString(settings.quoteFieldSuffix());
|
||||||
out.writeOptionalBoolean(useAllFields);
|
out.writeOptionalBoolean(useAllFields);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class OsStats implements Writeable, ToXContent {
|
||||||
this.cpu = new Cpu(in);
|
this.cpu = new Cpu(in);
|
||||||
this.mem = new Mem(in);
|
this.mem = new Mem(in);
|
||||||
this.swap = new Swap(in);
|
this.swap = new Swap(in);
|
||||||
if (in.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (in.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
this.cgroup = in.readOptionalWriteable(Cgroup::new);
|
this.cgroup = in.readOptionalWriteable(Cgroup::new);
|
||||||
} else {
|
} else {
|
||||||
this.cgroup = null;
|
this.cgroup = null;
|
||||||
|
@ -65,7 +65,7 @@ public class OsStats implements Writeable, ToXContent {
|
||||||
cpu.writeTo(out);
|
cpu.writeTo(out);
|
||||||
mem.writeTo(out);
|
mem.writeTo(out);
|
||||||
swap.writeTo(out);
|
swap.writeTo(out);
|
||||||
if (out.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
out.writeOptionalWriteable(cgroup);
|
out.writeOptionalWriteable(cgroup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -377,7 +377,7 @@ public final class Script implements ToXContent, Writeable {
|
||||||
// Version 5.1+ requires all Script members to be non-null and supports the potential
|
// Version 5.1+ requires all Script members to be non-null and supports the potential
|
||||||
// for more options than just XContentType. Reorders the read in contents to be in
|
// for more options than just XContentType. Reorders the read in contents to be in
|
||||||
// same order as the constructor.
|
// same order as the constructor.
|
||||||
if (in.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (in.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
this.type = ScriptType.readFrom(in);
|
this.type = ScriptType.readFrom(in);
|
||||||
this.lang = in.readString();
|
this.lang = in.readString();
|
||||||
this.idOrCode = in.readString();
|
this.idOrCode = in.readString();
|
||||||
|
@ -429,7 +429,7 @@ public final class Script implements ToXContent, Writeable {
|
||||||
// Version 5.1+ requires all Script members to be non-null and supports the potential
|
// Version 5.1+ requires all Script members to be non-null and supports the potential
|
||||||
// for more options than just XContentType. Reorders the written out contents to be in
|
// for more options than just XContentType. Reorders the written out contents to be in
|
||||||
// same order as the constructor.
|
// same order as the constructor.
|
||||||
if (out.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
type.writeTo(out);
|
type.writeTo(out);
|
||||||
out.writeString(lang);
|
out.writeString(lang);
|
||||||
out.writeString(idOrCode);
|
out.writeString(idOrCode);
|
||||||
|
|
|
@ -49,7 +49,7 @@ public final class AliasFilter implements Writeable {
|
||||||
|
|
||||||
public AliasFilter(StreamInput input) throws IOException {
|
public AliasFilter(StreamInput input) throws IOException {
|
||||||
aliases = input.readStringArray();
|
aliases = input.readStringArray();
|
||||||
if (input.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (input.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
filter = input.readOptionalNamedWriteable(QueryBuilder.class);
|
filter = input.readOptionalNamedWriteable(QueryBuilder.class);
|
||||||
reparseAliases = false;
|
reparseAliases = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -78,7 +78,7 @@ public final class AliasFilter implements Writeable {
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
out.writeStringArray(aliases);
|
out.writeStringArray(aliases);
|
||||||
if (out.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
out.writeOptionalNamedWriteable(filter);
|
out.writeOptionalNamedWriteable(filter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class ClusterSearchShardsResponseTests extends ESTestCase {
|
||||||
assertEquals(clusterSearchShardsGroup.getShardId(), deserializedGroup.getShardId());
|
assertEquals(clusterSearchShardsGroup.getShardId(), deserializedGroup.getShardId());
|
||||||
assertArrayEquals(clusterSearchShardsGroup.getShards(), deserializedGroup.getShards());
|
assertArrayEquals(clusterSearchShardsGroup.getShards(), deserializedGroup.getShards());
|
||||||
}
|
}
|
||||||
if (version.onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (version.onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
assertEquals(clusterSearchShardsResponse.getIndicesAndFilters(), deserialized.getIndicesAndFilters());
|
assertEquals(clusterSearchShardsResponse.getIndicesAndFilters(), deserialized.getIndicesAndFilters());
|
||||||
} else {
|
} else {
|
||||||
assertNull(deserialized.getIndicesAndFilters());
|
assertNull(deserialized.getIndicesAndFilters());
|
||||||
|
|
|
@ -402,7 +402,7 @@ public abstract class AbstractBulkByScrollRequest<Self extends AbstractBulkByScr
|
||||||
retryBackoffInitialTime = new TimeValue(in);
|
retryBackoffInitialTime = new TimeValue(in);
|
||||||
maxRetries = in.readVInt();
|
maxRetries = in.readVInt();
|
||||||
requestsPerSecond = in.readFloat();
|
requestsPerSecond = in.readFloat();
|
||||||
if (in.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (in.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
slices = in.readVInt();
|
slices = in.readVInt();
|
||||||
} else {
|
} else {
|
||||||
slices = 1;
|
slices = 1;
|
||||||
|
@ -421,12 +421,12 @@ public abstract class AbstractBulkByScrollRequest<Self extends AbstractBulkByScr
|
||||||
retryBackoffInitialTime.writeTo(out);
|
retryBackoffInitialTime.writeTo(out);
|
||||||
out.writeVInt(maxRetries);
|
out.writeVInt(maxRetries);
|
||||||
out.writeFloat(requestsPerSecond);
|
out.writeFloat(requestsPerSecond);
|
||||||
if (out.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
out.writeVInt(slices);
|
out.writeVInt(slices);
|
||||||
} else {
|
} else {
|
||||||
if (slices > 1) {
|
if (slices > 1) {
|
||||||
throw new IllegalArgumentException("Attempting to send sliced reindex-style request to a node that doesn't support "
|
throw new IllegalArgumentException("Attempting to send sliced reindex-style request to a node that doesn't support "
|
||||||
+ "it. Version is [" + out.getVersion() + "] but must be [" + Version.V_5_1_0_UNRELEASED + "]");
|
+ "it. Version is [" + out.getVersion() + "] but must be [" + Version.V_5_1_1_UNRELEASED + "]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,7 +186,7 @@ public abstract class BulkByScrollTask extends CancellableTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Status(StreamInput in) throws IOException {
|
public Status(StreamInput in) throws IOException {
|
||||||
if (in.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (in.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
sliceId = in.readOptionalVInt();
|
sliceId = in.readOptionalVInt();
|
||||||
} else {
|
} else {
|
||||||
sliceId = null;
|
sliceId = null;
|
||||||
|
@ -204,7 +204,7 @@ public abstract class BulkByScrollTask extends CancellableTask {
|
||||||
requestsPerSecond = in.readFloat();
|
requestsPerSecond = in.readFloat();
|
||||||
reasonCancelled = in.readOptionalString();
|
reasonCancelled = in.readOptionalString();
|
||||||
throttledUntil = new TimeValue(in);
|
throttledUntil = new TimeValue(in);
|
||||||
if (in.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (in.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
sliceStatuses = in.readList(stream -> stream.readOptionalWriteable(StatusOrException::new));
|
sliceStatuses = in.readList(stream -> stream.readOptionalWriteable(StatusOrException::new));
|
||||||
} else {
|
} else {
|
||||||
sliceStatuses = emptyList();
|
sliceStatuses = emptyList();
|
||||||
|
@ -213,7 +213,7 @@ public abstract class BulkByScrollTask extends CancellableTask {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
if (out.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
out.writeOptionalVInt(sliceId);
|
out.writeOptionalVInt(sliceId);
|
||||||
}
|
}
|
||||||
out.writeVLong(total);
|
out.writeVLong(total);
|
||||||
|
@ -229,7 +229,7 @@ public abstract class BulkByScrollTask extends CancellableTask {
|
||||||
out.writeFloat(requestsPerSecond);
|
out.writeFloat(requestsPerSecond);
|
||||||
out.writeOptionalString(reasonCancelled);
|
out.writeOptionalString(reasonCancelled);
|
||||||
throttledUntil.writeTo(out);
|
throttledUntil.writeTo(out);
|
||||||
if (out.getVersion().onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (out.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
out.writeVInt(sliceStatuses.size());
|
out.writeVInt(sliceStatuses.size());
|
||||||
for (StatusOrException sliceStatus : sliceStatuses) {
|
for (StatusOrException sliceStatus : sliceStatuses) {
|
||||||
out.writeOptionalWriteable(sliceStatus);
|
out.writeOptionalWriteable(sliceStatus);
|
||||||
|
|
|
@ -47,7 +47,6 @@ import java.util.stream.IntStream;
|
||||||
|
|
||||||
import static java.lang.Math.abs;
|
import static java.lang.Math.abs;
|
||||||
import static java.util.Collections.emptyList;
|
import static java.util.Collections.emptyList;
|
||||||
import static java.util.Collections.emptyMap;
|
|
||||||
import static java.util.Collections.singletonList;
|
import static java.util.Collections.singletonList;
|
||||||
import static java.util.stream.Collectors.toList;
|
import static java.util.stream.Collectors.toList;
|
||||||
import static org.apache.lucene.util.TestUtil.randomSimpleString;
|
import static org.apache.lucene.util.TestUtil.randomSimpleString;
|
||||||
|
@ -84,7 +83,7 @@ public class RoundTripTests extends ESTestCase {
|
||||||
reindex.setSlices(between(2, 1000));
|
reindex.setSlices(between(2, 1000));
|
||||||
Exception e = expectThrows(IllegalArgumentException.class, () -> roundTrip(Version.V_5_0_0_rc1, reindex, null));
|
Exception e = expectThrows(IllegalArgumentException.class, () -> roundTrip(Version.V_5_0_0_rc1, reindex, null));
|
||||||
assertEquals("Attempting to send sliced reindex-style request to a node that doesn't support it. "
|
assertEquals("Attempting to send sliced reindex-style request to a node that doesn't support it. "
|
||||||
+ "Version is [5.0.0-rc1] but must be [5.1.0]", e.getMessage());
|
+ "Version is [5.0.0-rc1] but must be [5.1.1]", e.getMessage());
|
||||||
|
|
||||||
// Try without slices with a version that doesn't support slices. That should work.
|
// Try without slices with a version that doesn't support slices. That should work.
|
||||||
tripped = new ReindexRequest();
|
tripped = new ReindexRequest();
|
||||||
|
@ -108,7 +107,7 @@ public class RoundTripTests extends ESTestCase {
|
||||||
update.setSlices(between(2, 1000));
|
update.setSlices(between(2, 1000));
|
||||||
Exception e = expectThrows(IllegalArgumentException.class, () -> roundTrip(Version.V_5_0_0_rc1, update, null));
|
Exception e = expectThrows(IllegalArgumentException.class, () -> roundTrip(Version.V_5_0_0_rc1, update, null));
|
||||||
assertEquals("Attempting to send sliced reindex-style request to a node that doesn't support it. "
|
assertEquals("Attempting to send sliced reindex-style request to a node that doesn't support it. "
|
||||||
+ "Version is [5.0.0-rc1] but must be [5.1.0]", e.getMessage());
|
+ "Version is [5.0.0-rc1] but must be [5.1.1]", e.getMessage());
|
||||||
|
|
||||||
// Try without slices with a version that doesn't support slices. That should work.
|
// Try without slices with a version that doesn't support slices. That should work.
|
||||||
tripped = new UpdateByQueryRequest();
|
tripped = new UpdateByQueryRequest();
|
||||||
|
@ -129,7 +128,7 @@ public class RoundTripTests extends ESTestCase {
|
||||||
delete.setSlices(between(2, 1000));
|
delete.setSlices(between(2, 1000));
|
||||||
Exception e = expectThrows(IllegalArgumentException.class, () -> roundTrip(Version.V_5_0_0_rc1, delete, null));
|
Exception e = expectThrows(IllegalArgumentException.class, () -> roundTrip(Version.V_5_0_0_rc1, delete, null));
|
||||||
assertEquals("Attempting to send sliced reindex-style request to a node that doesn't support it. "
|
assertEquals("Attempting to send sliced reindex-style request to a node that doesn't support it. "
|
||||||
+ "Version is [5.0.0-rc1] but must be [5.1.0]", e.getMessage());
|
+ "Version is [5.0.0-rc1] but must be [5.1.1]", e.getMessage());
|
||||||
|
|
||||||
// Try without slices with a version that doesn't support slices. That should work.
|
// Try without slices with a version that doesn't support slices. That should work.
|
||||||
tripped = new DeleteByQueryRequest();
|
tripped = new DeleteByQueryRequest();
|
||||||
|
@ -356,7 +355,7 @@ public class RoundTripTests extends ESTestCase {
|
||||||
assertEquals(expected.getRequestsPerSecond(), actual.getRequestsPerSecond(), 0f);
|
assertEquals(expected.getRequestsPerSecond(), actual.getRequestsPerSecond(), 0f);
|
||||||
assertEquals(expected.getReasonCancelled(), actual.getReasonCancelled());
|
assertEquals(expected.getReasonCancelled(), actual.getReasonCancelled());
|
||||||
assertEquals(expected.getThrottledUntil(), actual.getThrottledUntil());
|
assertEquals(expected.getThrottledUntil(), actual.getThrottledUntil());
|
||||||
if (version.onOrAfter(Version.V_5_1_0_UNRELEASED)) {
|
if (version.onOrAfter(Version.V_5_1_1_UNRELEASED)) {
|
||||||
assertThat(actual.getSliceStatuses(), hasSize(expected.getSliceStatuses().size()));
|
assertThat(actual.getSliceStatuses(), hasSize(expected.getSliceStatuses().size()));
|
||||||
for (int i = 0; i < expected.getSliceStatuses().size(); i++) {
|
for (int i = 0; i < expected.getSliceStatuses().size(); i++) {
|
||||||
BulkByScrollTask.StatusOrException sliceStatus = expected.getSliceStatuses().get(i);
|
BulkByScrollTask.StatusOrException sliceStatus = expected.getSliceStatuses().get(i);
|
||||||
|
|
Loading…
Reference in New Issue