From 6c45695d5249a57c9df1a3b122ebd6e971595e7d Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Wed, 30 Nov 2016 11:08:19 -0500 Subject: [PATCH] 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 --- .../elasticsearch/ElasticsearchException.java | 2 +- .../src/main/java/org/elasticsearch/Version.java | 9 +++++---- .../shards/ClusterSearchShardsRequest.java | 4 ++-- .../shards/ClusterSearchShardsResponse.java | 4 ++-- .../index/query/QueryStringQueryBuilder.java | 12 ++++++------ .../index/query/SimpleQueryStringBuilder.java | 16 ++++++++-------- .../org/elasticsearch/monitor/os/OsStats.java | 4 ++-- .../java/org/elasticsearch/script/Script.java | 4 ++-- .../search/internal/AliasFilter.java | 4 ++-- .../shards/ClusterSearchShardsResponseTests.java | 2 +- .../reindex/AbstractBulkByScrollRequest.java | 6 +++--- .../index/reindex/BulkByScrollTask.java | 8 ++++---- .../index/reindex/RoundTripTests.java | 9 ++++----- 13 files changed, 42 insertions(+), 42 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/ElasticsearchException.java b/core/src/main/java/org/elasticsearch/ElasticsearchException.java index 8790baa3260..443944825fc 100644 --- a/core/src/main/java/org/elasticsearch/ElasticsearchException.java +++ b/core/src/main/java/org/elasticsearch/ElasticsearchException.java @@ -719,7 +719,7 @@ public class ElasticsearchException extends RuntimeException implements ToXConte STATUS_EXCEPTION(org.elasticsearch.ElasticsearchStatusException.class, org.elasticsearch.ElasticsearchStatusException::new, 145, UNKNOWN_VERSION_ADDED), 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, org.elasticsearch.env.ShardLockObtainFailedException::new, 147, Version.V_5_0_2); diff --git a/core/src/main/java/org/elasticsearch/Version.java b/core/src/main/java/org/elasticsearch/Version.java index 7b83ee2a933..35e92c0d255 100644 --- a/core/src/main/java/org/elasticsearch/Version.java +++ b/core/src/main/java/org/elasticsearch/Version.java @@ -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 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 int V_5_1_0_ID_UNRELEASED = 5010099; - 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); + // no version constant for 5.1.0 due to inadvertent release + 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 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; @@ -125,8 +126,8 @@ public class Version { return V_6_0_0_alpha1_UNRELEASED; case V_5_2_0_ID_UNRELEASED: return V_5_2_0_UNRELEASED; - case V_5_1_0_ID_UNRELEASED: - return V_5_1_0_UNRELEASED; + case V_5_1_1_ID_UNRELEASED: + return V_5_1_1_UNRELEASED; case V_5_0_3_ID_UNRELEASED: return V_5_0_3_UNRELEASED; case V_5_0_2_ID: diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java index 61e5a4ff590..36d63bbcebe 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java @@ -134,7 +134,7 @@ public class ClusterSearchShardsRequest extends MasterNodeReadRequest(); for (int i = 0; i < size; i++) { @@ -93,7 +93,7 @@ public class ClusterSearchShardsResponse extends ActionResponse implements ToXCo for (DiscoveryNode node : nodes) { 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()); for (Map.Entry entry : indicesAndFilters.entrySet()) { out.writeString(entry.getKey()); diff --git a/core/src/main/java/org/elasticsearch/index/query/QueryStringQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/QueryStringQueryBuilder.java index c0533ef856b..d019b20b425 100644 --- a/core/src/main/java/org/elasticsearch/index/query/QueryStringQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/QueryStringQueryBuilder.java @@ -214,11 +214,11 @@ public class QueryStringQueryBuilder extends AbstractQueryBuilder 1) { 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 + "]"); } } } diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/BulkByScrollTask.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/BulkByScrollTask.java index 77f8128e9ac..2662f474bfd 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/BulkByScrollTask.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/BulkByScrollTask.java @@ -186,7 +186,7 @@ public abstract class BulkByScrollTask extends CancellableTask { } 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(); } else { sliceId = null; @@ -204,7 +204,7 @@ public abstract class BulkByScrollTask extends CancellableTask { requestsPerSecond = in.readFloat(); reasonCancelled = in.readOptionalString(); 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)); } else { sliceStatuses = emptyList(); @@ -213,7 +213,7 @@ public abstract class BulkByScrollTask extends CancellableTask { @Override 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.writeVLong(total); @@ -229,7 +229,7 @@ public abstract class BulkByScrollTask extends CancellableTask { out.writeFloat(requestsPerSecond); out.writeOptionalString(reasonCancelled); 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()); for (StatusOrException sliceStatus : sliceStatuses) { out.writeOptionalWriteable(sliceStatus); diff --git a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/RoundTripTests.java b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/RoundTripTests.java index 43e5c7ef5a3..8e34df3ec36 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/RoundTripTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/RoundTripTests.java @@ -47,7 +47,6 @@ import java.util.stream.IntStream; import static java.lang.Math.abs; import static java.util.Collections.emptyList; -import static java.util.Collections.emptyMap; import static java.util.Collections.singletonList; import static java.util.stream.Collectors.toList; import static org.apache.lucene.util.TestUtil.randomSimpleString; @@ -84,7 +83,7 @@ public class RoundTripTests extends ESTestCase { reindex.setSlices(between(2, 1000)); 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. " - + "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. tripped = new ReindexRequest(); @@ -108,7 +107,7 @@ public class RoundTripTests extends ESTestCase { update.setSlices(between(2, 1000)); 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. " - + "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. tripped = new UpdateByQueryRequest(); @@ -129,7 +128,7 @@ public class RoundTripTests extends ESTestCase { delete.setSlices(between(2, 1000)); 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. " - + "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. tripped = new DeleteByQueryRequest(); @@ -356,7 +355,7 @@ public class RoundTripTests extends ESTestCase { assertEquals(expected.getRequestsPerSecond(), actual.getRequestsPerSecond(), 0f); assertEquals(expected.getReasonCancelled(), actual.getReasonCancelled()); 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())); for (int i = 0; i < expected.getSliceStatuses().size(); i++) { BulkByScrollTask.StatusOrException sliceStatus = expected.getSliceStatuses().get(i);