From b9ee9157631ee3ff3e19b7745886e5c004dbe134 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Thu, 11 Sep 2014 22:10:19 +0200 Subject: [PATCH] [Version] Add Version 1.4.0-Beta --- src/main/java/org/elasticsearch/Version.java | 4 ++++ .../elasticsearch/action/OriginalIndices.java | 8 ++++---- .../admin/cluster/node/stats/NodeStats.java | 4 ++-- .../cache/clear/ClearIndicesCacheRequest.java | 4 ++-- .../clear/ShardClearIndicesCacheRequest.java | 4 ++-- .../admin/indices/flush/FlushRequest.java | 4 ++-- .../admin/indices/flush/ShardFlushRequest.java | 4 ++-- .../admin/indices/stats/CommonStats.java | 4 ++-- .../indices/warmer/get/GetWarmersResponse.java | 4 ++-- .../action/count/CountRequest.java | 4 ++-- .../action/count/CountResponse.java | 4 ++-- .../action/count/ShardCountRequest.java | 4 ++-- .../action/count/ShardCountResponse.java | 4 ++-- .../action/delete/ShardDeleteRequest.java | 4 ++-- .../action/explain/ExplainResponse.java | 4 ++-- .../elasticsearch/action/get/GetRequest.java | 4 ++-- .../action/get/MultiGetRequest.java | 4 ++-- .../action/get/MultiGetShardRequest.java | 8 ++++---- .../get/GetIndexedScriptRequest.java | 4 ++-- .../action/mlt/MoreLikeThisRequest.java | 4 ++-- .../action/search/SearchRequest.java | 4 ++-- ...ansportShardReplicationOperationAction.java | 6 +++--- .../TransportSingleCustomOperationAction.java | 6 +++--- .../TransportShardSingleOperationAction.java | 6 +++--- .../action/termvector/TermVectorRequest.java | 8 ++++---- .../action/update/UpdateRequest.java | 4 ++-- .../cluster/metadata/MappingMetaData.java | 4 ++-- .../elasticsearch/common/lucene/Lucene.java | 5 ++--- .../common/rounding/Rounding.java | 4 ++-- .../discovery/zen/fd/MasterFaultDetection.java | 4 ++-- .../discovery/zen/fd/NodesFaultDetection.java | 4 ++-- .../zen/membership/MembershipAction.java | 8 ++++---- .../discovery/zen/ping/ZenPing.java | 4 ++-- .../index/engine/SegmentsStats.java | 8 ++++---- .../plain/DocValuesIndexFieldData.java | 2 +- .../index/indexing/IndexingStats.java | 4 ++-- .../index/mapper/core/NumberFieldMapper.java | 2 +- .../index/query/QueryParseContext.java | 2 +- .../index/store/StoreFileMetaData.java | 4 ++-- .../indices/breaker/CircuitBreakerStats.java | 4 ++-- .../RecoveryTranslogOperationsRequest.java | 4 ++-- .../aggregations/bucket/terms/DoubleTerms.java | 12 ++++++------ .../aggregations/bucket/terms/LongTerms.java | 12 ++++++------ .../aggregations/bucket/terms/StringTerms.java | 12 ++++++------ .../internal/InternalSearchResponse.java | 4 ++-- .../search/internal/ShardSearchRequest.java | 4 ++-- .../search/query/QuerySearchResult.java | 4 ++-- .../elasticsearch/search/suggest/Suggest.java | 4 ++-- .../search/warmer/IndexWarmersMetaData.java | 4 ++-- .../elasticsearch/transport/ActionNames.java | 4 ++-- .../action/OriginalIndicesTests.java | 4 ++-- .../action/get/MultiGetShardRequestTests.java | 6 +++--- .../bucket/DateHistogramOffsetTests.java | 2 +- .../ActionNamesBackwardsCompatibilityTest.java | 18 +++++++++--------- .../transport/ActionNamesTests.java | 6 +++--- 55 files changed, 142 insertions(+), 139 deletions(-) diff --git a/src/main/java/org/elasticsearch/Version.java b/src/main/java/org/elasticsearch/Version.java index e6a7d39c20d..b6a2d1df80f 100644 --- a/src/main/java/org/elasticsearch/Version.java +++ b/src/main/java/org/elasticsearch/Version.java @@ -198,6 +198,8 @@ public class Version implements Serializable { public static final Version V_1_3_2 = new Version(V_1_3_2_ID, false, org.apache.lucene.util.Version.LUCENE_4_9); public static final int V_1_3_3_ID = /*00*/1030399; public static final Version V_1_3_3 = new Version(V_1_3_3_ID, false, org.apache.lucene.util.Version.LUCENE_4_9); + public static final int V_1_4_0_Beta_ID = /*00*/1040001; + public static final Version V_1_4_0_Beta = new Version(V_1_4_0_Beta_ID, false, org.apache.lucene.util.Version.LUCENE_4_10_0); public static final int V_1_4_0_ID = /*00*/1040099; public static final Version V_1_4_0 = new Version(V_1_4_0_ID, false, org.apache.lucene.util.Version.LUCENE_4_10_0); public static final int V_2_0_0_ID = /*00*/2000099; @@ -219,6 +221,8 @@ public class Version implements Serializable { return V_2_0_0; case V_1_4_0_ID: return V_1_4_0; + case V_1_4_0_Beta_ID: + return V_1_4_0_Beta; case V_1_3_3_ID: return V_1_3_3; case V_1_3_2_ID: diff --git a/src/main/java/org/elasticsearch/action/OriginalIndices.java b/src/main/java/org/elasticsearch/action/OriginalIndices.java index bc09300630d..134f3a09218 100644 --- a/src/main/java/org/elasticsearch/action/OriginalIndices.java +++ b/src/main/java/org/elasticsearch/action/OriginalIndices.java @@ -62,7 +62,7 @@ public class OriginalIndices implements IndicesRequest { } public static OriginalIndices readOptionalOriginalIndices(StreamInput in) throws IOException { - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { boolean empty = in.readBoolean(); if (!empty) { return new OriginalIndices(in.readStringArray(), IndicesOptions.readIndicesOptions(in)); @@ -72,7 +72,7 @@ public class OriginalIndices implements IndicesRequest { } public static void writeOptionalOriginalIndices(OriginalIndices originalIndices, StreamOutput out) throws IOException { - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { boolean empty = originalIndices == EMPTY; out.writeBoolean(empty); if (!empty) { @@ -83,7 +83,7 @@ public class OriginalIndices implements IndicesRequest { } public static OriginalIndices readOriginalIndices(StreamInput in) throws IOException { - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { return new OriginalIndices(in.readStringArray(), IndicesOptions.readIndicesOptions(in)); } return OriginalIndices.EMPTY; @@ -91,7 +91,7 @@ public class OriginalIndices implements IndicesRequest { public static void writeOriginalIndices(OriginalIndices originalIndices, StreamOutput out) throws IOException { - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeStringArrayNullable(originalIndices.indices); originalIndices.indicesOptions.writeIndicesOptions(out); } diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java b/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java index 7f8ed1ac290..46629ad42cb 100644 --- a/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java +++ b/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java @@ -218,7 +218,7 @@ public class NodeStats extends NodeOperationResponse implements ToXContent { if (in.readBoolean()) { http = HttpStats.readHttpStats(in); } - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { breaker = AllCircuitBreakerStats.readOptionalAllCircuitBreakerStats(in); } else { // If 1.3.0 or earlier, only a single CircuitBreakerStats can be read @@ -288,7 +288,7 @@ public class NodeStats extends NodeOperationResponse implements ToXContent { out.writeBoolean(true); http.writeTo(out); } - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeOptionalStreamable(breaker); } else { // Writing to a 1.3.0 or earlier stream expects only a single breaker stats diff --git a/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java index 381c3f33fe7..8f2967ef0e2 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java @@ -118,7 +118,7 @@ public class ClearIndicesCacheRequest extends BroadcastOperationRequest { super.writeTo(out); out.writeBoolean(full); out.writeBoolean(force); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeBoolean(waitIfOngoing); } } @@ -117,7 +117,7 @@ public class FlushRequest extends BroadcastOperationRequest { super.readFrom(in); full = in.readBoolean(); force = in.readBoolean(); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { waitIfOngoing = in.readBoolean(); } else { waitIfOngoing = false; diff --git a/src/main/java/org/elasticsearch/action/admin/indices/flush/ShardFlushRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/flush/ShardFlushRequest.java index 8eb41bda407..c34af1f0574 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/flush/ShardFlushRequest.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/flush/ShardFlushRequest.java @@ -63,7 +63,7 @@ class ShardFlushRequest extends BroadcastShardOperationRequest { super.readFrom(in); full = in.readBoolean(); force = in.readBoolean(); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { waitIfOngoing = in.readBoolean(); } else { waitIfOngoing = false; @@ -75,7 +75,7 @@ class ShardFlushRequest extends BroadcastShardOperationRequest { super.writeTo(out); out.writeBoolean(full); out.writeBoolean(force); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeBoolean(waitIfOngoing); } } diff --git a/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java b/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java index 0f8eb89d212..fdb7713b163 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java @@ -537,7 +537,7 @@ public class CommonStats implements Streamable, ToXContent { if (in.getVersion().onOrAfter(Version.V_1_2_0)) { suggest = in.readOptionalStreamable(new SuggestStats()); } - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { queryCache = in.readOptionalStreamable(new QueryCacheStats()); } } @@ -638,7 +638,7 @@ public class CommonStats implements Streamable, ToXContent { if (out.getVersion().onOrAfter(Version.V_1_2_0)) { out.writeOptionalStreamable(suggest); } - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeOptionalStreamable(queryCache); } } diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersResponse.java index 42271c996fd..b8977eba2e3 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersResponse.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersResponse.java @@ -69,7 +69,7 @@ public class GetWarmersResponse extends ActionResponse { String[] types = in.readStringArray(); BytesReference source = in.readBytesReference(); Boolean queryCache = null; - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { queryCache = in.readOptionalBoolean(); } warmerEntryBuilder.add(new IndexWarmersMetaData.Entry( @@ -95,7 +95,7 @@ public class GetWarmersResponse extends ActionResponse { out.writeString(warmerEntry.name()); out.writeStringArray(warmerEntry.types()); out.writeBytesReference(warmerEntry.source()); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeOptionalBoolean(warmerEntry.queryCache()); } } diff --git a/src/main/java/org/elasticsearch/action/count/CountRequest.java b/src/main/java/org/elasticsearch/action/count/CountRequest.java index ae102b88c6b..2db49dd30d6 100644 --- a/src/main/java/org/elasticsearch/action/count/CountRequest.java +++ b/src/main/java/org/elasticsearch/action/count/CountRequest.java @@ -251,7 +251,7 @@ public class CountRequest extends BroadcastOperationRequest { source = in.readBytesReference(); types = in.readStringArray(); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { terminateAfter = in.readVInt(); } } @@ -265,7 +265,7 @@ public class CountRequest extends BroadcastOperationRequest { out.writeBytesReference(source); out.writeStringArray(types); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeVInt(terminateAfter); } } diff --git a/src/main/java/org/elasticsearch/action/count/CountResponse.java b/src/main/java/org/elasticsearch/action/count/CountResponse.java index 0aaa4f1ec57..8679d0174c5 100644 --- a/src/main/java/org/elasticsearch/action/count/CountResponse.java +++ b/src/main/java/org/elasticsearch/action/count/CountResponse.java @@ -86,7 +86,7 @@ public class CountResponse extends BroadcastOperationResponse { public void readFrom(StreamInput in) throws IOException { super.readFrom(in); count = in.readVLong(); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { terminatedEarly = in.readBoolean(); } } @@ -95,7 +95,7 @@ public class CountResponse extends BroadcastOperationResponse { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeVLong(count); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeBoolean(terminatedEarly); } } diff --git a/src/main/java/org/elasticsearch/action/count/ShardCountRequest.java b/src/main/java/org/elasticsearch/action/count/ShardCountRequest.java index bd160a06bfb..db2b7be7876 100644 --- a/src/main/java/org/elasticsearch/action/count/ShardCountRequest.java +++ b/src/main/java/org/elasticsearch/action/count/ShardCountRequest.java @@ -110,7 +110,7 @@ class ShardCountRequest extends BroadcastShardOperationRequest { } nowInMillis = in.readVLong(); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { terminateAfter = in.readVInt(); } else { terminateAfter = DEFAULT_TERMINATE_AFTER; @@ -138,7 +138,7 @@ class ShardCountRequest extends BroadcastShardOperationRequest { } out.writeVLong(nowInMillis); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeVInt(terminateAfter); } } diff --git a/src/main/java/org/elasticsearch/action/count/ShardCountResponse.java b/src/main/java/org/elasticsearch/action/count/ShardCountResponse.java index f92d97c4a32..348a5f2819e 100644 --- a/src/main/java/org/elasticsearch/action/count/ShardCountResponse.java +++ b/src/main/java/org/elasticsearch/action/count/ShardCountResponse.java @@ -59,7 +59,7 @@ class ShardCountResponse extends BroadcastShardOperationResponse { public void readFrom(StreamInput in) throws IOException { super.readFrom(in); count = in.readVLong(); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { terminatedEarly = in.readBoolean(); } } @@ -68,7 +68,7 @@ class ShardCountResponse extends BroadcastShardOperationResponse { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeVLong(count); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeBoolean(terminatedEarly); } } diff --git a/src/main/java/org/elasticsearch/action/delete/ShardDeleteRequest.java b/src/main/java/org/elasticsearch/action/delete/ShardDeleteRequest.java index 6963c8fc83a..c87aa1d9017 100644 --- a/src/main/java/org/elasticsearch/action/delete/ShardDeleteRequest.java +++ b/src/main/java/org/elasticsearch/action/delete/ShardDeleteRequest.java @@ -108,7 +108,7 @@ public class ShardDeleteRequest extends ShardReplicationOperationRequest { } else if (realtime == 1) { this.realtime = true; } - if(in.getVersion().onOrAfter(Version.V_1_4_0)) { + if(in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { this.ignoreErrorsOnGeneratedFields = in.readBoolean(); } @@ -339,7 +339,7 @@ public class GetRequest extends SingleShardOperationRequest { } else { out.writeByte((byte) 1); } - if(out.getVersion().onOrAfter(Version.V_1_4_0)) { + if(out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeBoolean(ignoreErrorsOnGeneratedFields); } out.writeByte(versionType.getValue()); diff --git a/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java b/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java index dea6e08f839..c648318b750 100644 --- a/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java +++ b/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java @@ -513,7 +513,7 @@ public class MultiGetRequest extends ActionRequest implements I } else if (realtime == 1) { this.realtime = true; } - if(in.getVersion().onOrAfter(Version.V_1_4_0)) { + if(in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { ignoreErrorsOnGeneratedFields = in.readBoolean(); } @@ -536,7 +536,7 @@ public class MultiGetRequest extends ActionRequest implements I } else { out.writeByte((byte) 1); } - if(out.getVersion().onOrAfter(Version.V_1_4_0)) { + if(out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeBoolean(ignoreErrorsOnGeneratedFields); } diff --git a/src/main/java/org/elasticsearch/action/get/MultiGetShardRequest.java b/src/main/java/org/elasticsearch/action/get/MultiGetShardRequest.java index 62036e1f042..4e742af5ffc 100644 --- a/src/main/java/org/elasticsearch/action/get/MultiGetShardRequest.java +++ b/src/main/java/org/elasticsearch/action/get/MultiGetShardRequest.java @@ -121,7 +121,7 @@ public class MultiGetShardRequest extends SingleShardOperationRequest(size); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { for (int i = 0; i < size; i++) { locations.add(in.readVInt()); items.add(MultiGetRequest.Item.readItem(in)); @@ -175,7 +175,7 @@ public class MultiGetShardRequest extends SingleShardOperationRequest impl } searchType = SearchType.fromId(in.readByte()); - if (in.getVersion().before(Version.V_1_4_0)) { + if (in.getVersion().before(Version.V_1_4_0_Beta)) { //searchQueryHint was unused and removed in 1.4 if (in.readBoolean()) { in.readString(); @@ -676,7 +676,7 @@ public class MoreLikeThisRequest extends ActionRequest impl } out.writeByte(searchType.id()); - if (out.getVersion().before(Version.V_1_4_0)) { + if (out.getVersion().before(Version.V_1_4_0_Beta)) { //searchQueryHint was unused and removed in 1.4 out.writeBoolean(false); } diff --git a/src/main/java/org/elasticsearch/action/search/SearchRequest.java b/src/main/java/org/elasticsearch/action/search/SearchRequest.java index 28a4e1e6961..d2ee880c18a 100644 --- a/src/main/java/org/elasticsearch/action/search/SearchRequest.java +++ b/src/main/java/org/elasticsearch/action/search/SearchRequest.java @@ -582,7 +582,7 @@ public class SearchRequest extends ActionRequest implements Indic } } - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { queryCache = in.readOptionalBoolean(); } } @@ -627,7 +627,7 @@ public class SearchRequest extends ActionRequest implements Indic } } - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeOptionalBoolean(queryCache); } } diff --git a/src/main/java/org/elasticsearch/action/support/replication/TransportShardReplicationOperationAction.java b/src/main/java/org/elasticsearch/action/support/replication/TransportShardReplicationOperationAction.java index d84904f93b3..cfe86bdcd70 100644 --- a/src/main/java/org/elasticsearch/action/support/replication/TransportShardReplicationOperationAction.java +++ b/src/main/java/org/elasticsearch/action/support/replication/TransportShardReplicationOperationAction.java @@ -283,14 +283,14 @@ public abstract class TransportShardReplicationOperationAction= 0; //older nodes will send the concrete index as part of the request shardId = new ShardId(request.index(), shard); @@ -300,7 +300,7 @@ public abstract class TransportShardReplicationOperationAction docAsUpsert = in.readBoolean(); version = Versions.readVersion(in); versionType = VersionType.fromValue(in.readByte()); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { detectNoop = in.readBoolean(); scriptedUpsert = in.readBoolean(); } @@ -725,7 +725,7 @@ public class UpdateRequest extends InstanceShardOperationRequest out.writeBoolean(docAsUpsert); Versions.writeVersion(version, out); out.writeByte(versionType.getValue()); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeBoolean(detectNoop); out.writeBoolean(scriptedUpsert); } diff --git a/src/main/java/org/elasticsearch/cluster/metadata/MappingMetaData.java b/src/main/java/org/elasticsearch/cluster/metadata/MappingMetaData.java index 1dde1081746..5eca42b17c5 100644 --- a/src/main/java/org/elasticsearch/cluster/metadata/MappingMetaData.java +++ b/src/main/java/org/elasticsearch/cluster/metadata/MappingMetaData.java @@ -546,7 +546,7 @@ public class MappingMetaData { out.writeBoolean(false); } out.writeString(mappingMd.timestamp().format()); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { if (mappingMd.timestamp().hasDefaultTimestamp()) { out.writeBoolean(true); out.writeString(mappingMd.timestamp().defaultTimestamp()); @@ -592,7 +592,7 @@ public class MappingMetaData { Routing routing = new Routing(in.readBoolean(), in.readBoolean() ? in.readString() : null); // timestamp Timestamp timestamp = new Timestamp(in.readBoolean(), in.readBoolean() ? in.readString() : null, in.readString(), - in.getVersion().onOrAfter(Version.V_1_4_0) ? (in.readBoolean() ? in.readString() : null) : TimestampFieldMapper.Defaults.DEFAULT_TIMESTAMP); + in.getVersion().onOrAfter(Version.V_1_4_0_Beta) ? (in.readBoolean() ? in.readString() : null) : TimestampFieldMapper.Defaults.DEFAULT_TIMESTAMP); final boolean hasParentField = in.readBoolean(); return new MappingMetaData(type, source, id, routing, timestamp, hasParentField); } diff --git a/src/main/java/org/elasticsearch/common/lucene/Lucene.java b/src/main/java/org/elasticsearch/common/lucene/Lucene.java index f97ca5f3bd0..870f4c99299 100644 --- a/src/main/java/org/elasticsearch/common/lucene/Lucene.java +++ b/src/main/java/org/elasticsearch/common/lucene/Lucene.java @@ -42,7 +42,6 @@ import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.fielddata.IndexFieldData; import java.io.IOException; -import java.util.Locale; import static org.elasticsearch.common.lucene.search.NoopCollector.NOOP_COLLECTOR; @@ -424,7 +423,7 @@ public class Lucene { public static Explanation readExplanation(StreamInput in) throws IOException { Explanation explanation; - if (in.getVersion().onOrAfter(org.elasticsearch.Version.V_1_4_0) && in.readBoolean()) { + if (in.getVersion().onOrAfter(org.elasticsearch.Version.V_1_4_0_Beta) && in.readBoolean()) { Boolean match = in.readOptionalBoolean(); explanation = new ComplexExplanation(); ((ComplexExplanation) explanation).setMatch(match); @@ -445,7 +444,7 @@ public class Lucene { public static void writeExplanation(StreamOutput out, Explanation explanation) throws IOException { - if (out.getVersion().onOrAfter(org.elasticsearch.Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(org.elasticsearch.Version.V_1_4_0_Beta)) { if (explanation instanceof ComplexExplanation) { out.writeBoolean(true); out.writeOptionalBoolean(((ComplexExplanation) explanation).getMatch()); diff --git a/src/main/java/org/elasticsearch/common/rounding/Rounding.java b/src/main/java/org/elasticsearch/common/rounding/Rounding.java index 8d5372106cf..083ccf0e24a 100644 --- a/src/main/java/org/elasticsearch/common/rounding/Rounding.java +++ b/src/main/java/org/elasticsearch/common/rounding/Rounding.java @@ -219,7 +219,7 @@ public abstract class Rounding implements Streamable { @Override public void readFrom(StreamInput in) throws IOException { rounding = Rounding.Streams.read(in); - if (in.getVersion().before(Version.V_1_4_0)) { + if (in.getVersion().before(Version.V_1_4_0_Beta)) { preOffset = in.readVLong(); postOffset = in.readVLong(); } else { @@ -231,7 +231,7 @@ public abstract class Rounding implements Streamable { @Override public void writeTo(StreamOutput out) throws IOException { Rounding.Streams.write(rounding, out); - if (out.getVersion().before(Version.V_1_4_0)) { + if (out.getVersion().before(Version.V_1_4_0_Beta)) { out.writeVLong(preOffset); out.writeVLong(postOffset); } else { diff --git a/src/main/java/org/elasticsearch/discovery/zen/fd/MasterFaultDetection.java b/src/main/java/org/elasticsearch/discovery/zen/fd/MasterFaultDetection.java index 49709b7905b..ce962d0c120 100644 --- a/src/main/java/org/elasticsearch/discovery/zen/fd/MasterFaultDetection.java +++ b/src/main/java/org/elasticsearch/discovery/zen/fd/MasterFaultDetection.java @@ -394,7 +394,7 @@ public class MasterFaultDetection extends FaultDetection { super.readFrom(in); nodeId = in.readString(); masterNodeId = in.readString(); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { clusterName = ClusterName.readClusterName(in); } } @@ -404,7 +404,7 @@ public class MasterFaultDetection extends FaultDetection { super.writeTo(out); out.writeString(nodeId); out.writeString(masterNodeId); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { clusterName.writeTo(out); } } diff --git a/src/main/java/org/elasticsearch/discovery/zen/fd/NodesFaultDetection.java b/src/main/java/org/elasticsearch/discovery/zen/fd/NodesFaultDetection.java index 90012099116..edb76971a26 100644 --- a/src/main/java/org/elasticsearch/discovery/zen/fd/NodesFaultDetection.java +++ b/src/main/java/org/elasticsearch/discovery/zen/fd/NodesFaultDetection.java @@ -335,7 +335,7 @@ public class NodesFaultDetection extends FaultDetection { public void readFrom(StreamInput in) throws IOException { super.readFrom(in); nodeId = in.readString(); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { clusterName = ClusterName.readClusterName(in); masterNode = DiscoveryNode.readNode(in); clusterStateVersion = in.readLong(); @@ -346,7 +346,7 @@ public class NodesFaultDetection extends FaultDetection { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeString(nodeId); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { clusterName.writeTo(out); masterNode.writeTo(out); out.writeLong(clusterStateVersion); diff --git a/src/main/java/org/elasticsearch/discovery/zen/membership/MembershipAction.java b/src/main/java/org/elasticsearch/discovery/zen/membership/MembershipAction.java index d3a1b89ab51..de3b8a6be46 100644 --- a/src/main/java/org/elasticsearch/discovery/zen/membership/MembershipAction.java +++ b/src/main/java/org/elasticsearch/discovery/zen/membership/MembershipAction.java @@ -126,7 +126,7 @@ public class MembershipAction extends AbstractComponent { public void readFrom(StreamInput in) throws IOException { super.readFrom(in); node = DiscoveryNode.readNode(in); - if (in.getVersion().before(Version.V_1_4_0)) { + if (in.getVersion().before(Version.V_1_4_0_Beta)) { withClusterState = in.readBoolean(); } } @@ -135,7 +135,7 @@ public class MembershipAction extends AbstractComponent { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); node.writeTo(out); - if (out.getVersion().before(Version.V_1_4_0)) { + if (out.getVersion().before(Version.V_1_4_0_Beta)) { // old with cluster state flag out.writeBoolean(false); } @@ -219,7 +219,7 @@ public class MembershipAction extends AbstractComponent { @Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); - if (in.getVersion().before(Version.V_1_4_0)) { + if (in.getVersion().before(Version.V_1_4_0_Beta)) { // cluster name doesn't matter... ClusterState.Builder.readFrom(in, nodesProvider.nodes().localNode(), null); } @@ -228,7 +228,7 @@ public class MembershipAction extends AbstractComponent { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getVersion().before(Version.V_1_4_0)) { + if (out.getVersion().before(Version.V_1_4_0_Beta)) { ClusterState.Builder.writeTo(clusterService.state(), out); } } diff --git a/src/main/java/org/elasticsearch/discovery/zen/ping/ZenPing.java b/src/main/java/org/elasticsearch/discovery/zen/ping/ZenPing.java index 0c3dd9478f7..33dd72e7285 100644 --- a/src/main/java/org/elasticsearch/discovery/zen/ping/ZenPing.java +++ b/src/main/java/org/elasticsearch/discovery/zen/ping/ZenPing.java @@ -108,7 +108,7 @@ public interface ZenPing extends LifecycleComponent { if (in.readBoolean()) { master = readNode(in); } - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { this.hasJoinedOnce = in.readBoolean(); } else { // As of 1.4.0 we prefer to elect nodes which have previously successfully joined the cluster. @@ -130,7 +130,7 @@ public interface ZenPing extends LifecycleComponent { out.writeBoolean(true); master.writeTo(out); } - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeBoolean(hasJoinedOnce); } } diff --git a/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java b/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java index faa986147f9..70b43427051 100644 --- a/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java +++ b/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java @@ -182,10 +182,10 @@ public class SegmentsStats implements Streamable, ToXContent { indexWriterMemoryInBytes = in.readLong(); versionMapMemoryInBytes = in.readLong(); } - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { indexWriterMaxMemoryInBytes = in.readLong(); } - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { fixedBitSetMemoryInBytes = in.readLong(); } } @@ -198,10 +198,10 @@ public class SegmentsStats implements Streamable, ToXContent { out.writeLong(indexWriterMemoryInBytes); out.writeLong(versionMapMemoryInBytes); } - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeLong(indexWriterMaxMemoryInBytes); } - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeLong(fixedBitSetMemoryInBytes); } } diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/DocValuesIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/DocValuesIndexFieldData.java index ec3cb13659a..d216a9a28a8 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/DocValuesIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/DocValuesIndexFieldData.java @@ -108,7 +108,7 @@ public abstract class DocValuesIndexFieldData { assert !numericType.isFloatingPoint(); return new NumericDVIndexFieldData(index, fieldNames, mapper.fieldDataType()); } else if (numericType != null) { - if (Version.indexCreated(indexSettings).onOrAfter(Version.V_1_4_0)) { + if (Version.indexCreated(indexSettings).onOrAfter(Version.V_1_4_0_Beta)) { return new SortedNumericDVIndexFieldData(index, fieldNames, numericType, mapper.fieldDataType()); } else { // prior to ES 1.4: multi-valued numerics were boxed inside a byte[] as BINARY diff --git a/src/main/java/org/elasticsearch/index/indexing/IndexingStats.java b/src/main/java/org/elasticsearch/index/indexing/IndexingStats.java index 3d3903f4167..7353b5e4e43 100644 --- a/src/main/java/org/elasticsearch/index/indexing/IndexingStats.java +++ b/src/main/java/org/elasticsearch/index/indexing/IndexingStats.java @@ -127,7 +127,7 @@ public class IndexingStats implements Streamable, ToXContent { deleteTimeInMillis = in.readVLong(); deleteCurrent = in.readVLong(); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { noopUpdateCount = in.readVLong(); } } @@ -142,7 +142,7 @@ public class IndexingStats implements Streamable, ToXContent { out.writeVLong(deleteTimeInMillis); out.writeVLong(deleteCurrent); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeVLong(noopUpdateCount); } } diff --git a/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java index 3d06555aaa6..3828cd48cc1 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java @@ -200,7 +200,7 @@ public abstract class NumberFieldMapper extends AbstractFieldM this.ignoreMalformed = ignoreMalformed; this.coerce = coerce; Version v = Version.indexCreated(indexSettings); - this.useSortedNumericDocValues = v.onOrAfter(Version.V_1_4_0); + this.useSortedNumericDocValues = v.onOrAfter(Version.V_1_4_0_Beta); } @Override diff --git a/src/main/java/org/elasticsearch/index/query/QueryParseContext.java b/src/main/java/org/elasticsearch/index/query/QueryParseContext.java index bf137a56c5c..5159579d92a 100644 --- a/src/main/java/org/elasticsearch/index/query/QueryParseContext.java +++ b/src/main/java/org/elasticsearch/index/query/QueryParseContext.java @@ -340,7 +340,7 @@ public class QueryParseContext { return fieldMapping; } else { Version indexCreatedVersion = indexQueryParser.getIndexCreatedVersion(); - if (fieldMapping == null && indexCreatedVersion.onOrAfter(Version.V_1_4_0)) { + if (fieldMapping == null && indexCreatedVersion.onOrAfter(Version.V_1_4_0_Beta)) { throw new QueryParsingException(index, "Strict field resolution and no field mapping can be found for the field with name [" + name + "]"); } else { return fieldMapping; diff --git a/src/main/java/org/elasticsearch/index/store/StoreFileMetaData.java b/src/main/java/org/elasticsearch/index/store/StoreFileMetaData.java index 5e3da55e967..142b79800a2 100644 --- a/src/main/java/org/elasticsearch/index/store/StoreFileMetaData.java +++ b/src/main/java/org/elasticsearch/index/store/StoreFileMetaData.java @@ -124,7 +124,7 @@ public class StoreFileMetaData implements Streamable { String versionString = in.readOptionalString(); writtenBy = Lucene.parseVersionLenient(versionString, null); } - if (in.getVersion().onOrAfter(org.elasticsearch.Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(org.elasticsearch.Version.V_1_4_0_Beta)) { hash = in.readBytesRef(); } else { hash = new BytesRef(); @@ -139,7 +139,7 @@ public class StoreFileMetaData implements Streamable { if (out.getVersion().onOrAfter(org.elasticsearch.Version.V_1_3_0)) { out.writeOptionalString(writtenBy == null ? null : writtenBy.toString()); } - if (out.getVersion().onOrAfter(org.elasticsearch.Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(org.elasticsearch.Version.V_1_4_0_Beta)) { out.writeBytesRef(hash); } } diff --git a/src/main/java/org/elasticsearch/indices/breaker/CircuitBreakerStats.java b/src/main/java/org/elasticsearch/indices/breaker/CircuitBreakerStats.java index 67bdd358dcd..32242d17195 100644 --- a/src/main/java/org/elasticsearch/indices/breaker/CircuitBreakerStats.java +++ b/src/main/java/org/elasticsearch/indices/breaker/CircuitBreakerStats.java @@ -91,7 +91,7 @@ public class CircuitBreakerStats implements Streamable, ToXContent { } else { this.trippedCount = -1; } - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { this.name = CircuitBreaker.Name.readFrom(in); } else { this.name = CircuitBreaker.Name.FIELDDATA; @@ -106,7 +106,7 @@ public class CircuitBreakerStats implements Streamable, ToXContent { if (out.getVersion().onOrAfter(Version.V_1_2_0)) { out.writeLong(trippedCount); } - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { CircuitBreaker.Name.writeTo(name, out); } } diff --git a/src/main/java/org/elasticsearch/indices/recovery/RecoveryTranslogOperationsRequest.java b/src/main/java/org/elasticsearch/indices/recovery/RecoveryTranslogOperationsRequest.java index b99d5d70040..4f499bbaf65 100644 --- a/src/main/java/org/elasticsearch/indices/recovery/RecoveryTranslogOperationsRequest.java +++ b/src/main/java/org/elasticsearch/indices/recovery/RecoveryTranslogOperationsRequest.java @@ -69,7 +69,7 @@ class RecoveryTranslogOperationsRequest extends TransportRequest { int size = in.readVInt(); operations = Lists.newArrayListWithExpectedSize(size); for (int i = 0; i < size; i++) { - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { operations.add(TranslogStreams.CHECKSUMMED_TRANSLOG_STREAM.read(in)); } else { operations.add(TranslogStreams.LEGACY_TRANSLOG_STREAM.read(in)); @@ -85,7 +85,7 @@ class RecoveryTranslogOperationsRequest extends TransportRequest { shardId.writeTo(out); out.writeVInt(operations.size()); for (Translog.Operation operation : operations) { - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { TranslogStreams.CHECKSUMMED_TRANSLOG_STREAM.write(out, operation); } else { TranslogStreams.LEGACY_TRANSLOG_STREAM.write(out, operation); diff --git a/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/DoubleTerms.java b/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/DoubleTerms.java index 90c3723d501..232dd4a2688 100644 --- a/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/DoubleTerms.java +++ b/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/DoubleTerms.java @@ -116,7 +116,7 @@ public class DoubleTerms extends InternalTerms { @Override public void readFrom(StreamInput in) throws IOException { this.name = in.readString(); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { this.docCountError = in.readLong(); } else { this.docCountError = -1; @@ -124,7 +124,7 @@ public class DoubleTerms extends InternalTerms { this.order = InternalOrder.Streams.readOrder(in); this.formatter = ValueFormatterStreams.readOptional(in); this.requiredSize = readSize(in); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { this.shardSize = readSize(in); this.showTermDocCountError = in.readBoolean(); } else { @@ -138,7 +138,7 @@ public class DoubleTerms extends InternalTerms { double term = in.readDouble(); long docCount = in.readVLong(); long bucketDocCountError = -1; - if (in.getVersion().onOrAfter(Version.V_1_4_0) && showTermDocCountError) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta) && showTermDocCountError) { bucketDocCountError = in.readLong(); } InternalAggregations aggregations = InternalAggregations.readAggregations(in); @@ -151,13 +151,13 @@ public class DoubleTerms extends InternalTerms { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(name); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeLong(docCountError); } InternalOrder.Streams.writeOrder(order, out); ValueFormatterStreams.writeOptional(formatter, out); writeSize(requiredSize, out); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { writeSize(shardSize, out); out.writeBoolean(showTermDocCountError); } @@ -166,7 +166,7 @@ public class DoubleTerms extends InternalTerms { for (InternalTerms.Bucket bucket : buckets) { out.writeDouble(((Bucket) bucket).term); out.writeVLong(bucket.getDocCount()); - if (out.getVersion().onOrAfter(Version.V_1_4_0) && showTermDocCountError) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta) && showTermDocCountError) { out.writeLong(bucket.docCountError); } ((InternalAggregations) bucket.getAggregations()).writeTo(out); diff --git a/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/LongTerms.java b/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/LongTerms.java index eec4ded62d6..69aa5aef3cc 100644 --- a/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/LongTerms.java +++ b/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/LongTerms.java @@ -117,7 +117,7 @@ public class LongTerms extends InternalTerms { @Override public void readFrom(StreamInput in) throws IOException { this.name = in.readString(); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { this.docCountError = in.readLong(); } else { this.docCountError = -1; @@ -125,7 +125,7 @@ public class LongTerms extends InternalTerms { this.order = InternalOrder.Streams.readOrder(in); this.formatter = ValueFormatterStreams.readOptional(in); this.requiredSize = readSize(in); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { this.shardSize = readSize(in); this.showTermDocCountError = in.readBoolean(); } else { @@ -139,7 +139,7 @@ public class LongTerms extends InternalTerms { long term = in.readLong(); long docCount = in.readVLong(); long bucketDocCountError = -1; - if (in.getVersion().onOrAfter(Version.V_1_4_0) && showTermDocCountError) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta) && showTermDocCountError) { bucketDocCountError = in.readLong(); } InternalAggregations aggregations = InternalAggregations.readAggregations(in); @@ -152,13 +152,13 @@ public class LongTerms extends InternalTerms { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(name); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeLong(docCountError); } InternalOrder.Streams.writeOrder(order, out); ValueFormatterStreams.writeOptional(formatter, out); writeSize(requiredSize, out); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { writeSize(shardSize, out); out.writeBoolean(showTermDocCountError); } @@ -167,7 +167,7 @@ public class LongTerms extends InternalTerms { for (InternalTerms.Bucket bucket : buckets) { out.writeLong(((Bucket) bucket).term); out.writeVLong(bucket.getDocCount()); - if (out.getVersion().onOrAfter(Version.V_1_4_0) && showTermDocCountError) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta) && showTermDocCountError) { out.writeLong(bucket.docCountError); } ((InternalAggregations) bucket.getAggregations()).writeTo(out); diff --git a/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/StringTerms.java b/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/StringTerms.java index 67999f53398..a7a7a4edf61 100644 --- a/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/StringTerms.java +++ b/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/StringTerms.java @@ -115,14 +115,14 @@ public class StringTerms extends InternalTerms { @Override public void readFrom(StreamInput in) throws IOException { this.name = in.readString(); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { this.docCountError = in.readLong(); } else { this.docCountError = -1; } this.order = InternalOrder.Streams.readOrder(in); this.requiredSize = readSize(in); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { this.shardSize = readSize(in); this.showTermDocCountError = in.readBoolean(); } else { @@ -136,7 +136,7 @@ public class StringTerms extends InternalTerms { BytesRef termBytes = in.readBytesRef(); long docCount = in.readVLong(); long bucketDocCountError = -1; - if (in.getVersion().onOrAfter(Version.V_1_4_0) && showTermDocCountError) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta) && showTermDocCountError) { bucketDocCountError = in.readLong(); } InternalAggregations aggregations = InternalAggregations.readAggregations(in); @@ -149,12 +149,12 @@ public class StringTerms extends InternalTerms { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(name); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeLong(docCountError); } InternalOrder.Streams.writeOrder(order, out); writeSize(requiredSize, out); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { writeSize(shardSize, out); out.writeBoolean(showTermDocCountError); } @@ -163,7 +163,7 @@ public class StringTerms extends InternalTerms { for (InternalTerms.Bucket bucket : buckets) { out.writeBytesRef(((Bucket) bucket).termBytes); out.writeVLong(bucket.getDocCount()); - if (out.getVersion().onOrAfter(Version.V_1_4_0) && showTermDocCountError) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta) && showTermDocCountError) { out.writeLong(bucket.docCountError); } ((InternalAggregations) bucket.getAggregations()).writeTo(out); diff --git a/src/main/java/org/elasticsearch/search/internal/InternalSearchResponse.java b/src/main/java/org/elasticsearch/search/internal/InternalSearchResponse.java index e2fb5b5c557..57d17e019ad 100644 --- a/src/main/java/org/elasticsearch/search/internal/InternalSearchResponse.java +++ b/src/main/java/org/elasticsearch/search/internal/InternalSearchResponse.java @@ -113,7 +113,7 @@ public class InternalSearchResponse implements Streamable, ToXContent { } timedOut = in.readBoolean(); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { terminatedEarly = in.readOptionalBoolean(); } } @@ -135,7 +135,7 @@ public class InternalSearchResponse implements Streamable, ToXContent { } out.writeBoolean(timedOut); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeOptionalBoolean(terminatedEarly); } diff --git a/src/main/java/org/elasticsearch/search/internal/ShardSearchRequest.java b/src/main/java/org/elasticsearch/search/internal/ShardSearchRequest.java index 00c4722d87b..67b255fdc97 100644 --- a/src/main/java/org/elasticsearch/search/internal/ShardSearchRequest.java +++ b/src/main/java/org/elasticsearch/search/internal/ShardSearchRequest.java @@ -273,7 +273,7 @@ public class ShardSearchRequest extends TransportRequest implements IndicesReque useSlowScroll = in.getVersion().before(ParsedScrollId.SCROLL_SEARCH_AFTER_MINIMUM_VERSION); } - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { queryCache = in.readOptionalBoolean(); } originalIndices = OriginalIndices.readOptionalOriginalIndices(in); @@ -322,7 +322,7 @@ public class ShardSearchRequest extends TransportRequest implements IndicesReque out.writeBoolean(useSlowScroll); } - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeOptionalBoolean(queryCache); } OriginalIndices.writeOptionalOriginalIndices(originalIndices, out); diff --git a/src/main/java/org/elasticsearch/search/query/QuerySearchResult.java b/src/main/java/org/elasticsearch/search/query/QuerySearchResult.java index 64d0241d675..33b4e7e4d1f 100644 --- a/src/main/java/org/elasticsearch/search/query/QuerySearchResult.java +++ b/src/main/java/org/elasticsearch/search/query/QuerySearchResult.java @@ -164,7 +164,7 @@ public class QuerySearchResult extends QuerySearchResultProvider { suggest = Suggest.readSuggest(Suggest.Fields.SUGGEST, in); } searchTimedOut = in.readBoolean(); - if (in.getVersion().onOrAfter(Version.V_1_4_0)) { + if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { terminatedEarly = in.readOptionalBoolean(); } } @@ -194,7 +194,7 @@ public class QuerySearchResult extends QuerySearchResultProvider { suggest.writeTo(out); } out.writeBoolean(searchTimedOut); - if (out.getVersion().onOrAfter(Version.V_1_4_0)) { + if (out.getVersion().onOrAfter(Version.V_1_4_0_Beta)) { out.writeOptionalBoolean(terminatedEarly); } } diff --git a/src/main/java/org/elasticsearch/search/suggest/Suggest.java b/src/main/java/org/elasticsearch/search/suggest/Suggest.java index 6b5c0a67759..9e847d5ad77 100644 --- a/src/main/java/org/elasticsearch/search/suggest/Suggest.java +++ b/src/main/java/org/elasticsearch/search/suggest/Suggest.java @@ -589,7 +589,7 @@ public class Suggest implements Iterable actionsVersions = new HashMap<>(); static { - actionsVersions.put(BenchmarkService.STATUS_ACTION_NAME, Version.V_1_4_0); - actionsVersions.put(BenchmarkService.START_ACTION_NAME, Version.V_1_4_0); - actionsVersions.put(BenchmarkService.ABORT_ACTION_NAME, Version.V_1_4_0); - actionsVersions.put(BenchmarkAction.NAME, Version.V_1_4_0); - actionsVersions.put(BenchmarkStatusAction.NAME, Version.V_1_4_0); - actionsVersions.put(AbortBenchmarkAction.NAME, Version.V_1_4_0); - actionsVersions.put(GetIndexAction.NAME, Version.V_1_4_0); + actionsVersions.put(BenchmarkService.STATUS_ACTION_NAME, Version.V_1_4_0_Beta); + actionsVersions.put(BenchmarkService.START_ACTION_NAME, Version.V_1_4_0_Beta); + actionsVersions.put(BenchmarkService.ABORT_ACTION_NAME, Version.V_1_4_0_Beta); + actionsVersions.put(BenchmarkAction.NAME, Version.V_1_4_0_Beta); + actionsVersions.put(BenchmarkStatusAction.NAME, Version.V_1_4_0_Beta); + actionsVersions.put(AbortBenchmarkAction.NAME, Version.V_1_4_0_Beta); + actionsVersions.put(GetIndexAction.NAME, Version.V_1_4_0_Beta); - actionsVersions.put(ExistsAction.NAME, Version.V_1_4_0); - actionsVersions.put(ExistsAction.NAME + "[s]", Version.V_1_4_0); + actionsVersions.put(ExistsAction.NAME, Version.V_1_4_0_Beta); + actionsVersions.put(ExistsAction.NAME + "[s]", Version.V_1_4_0_Beta); actionsVersions.put(IndicesStore.ACTION_SHARD_EXISTS, Version.V_1_3_0); diff --git a/src/test/java/org/elasticsearch/transport/ActionNamesTests.java b/src/test/java/org/elasticsearch/transport/ActionNamesTests.java index 3b44eb7c897..04be1d7c15a 100644 --- a/src/test/java/org/elasticsearch/transport/ActionNamesTests.java +++ b/src/test/java/org/elasticsearch/transport/ActionNamesTests.java @@ -80,7 +80,7 @@ public class ActionNamesTests extends ElasticsearchIntegrationTest { Version version = randomVersion(); String outgoingAction = ActionNames.outgoingAction(action, version); - if (version.onOrAfter(Version.V_1_4_0) || customAction || post_1_4_actions.contains(action)) { + if (version.onOrAfter(Version.V_1_4_0_Beta) || customAction || post_1_4_actions.contains(action)) { assertThat(outgoingAction, equalTo(action)); } else { assertThat(outgoingAction, not(equalTo(action))); @@ -103,7 +103,7 @@ public class ActionNamesTests extends ElasticsearchIntegrationTest { if (customAction) { action = randomAsciiOfLength(randomInt(30)); } else { - if (version.before(Version.V_1_4_0)) { + if (version.before(Version.V_1_4_0_Beta)) { action = randomFrom(pre_1_4_names); } else { action = randomFrom(actions); @@ -111,7 +111,7 @@ public class ActionNamesTests extends ElasticsearchIntegrationTest { } String incomingAction = ActionNames.incomingAction (action, version); - if (version.onOrAfter(Version.V_1_4_0) || customAction) { + if (version.onOrAfter(Version.V_1_4_0_Beta) || customAction) { assertThat(incomingAction, equalTo(action)); } else { assertThat(incomingAction, not(equalTo(action)));