diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/StringStatsAggregationBuilder.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/StringStatsAggregationBuilder.java index 981e6de9c9414..13a72ee64c03f 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/StringStatsAggregationBuilder.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/StringStatsAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.client.analytics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.index.query.QueryRewriteContext; @@ -125,6 +126,6 @@ public boolean equals(Object obj) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/TopMetricsAggregationBuilder.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/TopMetricsAggregationBuilder.java index 5af136f75bb71..335f96615d607 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/TopMetricsAggregationBuilder.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/TopMetricsAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.client.analytics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.index.query.QueryRewriteContext; @@ -102,6 +103,6 @@ protected AggregationBuilder shallowCopy(Builder factoriesBuilder, Map new Bucket(stream, format)); this.targetBuckets = in.readVInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { bucketInnerInterval = in.readVLong(); } else { bucketInnerInterval = 1; // Calculated on merge. @@ -239,7 +239,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeNamedWriteable(format); out.writeCollection(buckets); out.writeVInt(targetBuckets); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { out.writeVLong(bucketInnerInterval); } } diff --git a/modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/timeseries/TimeSeriesAggregationBuilder.java b/modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/timeseries/TimeSeriesAggregationBuilder.java index 405a382373752..e7ec383e637ef 100644 --- a/modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/timeseries/TimeSeriesAggregationBuilder.java +++ b/modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/timeseries/TimeSeriesAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.aggregations.bucket.timeseries; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; @@ -161,6 +162,6 @@ public int hashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_1_0; + return TransportVersions.V_8_1_0; } } diff --git a/modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/MatrixStatsAggregationBuilder.java b/modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/MatrixStatsAggregationBuilder.java index d8edb19c2782b..ee6157f92a82d 100644 --- a/modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/MatrixStatsAggregationBuilder.java +++ b/modules/aggregations/src/main/java/org/elasticsearch/aggregations/metric/MatrixStatsAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.aggregations.metric; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.MultiValueMode; @@ -55,14 +56,14 @@ public boolean supportsSampling() { */ public MatrixStatsAggregationBuilder(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { multiValueMode = MultiValueMode.readMultiValueModeFrom(in); } } @Override protected void innerWriteTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { multiValueMode.writeTo(out); } } @@ -99,6 +100,6 @@ public String getType() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java b/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java index 53fb057cc9dcc..b53269608e078 100644 --- a/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java +++ b/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -215,6 +216,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java b/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java index 073d3dd3f7782..ad26d8ed59438 100644 --- a/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java +++ b/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder; @@ -194,6 +195,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/DerivativePipelineAggregationBuilder.java b/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/DerivativePipelineAggregationBuilder.java index 32a8b5897ae87..b4ac7387c6955 100644 --- a/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/DerivativePipelineAggregationBuilder.java +++ b/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/DerivativePipelineAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Rounding; import org.elasticsearch.common.io.stream.StreamInput; @@ -257,6 +258,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_4_0; + return TransportVersions.V_7_4_0; } } diff --git a/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/MovFnPipelineAggregationBuilder.java b/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/MovFnPipelineAggregationBuilder.java index 821869424c447..35d5a97aa854f 100644 --- a/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/MovFnPipelineAggregationBuilder.java +++ b/modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/MovFnPipelineAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -240,6 +241,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/modules/aggregations/src/test/java/org/elasticsearch/aggregations/bucket/histogram/InternalAutoDateHistogramTests.java b/modules/aggregations/src/test/java/org/elasticsearch/aggregations/bucket/histogram/InternalAutoDateHistogramTests.java index ecdf112a560ab..6b59aa6e84657 100644 --- a/modules/aggregations/src/test/java/org/elasticsearch/aggregations/bucket/histogram/InternalAutoDateHistogramTests.java +++ b/modules/aggregations/src/test/java/org/elasticsearch/aggregations/bucket/histogram/InternalAutoDateHistogramTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.aggregations.bucket.histogram; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.aggregations.bucket.AggregationMultiBucketAggregationTestCase; import org.elasticsearch.aggregations.bucket.histogram.AutoDateHistogramAggregationBuilder.RoundingInfo; import org.elasticsearch.aggregations.bucket.histogram.InternalAutoDateHistogram.BucketInfo; @@ -477,8 +478,8 @@ public void testSerializationPre830() throws IOException { ); TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, - TransportVersionUtils.getPreviousVersion(TransportVersion.V_8_3_0) + TransportVersions.MINIMUM_COMPATIBLE, + TransportVersionUtils.getPreviousVersion(TransportVersions.V_8_3_0) ); InternalAutoDateHistogram deserialized = copyInstance(instance, version); assertEquals(1, deserialized.getBucketInnerInterval()); @@ -504,7 +505,7 @@ public void testReadFromPre830() throws IOException { + "AAyAAAAZAF5BHllYXIAAARib29sAQAAAAAAAAAKZAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" ); try (StreamInput in = new NamedWriteableAwareStreamInput(new BytesArray(bytes).streamInput(), getNamedWriteableRegistry())) { - in.setTransportVersion(TransportVersion.V_8_2_0); + in.setTransportVersion(TransportVersions.V_8_2_0); InternalAutoDateHistogram deserialized = new InternalAutoDateHistogram(in); assertEquals("name", deserialized.getName()); assertEquals(1, deserialized.getBucketInnerInterval()); diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java index 44b10ebab2f87..a41c42260dece 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.ingest.common; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; @@ -61,7 +61,7 @@ public Request(boolean sorted, String ecsCompatibility) { Request(StreamInput in) throws IOException { super(in); this.sorted = in.readBoolean(); - this.ecsCompatibility = in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0) + this.ecsCompatibility = in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0) ? in.readString() : GrokProcessor.DEFAULT_ECS_COMPATIBILITY_MODE; } @@ -75,7 +75,7 @@ public ActionRequestValidationException validate() { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeBoolean(sorted); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeString(ecsCompatibility); } } diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskParams.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskParams.java index a8fe538f954d5..276f67f6ee736 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskParams.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskParams.java @@ -9,6 +9,7 @@ package org.elasticsearch.ingest.geoip; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.persistent.PersistentTaskParams; @@ -42,7 +43,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_13_0; + return TransportVersions.V_7_13_0; } @Override diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java index 6e5bdff13bcf6..589950116e0af 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java @@ -9,6 +9,7 @@ package org.elasticsearch.ingest.geoip; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.VersionedNamedWriteable; @@ -122,7 +123,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_13_0; + return TransportVersions.V_7_13_0; } @Override diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStatsAction.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStatsAction.java index 57a67ac51ffa4..71995864b0233 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStatsAction.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStatsAction.java @@ -8,7 +8,7 @@ package org.elasticsearch.ingest.geoip.stats; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.FailedNodeException; import org.elasticsearch.action.support.nodes.BaseNodeResponse; @@ -166,7 +166,7 @@ protected NodeResponse(StreamInput in) throws IOException { stats = in.readBoolean() ? new GeoIpDownloaderStats(in) : null; databases = in.readCollectionAsImmutableSet(StreamInput::readString); filesInTemp = in.readCollectionAsImmutableSet(StreamInput::readString); - configDatabases = in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0) + configDatabases = in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0) ? in.readCollectionAsImmutableSet(StreamInput::readString) : null; } @@ -210,7 +210,7 @@ public void writeTo(StreamOutput out) throws IOException { } out.writeStringCollection(databases); out.writeStringCollection(filesInTemp); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeStringCollection(configDatabases); } } diff --git a/modules/lang-mustache/src/internalClusterTest/java/org/elasticsearch/script/mustache/MultiSearchTemplateIT.java b/modules/lang-mustache/src/internalClusterTest/java/org/elasticsearch/script/mustache/MultiSearchTemplateIT.java index d32848b529fdb..45a0f60f4e1b8 100644 --- a/modules/lang-mustache/src/internalClusterTest/java/org/elasticsearch/script/mustache/MultiSearchTemplateIT.java +++ b/modules/lang-mustache/src/internalClusterTest/java/org/elasticsearch/script/mustache/MultiSearchTemplateIT.java @@ -8,7 +8,7 @@ package org.elasticsearch.script.mustache; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.common.Strings; @@ -206,7 +206,7 @@ public void testCCSCheckCompatibility() throws Exception { "[fail_before_current_version] was released first in version %s, failed compatibility " + "check trying to send it to node with version %s", FailBeforeCurrentVersionQueryBuilder.FUTURE_VERSION, - TransportVersion.MINIMUM_CCS_VERSION + TransportVersions.MINIMUM_CCS_VERSION ); String actualCause = ex.getCause().getMessage(); assertEquals(expectedCause, actualCause); diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateResponse.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateResponse.java index f426480155356..ae4d3469f96c4 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateResponse.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateResponse.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ExceptionsHelper; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.search.MultiSearchResponse; import org.elasticsearch.common.Strings; @@ -102,7 +102,7 @@ public String toString() { MultiSearchTemplateResponse(StreamInput in) throws IOException { super(in); items = in.readArray(Item::new, Item[]::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_0_0)) { tookInMillis = in.readVLong(); } else { tookInMillis = -1L; @@ -136,7 +136,7 @@ public TimeValue getTook() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeArray(items); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_0_0)) { out.writeVLong(tookInMillis); } } diff --git a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureQueryBuilder.java b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureQueryBuilder.java index 28424a9e52891..0e9b293fe9fd0 100644 --- a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureQueryBuilder.java +++ b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureQueryBuilder.java @@ -12,6 +12,7 @@ import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.index.mapper.MappedFieldType; @@ -414,6 +415,6 @@ protected int doHashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ChildrenAggregationBuilder.java b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ChildrenAggregationBuilder.java index f191dfcda3bd5..57649129a638f 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ChildrenAggregationBuilder.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ChildrenAggregationBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -181,6 +182,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParentAggregationBuilder.java b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParentAggregationBuilder.java index c131be17c5e19..c5a285de70577 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParentAggregationBuilder.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParentAggregationBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -179,6 +180,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java b/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java index 9738bbd43c31a..0892690b79c0a 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java @@ -19,6 +19,7 @@ import org.apache.lucene.search.similarities.Similarity; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -541,6 +542,6 @@ protected void extractInnerHitBuilders(Map inner @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasParentQueryBuilder.java b/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasParentQueryBuilder.java index f3777c526994a..962916cc04645 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasParentQueryBuilder.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasParentQueryBuilder.java @@ -12,6 +12,7 @@ import org.apache.lucene.search.join.ScoreMode; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -313,6 +314,6 @@ protected void extractInnerHitBuilders(Map inner @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/query/ParentIdQueryBuilder.java b/modules/parent-join/src/main/java/org/elasticsearch/join/query/ParentIdQueryBuilder.java index 7d15bbcedf8fd..8fb72ddce1935 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/query/ParentIdQueryBuilder.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/query/ParentIdQueryBuilder.java @@ -16,6 +16,7 @@ import org.apache.lucene.search.TermQuery; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -193,6 +194,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java index b79737f07d953..eac647cfff634 100644 --- a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java +++ b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java @@ -34,6 +34,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.get.GetRequest; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.InputStreamStreamInput; @@ -216,12 +217,12 @@ protected PercolateQueryBuilder(String field, Supplier documentS super(in); field = in.readString(); name = in.readOptionalString(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { String documentType = in.readOptionalString(); assert documentType == null; } indexedDocumentIndex = in.readOptionalString(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { String indexedDocumentType = in.readOptionalString(); assert indexedDocumentType == null; } @@ -258,12 +259,12 @@ protected void doWriteTo(StreamOutput out) throws IOException { } out.writeString(field); out.writeOptionalString(name); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { // In 7x, typeless percolate queries are represented by null documentType values out.writeOptionalString(null); } out.writeOptionalString(indexedDocumentIndex); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { // In 7x, typeless percolate queries are represented by null indexedDocumentType values out.writeOptionalString(null); } @@ -667,6 +668,6 @@ public > IFD getForField( @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalRequest.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalRequest.java index d6a9a25be51f2..d62e6f7426cab 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalRequest.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.rankeval; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.IndicesRequest; @@ -45,7 +45,7 @@ public RankEvalRequest(RankEvalSpec rankingEvaluationSpec, String[] indices) { rankingEvaluationSpec = new RankEvalSpec(in); indices = in.readStringArray(); indicesOptions = IndicesOptions.readIndicesOptions(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { searchType = SearchType.fromId(in.readByte()); } } @@ -126,7 +126,7 @@ public void writeTo(StreamOutput out) throws IOException { rankingEvaluationSpec.writeTo(out); out.writeStringArray(indices); indicesOptions.writeIndicesOptions(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { out.writeByte(searchType.id()); } } diff --git a/modules/rest-root/src/main/java/org/elasticsearch/rest/root/MainResponse.java b/modules/rest-root/src/main/java/org/elasticsearch/rest/root/MainResponse.java index 4ce93563ceb22..f4dffe738186b 100644 --- a/modules/rest-root/src/main/java/org/elasticsearch/rest/root/MainResponse.java +++ b/modules/rest-root/src/main/java/org/elasticsearch/rest/root/MainResponse.java @@ -10,6 +10,7 @@ import org.elasticsearch.Build; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.cluster.ClusterName; @@ -38,7 +39,7 @@ public class MainResponse extends ActionResponse implements ToXContentObject { MainResponse(StreamInput in) throws IOException { super(in); nodeName = in.readString(); - if (in.getTransportVersion().before(TransportVersion.V_8_500_041)) { + if (in.getTransportVersion().before(TransportVersions.V_8_500_041)) { Version.readVersion(in); } @@ -48,13 +49,13 @@ public class MainResponse extends ActionResponse implements ToXContentObject { // the lucene version was previously read by inferring from either Version or IndexVersion. // Now the lucene version is read explicitly. String wireLuceneVersion = null; - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_037)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_037)) { wireLuceneVersion = in.readString(); } else { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_031)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_031)) { wireLuceneVersion = IndexVersion.readVersion(in).luceneVersion().toString(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_019)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_019)) { TransportVersion.readVersion(in); } } @@ -99,7 +100,7 @@ public Build getBuild() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(nodeName); - if (out.getTransportVersion().before(TransportVersion.V_8_500_041)) { + if (out.getTransportVersion().before(TransportVersions.V_8_500_041)) { Version.writeVersion(Version.CURRENT, out); } @@ -108,13 +109,13 @@ public void writeTo(StreamOutput out) throws IOException { // for those versions until the new format has propagated through serverless. Additionally, // the lucene version was previously inferred from either Version or IndexVersion. // Now the lucene version is written explicitly. - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_037)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_037)) { out.writeString(luceneVersion); } else { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_031)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_031)) { IndexVersion.writeVersion(IndexVersion.current(), out); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_019)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_019)) { TransportVersion.writeVersion(TransportVersion.current(), out); } } diff --git a/modules/transport-netty4/src/test/java/org/elasticsearch/transport/netty4/SimpleNetty4TransportTests.java b/modules/transport-netty4/src/test/java/org/elasticsearch/transport/netty4/SimpleNetty4TransportTests.java index 028de6c98d432..c2727f206a07c 100644 --- a/modules/transport-netty4/src/test/java/org/elasticsearch/transport/netty4/SimpleNetty4TransportTests.java +++ b/modules/transport-netty4/src/test/java/org/elasticsearch/transport/netty4/SimpleNetty4TransportTests.java @@ -10,6 +10,7 @@ import org.apache.lucene.util.Constants; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeUtils; @@ -79,7 +80,7 @@ public void executeHandshake( super.executeHandshake(node, channel, profile, listener); } else { assert getVersion().equals(TransportVersion.current()); - listener.onResponse(TransportVersion.MINIMUM_COMPATIBLE); + listener.onResponse(TransportVersions.MINIMUM_COMPATIBLE); } } }; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/search/TransportSearchIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/search/TransportSearchIT.java index 006a10e99489f..655a13c154338 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/search/TransportSearchIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/search/TransportSearchIT.java @@ -11,6 +11,7 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.search.ScoreMode; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.cluster.node.stats.NodeStats; import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsResponse; @@ -634,7 +635,7 @@ public long bytesToPreallocate() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScorePluginIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScorePluginIT.java index 1794ea8fbfab9..5c9c54a0d3b19 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScorePluginIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScorePluginIT.java @@ -10,6 +10,7 @@ import org.apache.lucene.search.Explanation; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionFuture; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.search.SearchRequest; @@ -137,7 +138,7 @@ public DecayFunction getDecayFunction() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } private static final DecayFunction decayFunction = new LinearMultScoreFunction(); diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/msearch/MultiSearchIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/msearch/MultiSearchIT.java index cc3d21efd71bc..c8a12b7a90e30 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/msearch/MultiSearchIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/msearch/MultiSearchIT.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.msearch; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.search.MultiSearchRequest; import org.elasticsearch.action.search.MultiSearchResponse; import org.elasticsearch.common.settings.Settings; @@ -87,7 +88,7 @@ public void testSimpleMultiSearchMoreRequests() { * Test that triggering the CCS compatibility check with a query that shouldn't go to the minor before Version.CURRENT works */ public void testCCSCheckCompatibility() throws Exception { - TransportVersion transportVersion = TransportVersionUtils.getNextVersion(TransportVersion.MINIMUM_CCS_VERSION, true); + TransportVersion transportVersion = TransportVersionUtils.getNextVersion(TransportVersions.MINIMUM_CCS_VERSION, true); createIndex("test"); ensureGreen(); client().prepareIndex("test").setId("1").setSource("field", "xxx").get(); diff --git a/server/src/main/java/org/elasticsearch/Build.java b/server/src/main/java/org/elasticsearch/Build.java index 9a7ea5fb79455..2422f14b981cb 100644 --- a/server/src/main/java/org/elasticsearch/Build.java +++ b/server/src/main/java/org/elasticsearch/Build.java @@ -191,7 +191,7 @@ static URL getElasticsearchCodeSourceLocation() { public static Build readBuild(StreamInput in) throws IOException { final String flavor; - if (in.getTransportVersion().before(TransportVersion.V_8_3_0) || in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_039)) { + if (in.getTransportVersion().before(TransportVersions.V_8_3_0) || in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_039)) { flavor = in.readString(); } else { flavor = "default"; @@ -205,7 +205,7 @@ public static Build readBuild(StreamInput in) throws IOException { final String minWireVersion; final String minIndexVersion; final String displayString; - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_041)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_041)) { minWireVersion = in.readString(); minIndexVersion = in.readString(); displayString = in.readString(); @@ -221,8 +221,8 @@ public static Build readBuild(StreamInput in) throws IOException { } public static void writeBuild(Build build, StreamOutput out) throws IOException { - if (out.getTransportVersion().before(TransportVersion.V_8_3_0) - || out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_039)) { + if (out.getTransportVersion().before(TransportVersions.V_8_3_0) + || out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_039)) { out.writeString(build.flavor()); } out.writeString(build.type().displayName()); @@ -230,7 +230,7 @@ public static void writeBuild(Build build, StreamOutput out) throws IOException out.writeString(build.date()); out.writeBoolean(build.isSnapshot()); out.writeString(build.qualifiedVersion()); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_041)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_041)) { out.writeString(build.minWireCompatVersion()); out.writeString(build.minIndexCompatVersion()); out.writeString(build.displayString()); diff --git a/server/src/main/java/org/elasticsearch/ElasticsearchException.java b/server/src/main/java/org/elasticsearch/ElasticsearchException.java index 37ce651f1a311..585fe7ad9dd27 100644 --- a/server/src/main/java/org/elasticsearch/ElasticsearchException.java +++ b/server/src/main/java/org/elasticsearch/ElasticsearchException.java @@ -72,7 +72,7 @@ */ public class ElasticsearchException extends RuntimeException implements ToXContentFragment, Writeable { - private static final TransportVersion UNKNOWN_VERSION_ADDED = TransportVersion.ZERO; + private static final TransportVersion UNKNOWN_VERSION_ADDED = TransportVersions.ZERO; /** * Passed in the {@link Params} of {@link #generateThrowableXContent(XContentBuilder, Params, Throwable)} @@ -305,7 +305,7 @@ protected void writeTo(StreamOutput out, Writer nestedExceptionsWrite public static ElasticsearchException readException(StreamInput input, int id) throws IOException { CheckedFunction elasticsearchException = ID_TO_SUPPLIER.get(id); if (elasticsearchException == null) { - if (id == 127 && input.getTransportVersion().before(TransportVersion.V_7_5_0)) { + if (id == 127 && input.getTransportVersion().before(TransportVersions.V_7_5_0)) { // was SearchContextException return new SearchException(input); } @@ -1729,7 +1729,7 @@ private enum ElasticsearchExceptionHandle { org.elasticsearch.cluster.coordination.CoordinationStateRejectedException.class, org.elasticsearch.cluster.coordination.CoordinationStateRejectedException::new, 150, - TransportVersion.V_7_0_0 + TransportVersions.V_7_0_0 ), SNAPSHOT_IN_PROGRESS_EXCEPTION( org.elasticsearch.snapshots.SnapshotInProgressException.class, @@ -1765,88 +1765,88 @@ private enum ElasticsearchExceptionHandle { org.elasticsearch.index.seqno.RetentionLeaseInvalidRetainingSeqNoException.class, org.elasticsearch.index.seqno.RetentionLeaseInvalidRetainingSeqNoException::new, 156, - TransportVersion.V_7_5_0 + TransportVersions.V_7_5_0 ), INGEST_PROCESSOR_EXCEPTION( org.elasticsearch.ingest.IngestProcessorException.class, org.elasticsearch.ingest.IngestProcessorException::new, 157, - TransportVersion.V_7_5_0 + TransportVersions.V_7_5_0 ), PEER_RECOVERY_NOT_FOUND_EXCEPTION( org.elasticsearch.indices.recovery.PeerRecoveryNotFound.class, org.elasticsearch.indices.recovery.PeerRecoveryNotFound::new, 158, - TransportVersion.V_7_9_0 + TransportVersions.V_7_9_0 ), NODE_HEALTH_CHECK_FAILURE_EXCEPTION( org.elasticsearch.cluster.coordination.NodeHealthCheckFailureException.class, org.elasticsearch.cluster.coordination.NodeHealthCheckFailureException::new, 159, - TransportVersion.V_8_0_0 + TransportVersions.V_8_0_0 ), NO_SEED_NODE_LEFT_EXCEPTION( org.elasticsearch.transport.NoSeedNodeLeftException.class, org.elasticsearch.transport.NoSeedNodeLeftException::new, 160, - TransportVersion.V_7_10_0 + TransportVersions.V_7_10_0 ), VERSION_MISMATCH_EXCEPTION( org.elasticsearch.action.search.VersionMismatchException.class, org.elasticsearch.action.search.VersionMismatchException::new, 161, - TransportVersion.V_7_12_0 + TransportVersions.V_7_12_0 ), AUTHENTICATION_PROCESSING_ERROR( org.elasticsearch.ElasticsearchAuthenticationProcessingError.class, org.elasticsearch.ElasticsearchAuthenticationProcessingError::new, 162, - TransportVersion.V_7_16_0 + TransportVersions.V_7_16_0 ), REPOSITORY_CONFLICT_EXCEPTION( org.elasticsearch.repositories.RepositoryConflictException.class, org.elasticsearch.repositories.RepositoryConflictException::new, 163, - TransportVersion.V_8_0_0 + TransportVersions.V_8_0_0 ), DESIRED_NODES_VERSION_CONFLICT_EXCEPTION( org.elasticsearch.cluster.desirednodes.VersionConflictException.class, org.elasticsearch.cluster.desirednodes.VersionConflictException::new, 164, - TransportVersion.V_8_1_0 + TransportVersions.V_8_1_0 ), SNAPSHOT_NAME_ALREADY_IN_USE_EXCEPTION( org.elasticsearch.snapshots.SnapshotNameAlreadyInUseException.class, org.elasticsearch.snapshots.SnapshotNameAlreadyInUseException::new, 165, - TransportVersion.V_8_2_0 + TransportVersions.V_8_2_0 ), HEALTH_NODE_NOT_DISCOVERED_EXCEPTION( HealthNodeNotDiscoveredException.class, HealthNodeNotDiscoveredException::new, 166, - TransportVersion.V_8_5_0 + TransportVersions.V_8_5_0 ), UNSUPPORTED_AGGREGATION_ON_DOWNSAMPLED_INDEX_EXCEPTION( UnsupportedAggregationOnDownsampledIndex.class, UnsupportedAggregationOnDownsampledIndex::new, 167, - TransportVersion.V_8_5_0 + TransportVersions.V_8_5_0 ), - DOCUMENT_PARSING_EXCEPTION(DocumentParsingException.class, DocumentParsingException::new, 168, TransportVersion.V_8_8_0), + DOCUMENT_PARSING_EXCEPTION(DocumentParsingException.class, DocumentParsingException::new, 168, TransportVersions.V_8_8_0), HTTP_HEADERS_VALIDATION_EXCEPTION( org.elasticsearch.http.HttpHeadersValidationException.class, org.elasticsearch.http.HttpHeadersValidationException::new, 169, - TransportVersion.V_8_500_010 + TransportVersions.V_8_500_010 ), ROLE_RESTRICTION_EXCEPTION( ElasticsearchRoleRestrictionException.class, ElasticsearchRoleRestrictionException::new, 170, - TransportVersion.V_8_500_016 + TransportVersions.V_8_500_016 ), - API_NOT_AVAILABLE_EXCEPTION(ApiNotAvailableException.class, ApiNotAvailableException::new, 171, TransportVersion.V_8_500_065); + API_NOT_AVAILABLE_EXCEPTION(ApiNotAvailableException.class, ApiNotAvailableException::new, 171, TransportVersions.V_8_500_065); final Class exceptionClass; final CheckedFunction constructor; diff --git a/server/src/main/java/org/elasticsearch/TransportVersion.java b/server/src/main/java/org/elasticsearch/TransportVersion.java index e9ba2769441b4..040dfbc0e4c8a 100644 --- a/server/src/main/java/org/elasticsearch/TransportVersion.java +++ b/server/src/main/java/org/elasticsearch/TransportVersion.java @@ -8,22 +8,14 @@ package org.elasticsearch; -import org.elasticsearch.common.Strings; import org.elasticsearch.common.VersionId; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.core.Assertions; import org.elasticsearch.internal.VersionExtension; import java.io.IOException; -import java.lang.reflect.Field; -import java.util.Collection; -import java.util.Collections; import java.util.HashMap; import java.util.Map; -import java.util.NavigableMap; -import java.util.Set; -import java.util.TreeMap; /** * Represents the version of the wire protocol used to communicate between a pair of ES nodes. @@ -41,12 +33,12 @@ * those two merged commits. * *

Version compatibility

- * The earliest compatible version is hardcoded in the {@link #MINIMUM_COMPATIBLE} field. Previously, this was dynamically calculated from + * The earliest compatible version is hardcoded in the {@link TransportVersions#MINIMUM_COMPATIBLE} field. Previously, this was dynamically calculated from * the major/minor versions of {@link Version}, but {@code TransportVersion} does not have separate major/minor version numbers. So the * minimum compatible version is hard-coded as the transport version used by the highest minor release of the previous major version. {@link - * #MINIMUM_COMPATIBLE} should be updated appropriately whenever a major release happens. + * TransportVersions#MINIMUM_COMPATIBLE} should be updated appropriately whenever a major release happens. *

- * The earliest CCS compatible version is hardcoded at {@link #MINIMUM_CCS_VERSION}, as the transport version used by the previous minor + * The earliest CCS compatible version is hardcoded at {@link TransportVersions#MINIMUM_CCS_VERSION}, as the transport version used by the previous minor * release. This should be updated appropriately whenever a minor release happens. * *

Scope of usefulness of {@link TransportVersion}

@@ -59,249 +51,12 @@ */ public record TransportVersion(int id) implements VersionId { - /* - * NOTE: IntelliJ lies! - * This map is used during class construction, referenced by the registerTransportVersion method. - * When all the transport version constants have been registered, the map is cleared & never touched again. - */ - @SuppressWarnings("UnusedAssignment") - private static Map IDS = new HashMap<>(); - - private static TransportVersion registerTransportVersion(int id, String uniqueId) { - if (IDS == null) throw new IllegalStateException("The IDS map needs to be present to call this method"); - - Strings.requireNonEmpty(uniqueId, "Each TransportVersion needs a unique string id"); - Integer existing = IDS.put(uniqueId, id); - if (existing != null) { - throw new IllegalArgumentException("Versions " + id + " and " + existing + " have the same unique id"); - } - return new TransportVersion(id); - } - - public static final TransportVersion ZERO = registerTransportVersion(0, "00000000-0000-0000-0000-000000000000"); - public static final TransportVersion V_7_0_0 = registerTransportVersion(7_00_00_99, "7505fd05-d982-43ce-a63f-ff4c6c8bdeec"); - public static final TransportVersion V_7_0_1 = registerTransportVersion(7_00_01_99, "ae772780-e6f9-46a1-b0a0-20ed0cae37f7"); - public static final TransportVersion V_7_1_0 = registerTransportVersion(7_01_00_99, "fd09007c-1c54-450a-af99-9f941e1a53c2"); - public static final TransportVersion V_7_2_0 = registerTransportVersion(7_02_00_99, "b74dbc52-e727-472c-af21-2156482e8796"); - public static final TransportVersion V_7_2_1 = registerTransportVersion(7_02_01_99, "a3217b94-f436-4aab-a020-162c83ba18f2"); - public static final TransportVersion V_7_3_0 = registerTransportVersion(7_03_00_99, "4f04e4c9-c5aa-49e4-8b99-abeb4e284a5a"); - public static final TransportVersion V_7_3_2 = registerTransportVersion(7_03_02_99, "60da3953-8415-4d4f-a18d-853c3e68ebd6"); - public static final TransportVersion V_7_4_0 = registerTransportVersion(7_04_00_99, "ec7e58aa-55b4-4064-a9dd-fd723a2ba7a8"); - public static final TransportVersion V_7_5_0 = registerTransportVersion(7_05_00_99, "cc6e14dc-9dc7-4b74-8e15-1f99a6cfbe03"); - public static final TransportVersion V_7_6_0 = registerTransportVersion(7_06_00_99, "4637b8ae-f3df-43ae-a065-ad4c29f3373a"); - public static final TransportVersion V_7_7_0 = registerTransportVersion(7_07_00_99, "7bb73c48-ddb8-4437-b184-30371c35dd4b"); - public static final TransportVersion V_7_8_0 = registerTransportVersion(7_08_00_99, "c3cc74af-d15e-494b-a907-6ad6dd2f4660"); - public static final TransportVersion V_7_8_1 = registerTransportVersion(7_08_01_99, "7acb9f6e-32f2-45ce-b87d-ca1f165b8e7a"); - public static final TransportVersion V_7_9_0 = registerTransportVersion(7_09_00_99, "9388fe76-192a-4053-b51c-d2a7b8eae545"); - public static final TransportVersion V_7_10_0 = registerTransportVersion(7_10_00_99, "4efca195-38e4-4f74-b877-c26fb2a40733"); - public static final TransportVersion V_7_10_1 = registerTransportVersion(7_10_01_99, "0070260c-aa0b-4fc2-9c87-5cd5f23b005f"); - public static final TransportVersion V_7_11_0 = registerTransportVersion(7_11_00_99, "3b43bcbc-1c5e-4cc2-a3b4-8ac8b64239e8"); - public static final TransportVersion V_7_12_0 = registerTransportVersion(7_12_00_99, "3be9ff6f-2d9f-4fc2-ba91-394dd5ebcf33"); - public static final TransportVersion V_7_13_0 = registerTransportVersion(7_13_00_99, "e1fe494a-7c66-4571-8f8f-1d7e6d8df1b3"); - public static final TransportVersion V_7_14_0 = registerTransportVersion(7_14_00_99, "8cf0954c-b085-467f-b20b-3cb4b2e69e3e"); - public static final TransportVersion V_7_15_0 = registerTransportVersion(7_15_00_99, "2273ac0e-00bb-4024-9e2e-ab78981623c6"); - public static final TransportVersion V_7_15_1 = registerTransportVersion(7_15_01_99, "a8c3503d-3452-45cf-b385-e855e16547fe"); - public static final TransportVersion V_7_16_0 = registerTransportVersion(7_16_00_99, "59abadd2-25db-4547-a991-c92306a3934e"); - public static final TransportVersion V_7_17_0 = registerTransportVersion(7_17_00_99, "322efe93-4c73-4e15-9274-bb76836c8fa8"); - public static final TransportVersion V_7_17_1 = registerTransportVersion(7_17_01_99, "51c72842-7974-4669-ad25-bf13ba307307"); - public static final TransportVersion V_7_17_8 = registerTransportVersion(7_17_08_99, "82a3e70d-cf0e-4efb-ad16-6077ab9fe19f"); - public static final TransportVersion V_8_0_0 = registerTransportVersion(8_00_00_99, "c7d2372c-9f01-4a79-8b11-227d862dfe4f"); - public static final TransportVersion V_8_1_0 = registerTransportVersion(8_01_00_99, "3dc49dce-9cef-492a-ac8d-3cc79f6b4280"); - public static final TransportVersion V_8_2_0 = registerTransportVersion(8_02_00_99, "8ce6d555-202e-47db-ab7d-ade9dda1b7e8"); - public static final TransportVersion V_8_3_0 = registerTransportVersion(8_03_00_99, "559ddb66-d857-4208-bed5-a995ccf478ea"); - public static final TransportVersion V_8_4_0 = registerTransportVersion(8_04_00_99, "c0d12906-aa5b-45d4-94c7-cbcf4d9818ca"); - public static final TransportVersion V_8_5_0 = registerTransportVersion(8_05_00_99, "be3d7f23-7240-4904-9d7f-e25a0f766eca"); - public static final TransportVersion V_8_6_0 = registerTransportVersion(8_06_00_99, "e209c5ed-3488-4415-b561-33492ca3b789"); - public static final TransportVersion V_8_6_1 = registerTransportVersion(8_06_01_99, "9f113acb-1b21-4fda-bef9-2a3e669b5c7b"); - public static final TransportVersion V_8_7_0 = registerTransportVersion(8_07_00_99, "f1ee7a85-4fa6-43f5-8679-33e2b750448b"); - public static final TransportVersion V_8_7_1 = registerTransportVersion(8_07_01_99, "018de9d8-9e8b-4ac7-8f4b-3a6fbd0487fb"); - public static final TransportVersion V_8_8_0 = registerTransportVersion(8_08_00_99, "f64fe576-0767-4ec3-984e-3e30b33b6c46"); - public static final TransportVersion V_8_8_1 = registerTransportVersion(8_08_01_99, "291c71bb-5b0a-4b7e-a407-6e53bc128d0f"); - - /* - * READ THE COMMENT BELOW THIS BLOCK OF DECLARATIONS BEFORE ADDING NEW TRANSPORT VERSIONS - * Detached transport versions added below here. - */ - public static final TransportVersion V_8_500_010 = registerTransportVersion(8_500_010, "9818C628-1EEC-439B-B943-468F61460675"); - public static final TransportVersion V_8_500_011 = registerTransportVersion(8_500_011, "2209F28D-B52E-4BC4-9889-E780F291C32E"); - public static final TransportVersion V_8_500_012 = registerTransportVersion(8_500_012, "BB6F4AF1-A860-4FD4-A138-8150FFBE0ABD"); - public static final TransportVersion V_8_500_013 = registerTransportVersion(8_500_013, "f65b85ac-db5e-4558-a487-a1dde4f6a33a"); - public static final TransportVersion V_8_500_014 = registerTransportVersion(8_500_014, "D115A2E1-1739-4A02-AB7B-64F6EA157EFB"); - public static final TransportVersion V_8_500_015 = registerTransportVersion(8_500_015, "651216c9-d54f-4189-9fe1-48d82d276863"); - public static final TransportVersion V_8_500_016 = registerTransportVersion(8_500_016, "492C94FB-AAEA-4C9E-8375-BDB67A398584"); - public static final TransportVersion V_8_500_017 = registerTransportVersion(8_500_017, "0EDCB5BA-049C-443C-8AB1-5FA58FB996FB"); - public static final TransportVersion V_8_500_018 = registerTransportVersion(8_500_018, "827C32CE-33D9-4AC3-A773-8FB768F59EAF"); - public static final TransportVersion V_8_500_019 = registerTransportVersion(8_500_019, "09bae57f-cab8-423c-aab3-c9778509ffe3"); - public static final TransportVersion V_8_500_020 = registerTransportVersion(8_500_020, "ECB42C26-B258-42E5-A835-E31AF84A76DE"); - public static final TransportVersion V_8_500_021 = registerTransportVersion(8_500_021, "102e0d84-0c08-402c-a696-935f3a3da873"); - public static final TransportVersion V_8_500_022 = registerTransportVersion(8_500_022, "4993c724-7a81-4955-84e7-403484610091"); - public static final TransportVersion V_8_500_023 = registerTransportVersion(8_500_023, "01b06435-5d73-42ff-a121-3b36b771375e"); - public static final TransportVersion V_8_500_024 = registerTransportVersion(8_500_024, "db337007-f823-4dbd-968e-375383814c17"); - public static final TransportVersion V_8_500_025 = registerTransportVersion(8_500_025, "b2ab7b75-5ac2-4a3b-bbb6-8789ca66722d"); - public static final TransportVersion V_8_500_026 = registerTransportVersion(8_500_026, "965d294b-14aa-4abb-bcfc-34631187941d"); - public static final TransportVersion V_8_500_027 = registerTransportVersion(8_500_027, "B151D967-8E7C-401C-8275-0ABC06335F2D"); - public static final TransportVersion V_8_500_028 = registerTransportVersion(8_500_028, "a6592d08-15cb-4e1a-b9b4-b2ba24058444"); - public static final TransportVersion V_8_500_029 = registerTransportVersion(8_500_029, "f3bd98af-6187-e161-e315-718a2fecc2db"); - public static final TransportVersion V_8_500_030 = registerTransportVersion(8_500_030, "b72d7f12-8ed3-4a5b-8e6a-4910ea10e0d7"); - public static final TransportVersion V_8_500_031 = registerTransportVersion(8_500_031, "e7aa7e95-37e7-46a3-aad1-90a21c0769e7"); - public static final TransportVersion V_8_500_032 = registerTransportVersion(8_500_032, "a9a14bc6-c3f2-41d9-a3d8-c686bf2c901d"); - public static final TransportVersion V_8_500_033 = registerTransportVersion(8_500_033, "193ab7c4-a751-4cbd-a66a-2d7d56ccbc10"); - public static final TransportVersion V_8_500_034 = registerTransportVersion(8_500_034, "16871c8b-88ba-4432-980a-10fd9ecad2dc"); - public static final TransportVersion V_8_500_035 = registerTransportVersion(8_500_035, "664dd6ce-3487-4fbd-81a9-af778b28be45"); - public static final TransportVersion V_8_500_036 = registerTransportVersion(8_500_036, "3343c64f-d7ac-4f02-9262-3e1acfc56f89"); - public static final TransportVersion V_8_500_037 = registerTransportVersion(8_500_037, "d76a4f22-8878-43e0-acfa-15e452195fa7"); - public static final TransportVersion V_8_500_038 = registerTransportVersion(8_500_038, "9ef93580-feae-409f-9989-b49e411ca7a9"); - public static final TransportVersion V_8_500_039 = registerTransportVersion(8_500_039, "c23722d7-6139-4cf2-b8a1-600fbd4ec359"); - public static final TransportVersion V_8_500_040 = registerTransportVersion(8_500_040, "8F3AA068-A608-4A16-9683-2412A75BF2DD"); - public static final TransportVersion V_8_500_041 = registerTransportVersion(8_500_041, "5b6a0fd0-ac0b-443f-baae-cffec140905c"); - public static final TransportVersion V_8_500_042 = registerTransportVersion(8_500_042, "763b4801-a4fc-47c4-aff5-7f5a757b8a07"); - public static final TransportVersion V_8_500_043 = registerTransportVersion(8_500_043, "50babd14-7f5c-4f8c-9351-94e0d397aabc"); - public static final TransportVersion V_8_500_044 = registerTransportVersion(8_500_044, "96b83320-2317-4e9d-b735-356f18c1d76a"); - public static final TransportVersion V_8_500_045 = registerTransportVersion(8_500_045, "24a596dd-c843-4c0a-90b3-759697d74026"); - public static final TransportVersion V_8_500_046 = registerTransportVersion(8_500_046, "61666d4c-a4f0-40db-8a3d-4806718247c5"); - public static final TransportVersion V_8_500_047 = registerTransportVersion(8_500_047, "4b1682fe-c37e-4184-80f6-7d57fcba9b3d"); - public static final TransportVersion V_8_500_048 = registerTransportVersion(8_500_048, "f9658aa5-f066-4edb-bcb9-40bf256c9294"); - public static final TransportVersion V_8_500_049 = registerTransportVersion(8_500_049, "828bb6ce-2fbb-11ee-be56-0242ac120002"); - public static final TransportVersion V_8_500_050 = registerTransportVersion(8_500_050, "69722fa2-7c0a-4227-86fb-6d6a9a0a0321"); - public static final TransportVersion V_8_500_051 = registerTransportVersion(8_500_051, "a28b43bc-bb5f-4406-afcf-26900aa98a71"); - public static final TransportVersion V_8_500_052 = registerTransportVersion(8_500_052, "2d382b3d-9838-4cce-84c8-4142113e5c2b"); - public static final TransportVersion V_8_500_053 = registerTransportVersion(8_500_053, "aa603bae-01e2-380a-8950-6604468e8c6d"); - public static final TransportVersion V_8_500_054 = registerTransportVersion(8_500_054, "b76ef950-af03-4dda-85c2-6400ec442e7e"); - public static final TransportVersion V_8_500_055 = registerTransportVersion(8_500_055, "7831c609-0df1-42d6-aa97-8a346c389ef"); - public static final TransportVersion V_8_500_056 = registerTransportVersion(8_500_056, "afa8c4be-29c9-48ab-b1ed-7182415c1b71"); - public static final TransportVersion V_8_500_057 = registerTransportVersion(8_500_057, "80c088c6-358d-43b2-8d9c-1ea3c6c2b9fd"); - public static final TransportVersion V_8_500_058 = registerTransportVersion(8_500_058, "41d9c98a-1de2-4dc1-86f1-abd4cc1bef57"); - public static final TransportVersion V_8_500_059 = registerTransportVersion(8_500_059, "2f2090c0-7cd0-4a10-8f02-63d26073604f"); - public static final TransportVersion V_8_500_060 = registerTransportVersion(8_500_060, "ec065a44-b468-4f8a-aded-7b90ca8d792b"); - public static final TransportVersion V_8_500_061 = registerTransportVersion(8_500_061, "4e07f830-8be4-448c-851e-62b3d2f0bf0a"); - public static final TransportVersion V_8_500_062 = registerTransportVersion(8_500_062, "09CD9C9B-3207-4B40-8756-B7A12001A885"); - public static final TransportVersion V_8_500_063 = registerTransportVersion(8_500_063, "31dedced-0055-4f34-b952-2f6919be7488"); - public static final TransportVersion V_8_500_064 = registerTransportVersion(8_500_064, "3a795175-5e6f-40ff-90fe-5571ea8ab04e"); - public static final TransportVersion V_8_500_065 = registerTransportVersion(8_500_065, "4e253c58-1b3d-11ee-be56-0242ac120002"); - public static final TransportVersion V_8_500_066 = registerTransportVersion(8_500_066, "F398ECC6-5D2A-4BD8-A9E8-1101F030DF85"); - public static final TransportVersion V_8_500_067 = registerTransportVersion(8_500_067, "a7c86604-a917-4aff-9a1b-a4d44c3dbe02"); - public static final TransportVersion V_8_500_068 = registerTransportVersion(8_500_068, "2683c8b4-5372-4a6a-bb3a-d61aa679089a"); - public static final TransportVersion V_8_500_069 = registerTransportVersion(8_500_069, "5b804027-d8a0-421b-9970-1f53d766854b"); - /* - * STOP! READ THIS FIRST! No, really, - * ____ _____ ___ ____ _ ____ _____ _ ____ _____ _ _ ___ ____ _____ ___ ____ ____ _____ _ - * / ___|_ _/ _ \| _ \| | | _ \| ____| / \ | _ \ |_ _| | | |_ _/ ___| | ___|_ _| _ \/ ___|_ _| | - * \___ \ | || | | | |_) | | | |_) | _| / _ \ | | | | | | | |_| || |\___ \ | |_ | || |_) \___ \ | | | | - * ___) || || |_| | __/|_| | _ <| |___ / ___ \| |_| | | | | _ || | ___) | | _| | || _ < ___) || | |_| - * |____/ |_| \___/|_| (_) |_| \_\_____/_/ \_\____/ |_| |_| |_|___|____/ |_| |___|_| \_\____/ |_| (_) - * - * A new transport version should be added EVERY TIME a change is made to the serialization protocol of one or more classes. Each - * transport version should only be used in a single merged commit (apart from the BwC versions copied from o.e.Version, ≤V_8_8_1). - * - * To add a new transport version, add a new constant at the bottom of the list, above this comment, which is one greater than the - * current highest version, ensure it has a fresh UUID, and update CurrentHolder#CURRENT to point to the new version. Don't add other - * lines, comments, etc. - * - * REVERTING A TRANSPORT VERSION - * - * If you revert a commit with a transport version change, you MUST ensure there is a NEW transport version representing the reverted - * change. DO NOT let the transport version go backwards, it must ALWAYS be incremented. - * - * DETERMINING TRANSPORT VERSIONS FROM GIT HISTORY - * - * If your git checkout has the expected minor-version-numbered branches and the expected release-version tags then you can find the - * transport versions known by a particular release ... - * - * git show v8.9.1:server/src/main/java/org/elasticsearch/TransportVersion.java | grep registerTransportVersion - * - * ... or by a particular branch ... - * - * git show 8.10:server/src/main/java/org/elasticsearch/TransportVersion.java | grep registerTransportVersion - * - * ... and you can see which versions were added in between two versions too ... - * - * git diff 8.10..main -- server/src/main/java/org/elasticsearch/TransportVersion.java - */ - - private static class CurrentHolder { - private static final TransportVersion CURRENT = findCurrent(V_8_500_069); - - // finds the pluggable current version, or uses the given fallback - private static TransportVersion findCurrent(TransportVersion fallback) { - var versionExtension = VersionExtension.load(); - if (versionExtension == null) { - return fallback; - } - var version = versionExtension.getCurrentTransportVersion(); - assert version.onOrAfter(fallback); - return version; - } - } - - /** - * Reference to the earliest compatible transport version to this version of the codebase. - * This should be the transport version used by the highest minor version of the previous major. - */ - public static final TransportVersion MINIMUM_COMPATIBLE = V_7_17_0; - - /** - * Reference to the minimum transport version that can be used with CCS. - * This should be the transport version used by the previous minor release. - */ - public static final TransportVersion MINIMUM_CCS_VERSION = V_8_500_061; - - static { - // see comment on IDS field - // now we're registered all the transport versions, we can clear the map - IDS = null; - } - - static NavigableMap getAllVersionIds(Class cls) { - Map versionIdFields = new HashMap<>(); - NavigableMap builder = new TreeMap<>(); - - Set ignore = Set.of("ZERO", "CURRENT", "MINIMUM_COMPATIBLE", "MINIMUM_CCS_VERSION"); - - for (Field declaredField : cls.getFields()) { - if (declaredField.getType().equals(TransportVersion.class)) { - String fieldName = declaredField.getName(); - if (ignore.contains(fieldName)) { - continue; - } - - TransportVersion version; - try { - version = (TransportVersion) declaredField.get(null); - } catch (IllegalAccessException e) { - throw new AssertionError(e); - } - builder.put(version.id, version); - - if (Assertions.ENABLED) { - // check the version number is unique - var sameVersionNumber = versionIdFields.put(version.id, fieldName); - assert sameVersionNumber == null - : "Versions [" - + sameVersionNumber - + "] and [" - + fieldName - + "] have the same version number [" - + version.id - + "]. Each TransportVersion should have a different version number"; - } - } - } - - return Collections.unmodifiableNavigableMap(builder); - } - - private static final NavigableMap VERSION_IDS = getAllVersionIds(TransportVersion.class); - - static Collection getAllVersions() { - return VERSION_IDS.values(); - } - public static TransportVersion readVersion(StreamInput in) throws IOException { return fromId(in.readVInt()); } public static TransportVersion fromId(int id) { - TransportVersion known = VERSION_IDS.get(id); + TransportVersion known = TransportVersions.VERSION_IDS.get(id); if (known != null) { return known; } @@ -331,7 +86,7 @@ public static TransportVersion max(TransportVersion version1, TransportVersion v * Returns {@code true} if the specified version is compatible with this running version of Elasticsearch. */ public static boolean isCompatible(TransportVersion version) { - return version.onOrAfter(MINIMUM_COMPATIBLE); + return version.onOrAfter(TransportVersions.MINIMUM_COMPATIBLE); } /** @@ -350,4 +105,19 @@ public static TransportVersion fromString(String str) { public String toString() { return Integer.toString(id); } + + private static class CurrentHolder { + private static final TransportVersion CURRENT = findCurrent(); + + // finds the pluggable current version, or uses the given fallback + private static TransportVersion findCurrent() { + var versionExtension = VersionExtension.load(); + if (versionExtension == null) { + return TransportVersions.LATEST_DEFINED; + } + var version = versionExtension.getCurrentTransportVersion(); + assert version.onOrAfter(TransportVersions.LATEST_DEFINED); + return version; + } + } } diff --git a/server/src/main/java/org/elasticsearch/TransportVersions.java b/server/src/main/java/org/elasticsearch/TransportVersions.java new file mode 100644 index 0000000000000..19ba1ede1adac --- /dev/null +++ b/server/src/main/java/org/elasticsearch/TransportVersions.java @@ -0,0 +1,251 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch; + +import org.elasticsearch.common.Strings; +import org.elasticsearch.core.Assertions; + +import java.lang.reflect.Field; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.NavigableMap; +import java.util.Set; +import java.util.TreeMap; + +public class TransportVersions { + + /* + * NOTE: IntelliJ lies! + * This map is used during class construction, referenced by the registerTransportVersion method. + * When all the transport version constants have been registered, the map is cleared & never touched again. + */ + static Map IDS = new HashMap<>(); + + static TransportVersion def(int id, String uniqueId) { + if (IDS == null) throw new IllegalStateException("The IDS map needs to be present to call this method"); + + Strings.requireNonEmpty(uniqueId, "Each TransportVersion needs a unique string id"); + Integer existing = IDS.put(uniqueId, id); + if (existing != null) { + throw new IllegalArgumentException("Versions " + id + " and " + existing + " have the same unique id"); + } + return new TransportVersion(id); + } + + public static final TransportVersion ZERO = def(0, "00000000-0000-0000-0000-000000000000"); + public static final TransportVersion V_7_0_0 = def(7_00_00_99, "7505fd05-d982-43ce-a63f-ff4c6c8bdeec"); + public static final TransportVersion V_7_0_1 = def(7_00_01_99, "ae772780-e6f9-46a1-b0a0-20ed0cae37f7"); + public static final TransportVersion V_7_1_0 = def(7_01_00_99, "fd09007c-1c54-450a-af99-9f941e1a53c2"); + public static final TransportVersion V_7_2_0 = def(7_02_00_99, "b74dbc52-e727-472c-af21-2156482e8796"); + public static final TransportVersion V_7_2_1 = def(7_02_01_99, "a3217b94-f436-4aab-a020-162c83ba18f2"); + public static final TransportVersion V_7_3_0 = def(7_03_00_99, "4f04e4c9-c5aa-49e4-8b99-abeb4e284a5a"); + public static final TransportVersion V_7_3_2 = def(7_03_02_99, "60da3953-8415-4d4f-a18d-853c3e68ebd6"); + public static final TransportVersion V_7_4_0 = def(7_04_00_99, "ec7e58aa-55b4-4064-a9dd-fd723a2ba7a8"); + public static final TransportVersion V_7_5_0 = def(7_05_00_99, "cc6e14dc-9dc7-4b74-8e15-1f99a6cfbe03"); + public static final TransportVersion V_7_6_0 = def(7_06_00_99, "4637b8ae-f3df-43ae-a065-ad4c29f3373a"); + public static final TransportVersion V_7_7_0 = def(7_07_00_99, "7bb73c48-ddb8-4437-b184-30371c35dd4b"); + public static final TransportVersion V_7_8_0 = def(7_08_00_99, "c3cc74af-d15e-494b-a907-6ad6dd2f4660"); + public static final TransportVersion V_7_8_1 = def(7_08_01_99, "7acb9f6e-32f2-45ce-b87d-ca1f165b8e7a"); + public static final TransportVersion V_7_9_0 = def(7_09_00_99, "9388fe76-192a-4053-b51c-d2a7b8eae545"); + public static final TransportVersion V_7_10_0 = def(7_10_00_99, "4efca195-38e4-4f74-b877-c26fb2a40733"); + public static final TransportVersion V_7_10_1 = def(7_10_01_99, "0070260c-aa0b-4fc2-9c87-5cd5f23b005f"); + public static final TransportVersion V_7_11_0 = def(7_11_00_99, "3b43bcbc-1c5e-4cc2-a3b4-8ac8b64239e8"); + public static final TransportVersion V_7_12_0 = def(7_12_00_99, "3be9ff6f-2d9f-4fc2-ba91-394dd5ebcf33"); + public static final TransportVersion V_7_13_0 = def(7_13_00_99, "e1fe494a-7c66-4571-8f8f-1d7e6d8df1b3"); + public static final TransportVersion V_7_14_0 = def(7_14_00_99, "8cf0954c-b085-467f-b20b-3cb4b2e69e3e"); + public static final TransportVersion V_7_15_0 = def(7_15_00_99, "2273ac0e-00bb-4024-9e2e-ab78981623c6"); + public static final TransportVersion V_7_15_1 = def(7_15_01_99, "a8c3503d-3452-45cf-b385-e855e16547fe"); + public static final TransportVersion V_7_16_0 = def(7_16_00_99, "59abadd2-25db-4547-a991-c92306a3934e"); + public static final TransportVersion V_7_17_0 = def(7_17_00_99, "322efe93-4c73-4e15-9274-bb76836c8fa8"); + public static final TransportVersion V_7_17_1 = def(7_17_01_99, "51c72842-7974-4669-ad25-bf13ba307307"); + public static final TransportVersion V_7_17_8 = def(7_17_08_99, "82a3e70d-cf0e-4efb-ad16-6077ab9fe19f"); + public static final TransportVersion V_8_0_0 = def(8_00_00_99, "c7d2372c-9f01-4a79-8b11-227d862dfe4f"); + public static final TransportVersion V_8_1_0 = def(8_01_00_99, "3dc49dce-9cef-492a-ac8d-3cc79f6b4280"); + public static final TransportVersion V_8_2_0 = def(8_02_00_99, "8ce6d555-202e-47db-ab7d-ade9dda1b7e8"); + public static final TransportVersion V_8_3_0 = def(8_03_00_99, "559ddb66-d857-4208-bed5-a995ccf478ea"); + public static final TransportVersion V_8_4_0 = def(8_04_00_99, "c0d12906-aa5b-45d4-94c7-cbcf4d9818ca"); + public static final TransportVersion V_8_5_0 = def(8_05_00_99, "be3d7f23-7240-4904-9d7f-e25a0f766eca"); + public static final TransportVersion V_8_6_0 = def(8_06_00_99, "e209c5ed-3488-4415-b561-33492ca3b789"); + public static final TransportVersion V_8_6_1 = def(8_06_01_99, "9f113acb-1b21-4fda-bef9-2a3e669b5c7b"); + public static final TransportVersion V_8_7_0 = def(8_07_00_99, "f1ee7a85-4fa6-43f5-8679-33e2b750448b"); + public static final TransportVersion V_8_7_1 = def(8_07_01_99, "018de9d8-9e8b-4ac7-8f4b-3a6fbd0487fb"); + public static final TransportVersion V_8_8_0 = def(8_08_00_99, "f64fe576-0767-4ec3-984e-3e30b33b6c46"); + public static final TransportVersion V_8_8_1 = def(8_08_01_99, "291c71bb-5b0a-4b7e-a407-6e53bc128d0f"); + /* + * READ THE COMMENT BELOW THIS BLOCK OF DECLARATIONS BEFORE ADDING NEW TRANSPORT VERSIONS + * Detached transport versions added below here. + */ + public static final TransportVersion V_8_500_010 = def(8_500_010, "9818C628-1EEC-439B-B943-468F61460675"); + public static final TransportVersion V_8_500_011 = def(8_500_011, "2209F28D-B52E-4BC4-9889-E780F291C32E"); + public static final TransportVersion V_8_500_012 = def(8_500_012, "BB6F4AF1-A860-4FD4-A138-8150FFBE0ABD"); + public static final TransportVersion V_8_500_013 = def(8_500_013, "f65b85ac-db5e-4558-a487-a1dde4f6a33a"); + public static final TransportVersion V_8_500_014 = def(8_500_014, "D115A2E1-1739-4A02-AB7B-64F6EA157EFB"); + public static final TransportVersion V_8_500_015 = def(8_500_015, "651216c9-d54f-4189-9fe1-48d82d276863"); + public static final TransportVersion V_8_500_016 = def(8_500_016, "492C94FB-AAEA-4C9E-8375-BDB67A398584"); + public static final TransportVersion V_8_500_017 = def(8_500_017, "0EDCB5BA-049C-443C-8AB1-5FA58FB996FB"); + public static final TransportVersion V_8_500_018 = def(8_500_018, "827C32CE-33D9-4AC3-A773-8FB768F59EAF"); + public static final TransportVersion V_8_500_019 = def(8_500_019, "09bae57f-cab8-423c-aab3-c9778509ffe3"); + public static final TransportVersion V_8_500_020 = def(8_500_020, "ECB42C26-B258-42E5-A835-E31AF84A76DE"); + public static final TransportVersion V_8_500_021 = def(8_500_021, "102e0d84-0c08-402c-a696-935f3a3da873"); + public static final TransportVersion V_8_500_022 = def(8_500_022, "4993c724-7a81-4955-84e7-403484610091"); + public static final TransportVersion V_8_500_023 = def(8_500_023, "01b06435-5d73-42ff-a121-3b36b771375e"); + public static final TransportVersion V_8_500_024 = def(8_500_024, "db337007-f823-4dbd-968e-375383814c17"); + public static final TransportVersion V_8_500_025 = def(8_500_025, "b2ab7b75-5ac2-4a3b-bbb6-8789ca66722d"); + public static final TransportVersion V_8_500_026 = def(8_500_026, "965d294b-14aa-4abb-bcfc-34631187941d"); + public static final TransportVersion V_8_500_027 = def(8_500_027, "B151D967-8E7C-401C-8275-0ABC06335F2D"); + public static final TransportVersion V_8_500_028 = def(8_500_028, "a6592d08-15cb-4e1a-b9b4-b2ba24058444"); + public static final TransportVersion V_8_500_029 = def(8_500_029, "f3bd98af-6187-e161-e315-718a2fecc2db"); + public static final TransportVersion V_8_500_030 = def(8_500_030, "b72d7f12-8ed3-4a5b-8e6a-4910ea10e0d7"); + public static final TransportVersion V_8_500_031 = def(8_500_031, "e7aa7e95-37e7-46a3-aad1-90a21c0769e7"); + public static final TransportVersion V_8_500_032 = def(8_500_032, "a9a14bc6-c3f2-41d9-a3d8-c686bf2c901d"); + public static final TransportVersion V_8_500_033 = def(8_500_033, "193ab7c4-a751-4cbd-a66a-2d7d56ccbc10"); + public static final TransportVersion V_8_500_034 = def(8_500_034, "16871c8b-88ba-4432-980a-10fd9ecad2dc"); + public static final TransportVersion V_8_500_035 = def(8_500_035, "664dd6ce-3487-4fbd-81a9-af778b28be45"); + public static final TransportVersion V_8_500_036 = def(8_500_036, "3343c64f-d7ac-4f02-9262-3e1acfc56f89"); + public static final TransportVersion V_8_500_037 = def(8_500_037, "d76a4f22-8878-43e0-acfa-15e452195fa7"); + public static final TransportVersion V_8_500_038 = def(8_500_038, "9ef93580-feae-409f-9989-b49e411ca7a9"); + public static final TransportVersion V_8_500_039 = def(8_500_039, "c23722d7-6139-4cf2-b8a1-600fbd4ec359"); + public static final TransportVersion V_8_500_040 = def(8_500_040, "8F3AA068-A608-4A16-9683-2412A75BF2DD"); + public static final TransportVersion V_8_500_041 = def(8_500_041, "5b6a0fd0-ac0b-443f-baae-cffec140905c"); + public static final TransportVersion V_8_500_042 = def(8_500_042, "763b4801-a4fc-47c4-aff5-7f5a757b8a07"); + public static final TransportVersion V_8_500_043 = def(8_500_043, "50babd14-7f5c-4f8c-9351-94e0d397aabc"); + public static final TransportVersion V_8_500_044 = def(8_500_044, "96b83320-2317-4e9d-b735-356f18c1d76a"); + public static final TransportVersion V_8_500_045 = def(8_500_045, "24a596dd-c843-4c0a-90b3-759697d74026"); + public static final TransportVersion V_8_500_046 = def(8_500_046, "61666d4c-a4f0-40db-8a3d-4806718247c5"); + public static final TransportVersion V_8_500_047 = def(8_500_047, "4b1682fe-c37e-4184-80f6-7d57fcba9b3d"); + public static final TransportVersion V_8_500_048 = def(8_500_048, "f9658aa5-f066-4edb-bcb9-40bf256c9294"); + public static final TransportVersion V_8_500_049 = def(8_500_049, "828bb6ce-2fbb-11ee-be56-0242ac120002"); + public static final TransportVersion V_8_500_050 = def(8_500_050, "69722fa2-7c0a-4227-86fb-6d6a9a0a0321"); + public static final TransportVersion V_8_500_051 = def(8_500_051, "a28b43bc-bb5f-4406-afcf-26900aa98a71"); + public static final TransportVersion V_8_500_052 = def(8_500_052, "2d382b3d-9838-4cce-84c8-4142113e5c2b"); + public static final TransportVersion V_8_500_053 = def(8_500_053, "aa603bae-01e2-380a-8950-6604468e8c6d"); + public static final TransportVersion V_8_500_054 = def(8_500_054, "b76ef950-af03-4dda-85c2-6400ec442e7e"); + public static final TransportVersion V_8_500_055 = def(8_500_055, "7831c609-0df1-42d6-aa97-8a346c389ef"); + public static final TransportVersion V_8_500_056 = def(8_500_056, "afa8c4be-29c9-48ab-b1ed-7182415c1b71"); + public static final TransportVersion V_8_500_057 = def(8_500_057, "80c088c6-358d-43b2-8d9c-1ea3c6c2b9fd"); + public static final TransportVersion V_8_500_058 = def(8_500_058, "41d9c98a-1de2-4dc1-86f1-abd4cc1bef57"); + public static final TransportVersion V_8_500_059 = def(8_500_059, "2f2090c0-7cd0-4a10-8f02-63d26073604f"); + public static final TransportVersion V_8_500_060 = def(8_500_060, "ec065a44-b468-4f8a-aded-7b90ca8d792b"); + public static final TransportVersion V_8_500_061 = def(8_500_061, "4e07f830-8be4-448c-851e-62b3d2f0bf0a"); + public static final TransportVersion V_8_500_062 = def(8_500_062, "09CD9C9B-3207-4B40-8756-B7A12001A885"); + public static final TransportVersion V_8_500_063 = def(8_500_063, "31dedced-0055-4f34-b952-2f6919be7488"); + public static final TransportVersion V_8_500_064 = def(8_500_064, "3a795175-5e6f-40ff-90fe-5571ea8ab04e"); + public static final TransportVersion V_8_500_065 = def(8_500_065, "4e253c58-1b3d-11ee-be56-0242ac120002"); + public static final TransportVersion V_8_500_066 = def(8_500_066, "F398ECC6-5D2A-4BD8-A9E8-1101F030DF85"); + public static final TransportVersion V_8_500_067 = def(8_500_067, "a7c86604-a917-4aff-9a1b-a4d44c3dbe02"); + public static final TransportVersion V_8_500_068 = def(8_500_068, "2683c8b4-5372-4a6a-bb3a-d61aa679089a"); + public static final TransportVersion V_8_500_069 = def(8_500_069, "5b804027-d8a0-421b-9970-1f53d766854b"); + /* + * STOP! READ THIS FIRST! No, really, + * ____ _____ ___ ____ _ ____ _____ _ ____ _____ _ _ ___ ____ _____ ___ ____ ____ _____ _ + * / ___|_ _/ _ \| _ \| | | _ \| ____| / \ | _ \ |_ _| | | |_ _/ ___| | ___|_ _| _ \/ ___|_ _| | + * \___ \ | || | | | |_) | | | |_) | _| / _ \ | | | | | | | |_| || |\___ \ | |_ | || |_) \___ \ | | | | + * ___) || || |_| | __/|_| | _ <| |___ / ___ \| |_| | | | | _ || | ___) | | _| | || _ < ___) || | |_| + * |____/ |_| \___/|_| (_) |_| \_\_____/_/ \_\____/ |_| |_| |_|___|____/ |_| |___|_| \_\____/ |_| (_) + * + * A new transport version should be added EVERY TIME a change is made to the serialization protocol of one or more classes. Each + * transport version should only be used in a single merged commit (apart from the BwC versions copied from o.e.Version, ≤V_8_8_1). + * + * To add a new transport version, add a new constant at the bottom of the list, above this comment, which is one greater than the + * current highest version, ensure it has a fresh UUID, and update CurrentHolder#CURRENT to point to the new version. Don't add other + * lines, comments, etc. + * + * REVERTING A TRANSPORT VERSION + * + * If you revert a commit with a transport version change, you MUST ensure there is a NEW transport version representing the reverted + * change. DO NOT let the transport version go backwards, it must ALWAYS be incremented. + * + * DETERMINING TRANSPORT VERSIONS FROM GIT HISTORY + * + * If your git checkout has the expected minor-version-numbered branches and the expected release-version tags then you can find the + * transport versions known by a particular release ... + * + * git show v8.9.1:server/src/main/java/org/elasticsearch/TransportVersion.java | grep registerTransportVersion + * + * ... or by a particular branch ... + * + * git show 8.10:server/src/main/java/org/elasticsearch/TransportVersion.java | grep registerTransportVersion + * + * ... and you can see which versions were added in between two versions too ... + * + * git diff 8.10..main -- server/src/main/java/org/elasticsearch/TransportVersion.java + */ + + /** + * Reference to the earliest compatible transport version to this version of the codebase. + * This should be the transport version used by the highest minor version of the previous major. + */ + public static final TransportVersion MINIMUM_COMPATIBLE = V_7_17_0; + + /** + * Reference to the minimum transport version that can be used with CCS. + * This should be the transport version used by the previous minor release. + */ + public static final TransportVersion MINIMUM_CCS_VERSION = V_8_500_061; + + static final NavigableMap VERSION_IDS = getAllVersionIds(TransportVersion.class); + + // the highest transport version constant defined in this file, used as a fallback for TransportVersion.current() + static final TransportVersion LATEST_DEFINED; + static { + LATEST_DEFINED = VERSION_IDS.lastEntry().getValue(); + + // see comment on IDS field + // now we're registered all the transport versions, we can clear the map + IDS = null; + } + + static NavigableMap getAllVersionIds(Class cls) { + Map versionIdFields = new HashMap<>(); + NavigableMap builder = new TreeMap<>(); + + Set ignore = Set.of("ZERO", "CURRENT", "MINIMUM_COMPATIBLE", "MINIMUM_CCS_VERSION"); + + for (Field declaredField : cls.getFields()) { + if (declaredField.getType().equals(TransportVersion.class)) { + String fieldName = declaredField.getName(); + if (ignore.contains(fieldName)) { + continue; + } + + TransportVersion version; + try { + version = (TransportVersion) declaredField.get(null); + } catch (IllegalAccessException e) { + throw new AssertionError(e); + } + builder.put(version.id(), version); + + if (Assertions.ENABLED) { + // check the version number is unique + var sameVersionNumber = versionIdFields.put(version.id(), fieldName); + assert sameVersionNumber == null + : "Versions [" + + sameVersionNumber + + "] and [" + + fieldName + + "] have the same version number [" + + version.id() + + "]. Each TransportVersion should have a different version number"; + } + } + } + + return Collections.unmodifiableNavigableMap(builder); + } + + static Collection getAllVersions() { + return VERSION_IDS.values(); + } + + // no instance + private TransportVersions() {} +} diff --git a/server/src/main/java/org/elasticsearch/action/DocWriteResponse.java b/server/src/main/java/org/elasticsearch/action/DocWriteResponse.java index 2226d3be323d6..9ea073a69d4d4 100644 --- a/server/src/main/java/org/elasticsearch/action/DocWriteResponse.java +++ b/server/src/main/java/org/elasticsearch/action/DocWriteResponse.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.action.support.WriteRequest.RefreshPolicy; import org.elasticsearch.action.support.WriteResponse; @@ -118,7 +118,7 @@ public DocWriteResponse(ShardId shardId, String id, long seqNo, long primaryTerm protected DocWriteResponse(ShardId shardId, StreamInput in) throws IOException { super(in); this.shardId = shardId; - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { String type = in.readString(); assert MapperService.SINGLE_MAPPING_NAME.equals(type) : "Expected [_doc] but received [" + type + "]"; } @@ -137,7 +137,7 @@ protected DocWriteResponse(ShardId shardId, StreamInput in) throws IOException { protected DocWriteResponse(StreamInput in) throws IOException { super(in); shardId = new ShardId(in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { String type = in.readString(); assert MapperService.SINGLE_MAPPING_NAME.equals(type) : "Expected [_doc] but received [" + type + "]"; } @@ -266,7 +266,7 @@ public void writeTo(StreamOutput out) throws IOException { } private void writeWithoutShardId(StreamOutput out) throws IOException { - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeString(MapperService.SINGLE_MAPPING_NAME); } out.writeString(id); diff --git a/server/src/main/java/org/elasticsearch/action/RoutingMissingException.java b/server/src/main/java/org/elasticsearch/action/RoutingMissingException.java index c316bd589e975..ec43dfdb3fd7f 100644 --- a/server/src/main/java/org/elasticsearch/action/RoutingMissingException.java +++ b/server/src/main/java/org/elasticsearch/action/RoutingMissingException.java @@ -9,7 +9,7 @@ package org.elasticsearch.action; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.index.mapper.MapperService; @@ -41,7 +41,7 @@ public RestStatus status() { public RoutingMissingException(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readString(); } id = in.readString(); @@ -50,7 +50,7 @@ public RoutingMissingException(StreamInput in) throws IOException { @Override protected void writeTo(StreamOutput out, Writer nestedExceptionsWriter) throws IOException { super.writeTo(out, nestedExceptionsWriter); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeString(MapperService.SINGLE_MAPPING_NAME); } out.writeString(id); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java index 3200b41d23fe4..34c1bb4a0c85f 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.cluster.allocation; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterInfo; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.routing.ShardRouting; @@ -68,7 +68,7 @@ public ClusterAllocationExplanation( } public ClusterAllocationExplanation(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_15_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_15_0)) { this.specificShard = in.readBoolean(); } else { this.specificShard = true; // suppress "this is a random shard" warning in BwC situations @@ -82,7 +82,7 @@ public ClusterAllocationExplanation(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_15_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_15_0)) { out.writeBoolean(specificShard); } // else suppress "this is a random shard" warning in BwC situations shardRouting.writeTo(out); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/DesiredBalanceResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/DesiredBalanceResponse.java index 6a1c2107aad4f..0b5f5fc023dc0 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/DesiredBalanceResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/DesiredBalanceResponse.java @@ -8,6 +8,7 @@ package org.elasticsearch.action.admin.cluster.allocation; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.cluster.ClusterInfo; import org.elasticsearch.cluster.routing.AllocationId; @@ -37,8 +38,8 @@ public class DesiredBalanceResponse extends ActionResponse implements ChunkedToXContentObject { - private static final TransportVersion CLUSTER_BALANCE_STATS_VERSION = TransportVersion.V_8_7_0; - private static final TransportVersion CLUSTER_INFO_VERSION = TransportVersion.V_8_8_0; + private static final TransportVersion CLUSTER_BALANCE_STATS_VERSION = TransportVersions.V_8_7_0; + private static final TransportVersion CLUSTER_INFO_VERSION = TransportVersions.V_8_8_0; private final DesiredBalanceStats stats; private final ClusterBalanceStats clusterBalanceStats; @@ -197,9 +198,9 @@ public record ShardView( List tierPreference ) implements Writeable, ToXContentObject { - private static final TransportVersion ADD_FORECASTS_VERSION = TransportVersion.V_8_7_0; - private static final TransportVersion ADD_TIER_PREFERENCE = TransportVersion.V_8_8_0; - private static final TransportVersion NULLABLE_RELOCATING_NODE_IS_DESIRED = TransportVersion.V_8_8_0; + private static final TransportVersion ADD_FORECASTS_VERSION = TransportVersions.V_8_7_0; + private static final TransportVersion ADD_TIER_PREFERENCE = TransportVersions.V_8_8_0; + private static final TransportVersion NULLABLE_RELOCATING_NODE_IS_DESIRED = TransportVersions.V_8_8_0; public ShardView { assert (relocatingNode == null) == (relocatingNodeIsDesired == null) diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java index 01bd97bdc5fb0..75877cf0630f4 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.action.admin.cluster.configuration; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.cluster.ClusterState; @@ -72,7 +72,7 @@ public AddVotingConfigExclusionsRequest(String[] nodeIds, String[] nodeNames, Ti public AddVotingConfigExclusionsRequest(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { final String[] legacyNodeDescriptions = in.readStringArray(); if (legacyNodeDescriptions.length > 0) { throw new IllegalArgumentException("legacy [node_name] field was deprecated and must be empty"); @@ -185,7 +185,7 @@ public ActionRequestValidationException validate() { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeStringArray(Strings.EMPTY_ARRAY); } out.writeStringArray(nodeIds); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/desirednodes/UpdateDesiredNodesRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/desirednodes/UpdateDesiredNodesRequest.java index c5b9bd2b9e0f6..4b33a12d68b1f 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/desirednodes/UpdateDesiredNodesRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/desirednodes/UpdateDesiredNodesRequest.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.cluster.desirednodes; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ValidateActions; @@ -25,7 +26,7 @@ import java.util.Objects; public class UpdateDesiredNodesRequest extends AcknowledgedRequest { - private static final TransportVersion DRY_RUN_VERSION = TransportVersion.V_8_4_0; + private static final TransportVersion DRY_RUN_VERSION = TransportVersions.V_8_4_0; private final String historyID; private final long version; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/desirednodes/UpdateDesiredNodesResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/desirednodes/UpdateDesiredNodesResponse.java index 0d99cc9d693ef..1b9b26e978838 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/desirednodes/UpdateDesiredNodesResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/desirednodes/UpdateDesiredNodesResponse.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.cluster.desirednodes; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -19,7 +20,7 @@ import java.util.Objects; public class UpdateDesiredNodesResponse extends ActionResponse implements ToXContentObject { - private static final TransportVersion DRY_RUN_SUPPORTING_VERSION = TransportVersion.V_8_4_0; + private static final TransportVersion DRY_RUN_SUPPORTING_VERSION = TransportVersions.V_8_4_0; private final boolean replacedExistingHistoryId; private final boolean dryRun; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequest.java index e87427c3fdef6..054d6c7b1f6cc 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.cluster.node.hotthreads; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.support.nodes.BaseNodesRequest; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.io.stream.StreamInput; @@ -36,7 +36,7 @@ public NodesHotThreadsRequest(StreamInput in) throws IOException { type = HotThreads.ReportType.of(in.readString()); interval = in.readTimeValue(); snapshots = in.readInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { sortOrder = HotThreads.SortOrder.of(in.readString()); } } @@ -118,7 +118,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(type.getTypeValue()); out.writeTimeValue(interval); out.writeInt(snapshots); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { out.writeString(sortOrder.getOrderValue()); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodeInfo.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodeInfo.java index 063ba3cd62688..35dc876b3a585 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodeInfo.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodeInfo.java @@ -10,6 +10,7 @@ import org.elasticsearch.Build; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.support.nodes.BaseNodeResponse; import org.elasticsearch.cluster.node.DiscoveryNode; @@ -58,7 +59,7 @@ public class NodeInfo extends BaseNodeResponse { public NodeInfo(StreamInput in) throws IOException { super(in); version = Version.readVersion(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { transportVersion = TransportVersion.readVersion(in); } else { transportVersion = TransportVersion.fromId(version.id); @@ -82,10 +83,10 @@ public NodeInfo(StreamInput in) throws IOException { addInfoIfNonNull(HttpInfo.class, in.readOptionalWriteable(HttpInfo::new)); addInfoIfNonNull(PluginsAndModules.class, in.readOptionalWriteable(PluginsAndModules::new)); addInfoIfNonNull(IngestInfo.class, in.readOptionalWriteable(IngestInfo::new)); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { addInfoIfNonNull(AggregationInfo.class, in.readOptionalWriteable(AggregationInfo::new)); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { addInfoIfNonNull(RemoteClusterServerInfo.class, in.readOptionalWriteable(RemoteClusterServerInfo::new)); } } @@ -196,7 +197,7 @@ private void addInfoIfNonNull(Class clazz, public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); Version.writeVersion(version, out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { TransportVersion.writeVersion(transportVersion, out); } Build.writeBuild(build, out); @@ -220,10 +221,10 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(getInfo(HttpInfo.class)); out.writeOptionalWriteable(getInfo(PluginsAndModules.class)); out.writeOptionalWriteable(getInfo(IngestInfo.class)); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeOptionalWriteable(getInfo(AggregationInfo.class)); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeOptionalWriteable(getInfo(RemoteClusterServerInfo.class)); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/PluginsAndModules.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/PluginsAndModules.java index 16d2e39a77e4c..3691b3b432f3a 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/PluginsAndModules.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/PluginsAndModules.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.cluster.node.info; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.node.ReportingService; @@ -41,7 +41,7 @@ public PluginsAndModules(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { out.writeCollection(plugins); } else { out.writeCollection(plugins.stream().map(PluginRuntimeInfo::descriptor).toList()); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/shutdown/NodesRemovalPrevalidation.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/shutdown/NodesRemovalPrevalidation.java index c4057d59ffdb9..e87222e2f914a 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/shutdown/NodesRemovalPrevalidation.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/shutdown/NodesRemovalPrevalidation.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.cluster.node.shutdown; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -148,14 +148,14 @@ static void configureParser(ConstructingObjectParser parser) { @Override public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(isSafe); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { reason.writeTo(out); } out.writeString(message); } public static Result readFrom(final StreamInput in) throws IOException { - if (in.getTransportVersion().before(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_7_0)) { return new Result(in.readBoolean(), null, in.readString()); } return new Result(in.readBoolean(), Reason.readFrom(in), in.readString()); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/shutdown/PrevalidateNodeRemovalRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/shutdown/PrevalidateNodeRemovalRequest.java index 5073090567936..acffb014715dd 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/shutdown/PrevalidateNodeRemovalRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/shutdown/PrevalidateNodeRemovalRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.cluster.node.shutdown; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.master.MasterNodeReadRequest; import org.elasticsearch.common.Strings; @@ -44,7 +44,7 @@ public PrevalidateNodeRemovalRequest(final StreamInput in) throws IOException { names = in.readStringArray(); ids = in.readStringArray(); externalIds = in.readStringArray(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { timeout = in.readTimeValue(); } } @@ -55,7 +55,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeStringArray(names); out.writeStringArray(ids); out.writeStringArray(externalIds); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeTimeValue(timeout); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java index dce305cb840db..6966f4c52aaa2 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.cluster.node.stats; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.support.nodes.BaseNodeResponse; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeRole; @@ -117,7 +117,7 @@ public NodeStats(StreamInput in) throws IOException { ingestStats = in.readOptionalWriteable(IngestStats::read); adaptiveSelectionStats = in.readOptionalWriteable(AdaptiveSelectionStats::new); indexingPressureStats = in.readOptionalWriteable(IndexingPressureStats::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_011)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_011)) { repositoriesStats = in.readOptionalWriteable(RepositoriesStats::new); } else { repositoriesStats = null; @@ -294,7 +294,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(ingestStats); out.writeOptionalWriteable(adaptiveSelectionStats); out.writeOptionalWriteable(indexingPressureStats); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_011)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_011)) { out.writeOptionalWriteable(repositoriesStats); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksRequest.java index 597c9821e48ec..f42f138288de0 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.cluster.node.tasks.list; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.tasks.BaseTasksRequest; import org.elasticsearch.common.Strings; @@ -43,7 +43,7 @@ public ListTasksRequest(StreamInput in) throws IOException { super(in); detailed = in.readBoolean(); waitForCompletion = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { descriptions = in.readStringArray(); } } @@ -53,7 +53,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeBoolean(detailed); out.writeBoolean(waitForCompletion); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { out.writeStringArray(descriptions); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsAction.java index 76d59660da0b4..0e868087b637d 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsAction.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.cluster.settings; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; @@ -37,12 +37,12 @@ public Request() {} public Request(StreamInput in) throws IOException { super(in); - assert in.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0); + assert in.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0); } @Override public void writeTo(StreamOutput out) throws IOException { - assert out.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0); + assert out.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0); super.writeTo(out); } @@ -77,7 +77,7 @@ public int hashCode() { public Response(StreamInput in) throws IOException { super(in); - assert in.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0); + assert in.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0); persistentSettings = Settings.readSettingsFromStream(in); transientSettings = Settings.readSettingsFromStream(in); settings = Settings.readSettingsFromStream(in); @@ -91,7 +91,7 @@ public Response(Settings persistentSettings, Settings transientSettings, Setting @Override public void writeTo(StreamOutput out) throws IOException { - assert out.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0); + assert out.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0); persistentSettings.writeTo(out); transientSettings.writeTo(out); settings.writeTo(out); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java index 3303e3b908f73..7c5d11a884d60 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java @@ -10,6 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.support.IndicesOptions; @@ -54,7 +55,7 @@ public class CreateSnapshotRequest extends MasterNodeRequest { - private static final TransportVersion FEATURE_RESET_ON_MASTER = TransportVersion.V_7_14_0; + private static final TransportVersion FEATURE_RESET_ON_MASTER = TransportVersions.V_7_14_0; public static ResetFeatureStateRequest fromStream(StreamInput in) throws IOException { if (in.getTransportVersion().before(FEATURE_RESET_ON_MASTER)) { diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java index 35b6abed2c2f9..c3e2dd6e3b536 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.cluster.snapshots.get; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.common.Strings; @@ -40,19 +41,19 @@ public class GetSnapshotsRequest extends MasterNodeRequest public static final String NO_POLICY_PATTERN = "_none"; public static final boolean DEFAULT_VERBOSE_MODE = true; - public static final TransportVersion SLM_POLICY_FILTERING_VERSION = TransportVersion.V_7_16_0; + public static final TransportVersion SLM_POLICY_FILTERING_VERSION = TransportVersions.V_7_16_0; - public static final TransportVersion FROM_SORT_VALUE_VERSION = TransportVersion.V_7_16_0; + public static final TransportVersion FROM_SORT_VALUE_VERSION = TransportVersions.V_7_16_0; - public static final TransportVersion MULTIPLE_REPOSITORIES_SUPPORT_ADDED = TransportVersion.V_7_14_0; + public static final TransportVersion MULTIPLE_REPOSITORIES_SUPPORT_ADDED = TransportVersions.V_7_14_0; - public static final TransportVersion PAGINATED_GET_SNAPSHOTS_VERSION = TransportVersion.V_7_14_0; + public static final TransportVersion PAGINATED_GET_SNAPSHOTS_VERSION = TransportVersions.V_7_14_0; - public static final TransportVersion NUMERIC_PAGINATION_VERSION = TransportVersion.V_7_15_0; + public static final TransportVersion NUMERIC_PAGINATION_VERSION = TransportVersions.V_7_15_0; - private static final TransportVersion SORT_BY_SHARDS_OR_REPO_VERSION = TransportVersion.V_7_16_0; + private static final TransportVersion SORT_BY_SHARDS_OR_REPO_VERSION = TransportVersions.V_7_16_0; - private static final TransportVersion INDICES_FLAG_VERSION = TransportVersion.V_8_3_0; + private static final TransportVersion INDICES_FLAG_VERSION = TransportVersions.V_8_3_0; public static final int NO_LIMIT = -1; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java index 44d417d14da1e..8d025653d47fe 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.cluster.snapshots.restore; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.master.MasterNodeRequest; @@ -48,7 +49,7 @@ public class RestoreSnapshotRequest extends MasterNodeRequest { + mappings = in.readImmutableOpenMap(StreamInput::readString, in.getTransportVersion().before(TransportVersions.V_8_0_0) ? i -> { int numMappings = i.readVInt(); assert numMappings == 0 || numMappings == 1 : "Expected 0 or 1 mappings but got " + numMappings; if (numMappings == 1) { diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsIndexRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsIndexRequest.java index 47a17006dc4bf..b4ab91a52c97f 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsIndexRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsIndexRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.indices.mapping.get; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.action.support.IndicesOptions; @@ -28,12 +28,12 @@ public class GetFieldMappingsIndexRequest extends SingleShardRequest { - if (mapIn.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (mapIn.getTransportVersion().before(TransportVersions.V_8_0_0)) { int typesSize = mapIn.readVInt(); assert typesSize == 1 || typesSize == 0 : "Expected 0 or 1 types but got " + typesSize; if (typesSize == 0) { @@ -154,7 +154,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws @Override public void writeTo(StreamOutput out) throws IOException { out.writeMap(mappings, (outpt, map) -> { - if (outpt.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (outpt.getTransportVersion().before(TransportVersions.V_8_0_0)) { outpt.writeVInt(1); outpt.writeString(MapperService.SINGLE_MAPPING_NAME); } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsResponse.java index 55210e3e5a4b9..f013d2bb518d5 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsResponse.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.indices.mapping.get; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.cluster.metadata.MappingMetadata; import org.elasticsearch.common.Strings; @@ -40,7 +40,7 @@ public GetMappingsResponse(Map mappings) { GetMappingsResponse(StreamInput in) throws IOException { super(in); - mappings = in.readImmutableMap(in.getTransportVersion().before(TransportVersion.V_8_0_0) ? i -> { + mappings = in.readImmutableMap(in.getTransportVersion().before(TransportVersions.V_8_0_0) ? i -> { int mappingCount = i.readVInt(); assert mappingCount == 1 || mappingCount == 0 : "Expected 0 or 1 mappings but got " + mappingCount; if (mappingCount == 1) { diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java index 4d1a10e1bed25..eb758a40da5fe 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.admin.indices.mapping.put; import org.elasticsearch.ElasticsearchGenerationException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.support.IndicesOptions; @@ -79,7 +79,7 @@ public PutMappingRequest(StreamInput in) throws IOException { super(in); indices = in.readStringArray(); indicesOptions = IndicesOptions.readIndicesOptions(in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { String type = in.readOptionalString(); if (MapperService.SINGLE_MAPPING_NAME.equals(type) == false) { throw new IllegalArgumentException("Expected type [_doc] but received [" + type + "]"); @@ -88,7 +88,7 @@ public PutMappingRequest(StreamInput in) throws IOException { source = in.readString(); concreteIndex = in.readOptionalWriteable(Index::new); origin = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_9_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_9_0)) { writeIndexOnly = in.readBoolean(); } } @@ -311,13 +311,13 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeStringArrayNullable(indices); indicesOptions.writeIndicesOptions(out); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeOptionalString(MapperService.SINGLE_MAPPING_NAME); } out.writeString(source); out.writeOptionalWriteable(concreteIndex); out.writeOptionalString(origin); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_9_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_9_0)) { out.writeBoolean(writeIndexOnly); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxPrimaryShardDocsCondition.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxPrimaryShardDocsCondition.java index 678ec96c217ca..40579b1acf361 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxPrimaryShardDocsCondition.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxPrimaryShardDocsCondition.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.indices.rollover; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -63,6 +64,6 @@ public static MaxPrimaryShardDocsCondition fromXContent(XContentParser parser) t @Override boolean includedInVersion(TransportVersion version) { - return version.onOrAfter(TransportVersion.V_8_2_0); + return version.onOrAfter(TransportVersions.V_8_2_0); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinAgeCondition.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinAgeCondition.java index 98958d3b015c7..5f55d01a0ab43 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinAgeCondition.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinAgeCondition.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.indices.rollover; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; @@ -65,6 +66,6 @@ public static MinAgeCondition fromXContent(XContentParser parser) throws IOExcep @Override boolean includedInVersion(TransportVersion version) { - return version.onOrAfter(TransportVersion.V_8_4_0); + return version.onOrAfter(TransportVersions.V_8_4_0); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinDocsCondition.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinDocsCondition.java index 8c6274cfadb81..28af3df8c7e22 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinDocsCondition.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinDocsCondition.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.indices.rollover; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -63,6 +64,6 @@ public static MinDocsCondition fromXContent(XContentParser parser) throws IOExce @Override boolean includedInVersion(TransportVersion version) { - return version.onOrAfter(TransportVersion.V_8_4_0); + return version.onOrAfter(TransportVersions.V_8_4_0); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinPrimaryShardDocsCondition.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinPrimaryShardDocsCondition.java index 6aaea57e5b55b..c89b34345db8c 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinPrimaryShardDocsCondition.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinPrimaryShardDocsCondition.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.indices.rollover; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -63,6 +64,6 @@ public static MinPrimaryShardDocsCondition fromXContent(XContentParser parser) t @Override boolean includedInVersion(TransportVersion version) { - return version.onOrAfter(TransportVersion.V_8_4_0); + return version.onOrAfter(TransportVersions.V_8_4_0); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinPrimaryShardSizeCondition.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinPrimaryShardSizeCondition.java index d7149e2a91be4..7ef63186c76a8 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinPrimaryShardSizeCondition.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinPrimaryShardSizeCondition.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.indices.rollover; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.ByteSizeValue; @@ -64,6 +65,6 @@ public static MinPrimaryShardSizeCondition fromXContent(XContentParser parser) t @Override boolean includedInVersion(TransportVersion version) { - return version.onOrAfter(TransportVersion.V_8_4_0); + return version.onOrAfter(TransportVersions.V_8_4_0); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinSizeCondition.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinSizeCondition.java index 52db7ff90cf26..318f385842707 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinSizeCondition.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MinSizeCondition.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.indices.rollover; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.ByteSizeValue; @@ -64,6 +65,6 @@ public static MinSizeCondition fromXContent(XContentParser parser) throws IOExce @Override boolean includedInVersion(TransportVersion version) { - return version.onOrAfter(TransportVersion.V_8_4_0); + return version.onOrAfter(TransportVersions.V_8_4_0); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java index 204474654bb0d..03a222bd0db4f 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.indices.segments; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.support.broadcast.BroadcastRequest; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -28,7 +28,7 @@ public IndicesSegmentsRequest() { public IndicesSegmentsRequest(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readBoolean(); // old 'verbose' option, since removed } } @@ -40,7 +40,7 @@ public IndicesSegmentsRequest(String... indices) { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeBoolean(false); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequest.java index ad9c4904ecc86..4e31fbc2b5732 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequest.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.admin.indices.settings.put; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.support.IndicesOptions; @@ -54,7 +54,7 @@ public UpdateSettingsRequest(StreamInput in) throws IOException { indicesOptions = IndicesOptions.readIndicesOptions(in); settings = readSettingsFromStream(in); preserveExisting = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_12_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_12_0)) { origin = in.readString(); } } @@ -183,7 +183,7 @@ public void writeTo(StreamOutput out) throws IOException { indicesOptions.writeIndicesOptions(out); settings.writeTo(out); out.writeBoolean(preserveExisting); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_12_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_12_0)) { out.writeString(origin); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoresRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoresRequest.java index 20f6430c91b70..a4a8a475ae8b7 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoresRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoresRequest.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.action.admin.indices.shards; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.support.IndicesOptions; @@ -54,7 +54,7 @@ public IndicesShardStoresRequest(StreamInput in) throws IOException { statuses.add(ClusterHealthStatus.readFrom(in)); } indicesOptions = IndicesOptions.readIndicesOptions(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { maxConcurrentShardRequests = in.readVInt(); } else { // earlier versions had unlimited concurrency @@ -68,7 +68,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeStringArrayNullable(indices); out.writeCollection(statuses, (o, v) -> o.writeByte(v.value())); indicesOptions.writeIndicesOptions(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeVInt(maxConcurrentShardRequests); } else if (maxConcurrentShardRequests != DEFAULT_MAX_CONCURRENT_SHARD_REQUESTS) { throw new IllegalArgumentException( diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java index 5af82874652a4..76500964be750 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java @@ -10,6 +10,7 @@ import org.apache.lucene.store.AlreadyClosedException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -46,8 +47,8 @@ public class CommonStats implements Writeable, ToXContentFragment { - private static final TransportVersion VERSION_SUPPORTING_NODE_MAPPINGS = TransportVersion.V_8_5_0; - private static final TransportVersion VERSION_SUPPORTING_DENSE_VECTOR_STATS = TransportVersion.V_8_500_058; + private static final TransportVersion VERSION_SUPPORTING_NODE_MAPPINGS = TransportVersions.V_8_5_0; + private static final TransportVersion VERSION_SUPPORTING_DENSE_VECTOR_STATS = TransportVersions.V_8_500_058; @Nullable public DocsStats docs; @@ -208,7 +209,7 @@ public CommonStats(StreamInput in) throws IOException { translog = in.readOptionalWriteable(TranslogStats::new); requestCache = in.readOptionalWriteable(RequestCacheStats::new); recoveryStats = in.readOptionalWriteable(RecoveryStats::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { bulk = in.readOptionalWriteable(BulkStats::new); } shards = in.readOptionalWriteable(ShardCountStats::new); @@ -238,7 +239,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(translog); out.writeOptionalWriteable(requestCache); out.writeOptionalWriteable(recoveryStats); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeOptionalWriteable(bulk); } out.writeOptionalWriteable(shards); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java index 5fba3e737d7ba..ae4f20e420fca 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.indices.stats; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -55,7 +55,7 @@ public CommonStatsFlags(StreamInput in) throws IOException { flags.add(flag); } } - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readStringArray(); } groups = in.readStringArray(); @@ -73,7 +73,7 @@ public void writeTo(StreamOutput out) throws IOException { } out.writeLong(longFlags); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeStringArrayNullable(Strings.EMPTY_ARRAY); } out.writeStringArrayNullable(groups); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponse.java index ef1633bd11dd6..70959babf312e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponse.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.indices.stats; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ClusterStatsLevel; import org.elasticsearch.action.admin.indices.stats.IndexStats.IndexStatsBuilder; import org.elasticsearch.action.support.DefaultShardOperationFailedException; @@ -51,7 +51,7 @@ public class IndicesStatsResponse extends ChunkedBroadcastResponse { IndicesStatsResponse(StreamInput in) throws IOException { super(in); shards = in.readArray(ShardStats::new, ShardStats[]::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { indexHealthMap = in.readMap(ClusterHealthStatus::readFrom); indexStateMap = in.readMap(IndexMetadata.State::readFrom); } else { @@ -171,7 +171,7 @@ public CommonStats getPrimaries() { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeArray(shards); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { out.writeMap(indexHealthMap, StreamOutput::writeWriteable); out.writeMap(indexStateMap, StreamOutput::writeWriteable); } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/ShardStats.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/ShardStats.java index 3f8b005ca13e5..bf328aa03ca06 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/ShardStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/ShardStats.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.indices.stats; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -27,7 +28,7 @@ public class ShardStats implements Writeable, ToXContentFragment { - private static final TransportVersion DEDUPLICATE_SHARD_PATH_VERSION = TransportVersion.V_8_4_0; + private static final TransportVersion DEDUPLICATE_SHARD_PATH_VERSION = TransportVersions.V_8_4_0; private final ShardRouting shardRouting; private final CommonStats commonStats; @@ -60,7 +61,7 @@ public ShardStats(StreamInput in) throws IOException { isCustomDataPath = in.readBoolean(); seqNoStats = in.readOptionalWriteable(SeqNoStats::new); retentionLeaseStats = in.readOptionalWriteable(RetentionLeaseStats::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { isSearchIdle = in.readBoolean(); searchIdleTime = in.readVLong(); } else { @@ -214,7 +215,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(isCustomDataPath); out.writeOptionalWriteable(seqNoStats); out.writeOptionalWriteable(retentionLeaseStats); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeBoolean(isSearchIdle); out.writeVLong(searchIdleTime); } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComponentTemplateAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComponentTemplateAction.java index 3ae9da3853f1f..6c201dd0db7f2 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComponentTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComponentTemplateAction.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.indices.template.get; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; @@ -57,7 +57,7 @@ public Request(String name) { public Request(StreamInput in) throws IOException { super(in); name = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { includeDefaults = in.readBoolean(); } else { includeDefaults = false; @@ -68,7 +68,7 @@ public Request(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeOptionalString(name); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeBoolean(includeDefaults); } } @@ -121,7 +121,7 @@ public static class Response extends ActionResponse implements ToXContentObject public Response(StreamInput in) throws IOException { super(in); componentTemplates = in.readMap(ComponentTemplate::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { rolloverConfiguration = in.readOptionalWriteable(RolloverConfiguration::new); } else { rolloverConfiguration = null; @@ -149,7 +149,7 @@ public RolloverConfiguration getRolloverConfiguration() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeMap(componentTemplates, StreamOutput::writeWriteable); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeOptionalWriteable(rolloverConfiguration); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java index 89c0ec366d363..a0370a63959b7 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.indices.template.get; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; @@ -58,7 +58,7 @@ public Request(@Nullable String name) { public Request(StreamInput in) throws IOException { super(in); name = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { includeDefaults = in.readBoolean(); } else { includeDefaults = false; @@ -69,7 +69,7 @@ public Request(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeOptionalString(name); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeBoolean(includeDefaults); } } @@ -123,7 +123,7 @@ public static class Response extends ActionResponse implements ToXContentObject public Response(StreamInput in) throws IOException { super(in); indexTemplates = in.readMap(ComposableIndexTemplate::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { rolloverConfiguration = in.readOptionalWriteable(RolloverConfiguration::new); } else { rolloverConfiguration = null; @@ -147,7 +147,7 @@ public Map indexTemplates() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeMap(indexTemplates, StreamOutput::writeWriteable); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeOptionalWriteable(rolloverConfiguration); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateRequest.java index 08097d5002db8..cedc5479971ad 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.indices.template.post; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; import org.elasticsearch.action.support.master.MasterNodeReadRequest; @@ -40,7 +40,7 @@ public SimulateIndexTemplateRequest(StreamInput in) throws IOException { super(in); indexName = in.readString(); indexTemplateRequest = in.readOptionalWriteable(PutComposableIndexTemplateAction.Request::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { includeDefaults = in.readBoolean(); } } @@ -50,7 +50,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeString(indexName); out.writeOptionalWriteable(indexTemplateRequest); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeBoolean(includeDefaults); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java index 67ee242b062be..a0a2d83baffa5 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.indices.template.post; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.admin.indices.rollover.RolloverConfiguration; import org.elasticsearch.cluster.metadata.Template; @@ -73,7 +73,7 @@ public SimulateIndexTemplateResponse(StreamInput in) throws IOException { } else { this.overlappingTemplates = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { rolloverConfiguration = in.readOptionalWriteable(RolloverConfiguration::new); } } @@ -91,7 +91,7 @@ public void writeTo(StreamOutput out) throws IOException { } else { out.writeBoolean(false); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeOptionalWriteable(rolloverConfiguration); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateTemplateAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateTemplateAction.java index 1470042091169..8435f82432e96 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateTemplateAction.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.indices.template.post; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ValidateActions; @@ -63,7 +63,7 @@ public Request(StreamInput in) throws IOException { super(in); templateName = in.readOptionalString(); indexTemplateRequest = in.readOptionalWriteable(PutComposableIndexTemplateAction.Request::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { includeDefaults = in.readBoolean(); } } @@ -73,7 +73,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeOptionalString(templateName); out.writeOptionalWriteable(indexTemplateRequest); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeBoolean(includeDefaults); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java index c06830e056145..10c9a5e7205b0 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchGenerationException; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.admin.indices.alias.Alias; @@ -76,7 +76,7 @@ public PutIndexTemplateRequest(StreamInput in) throws IOException { order = in.readInt(); create = in.readBoolean(); settings = readSettingsFromStream(in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { int size = in.readVInt(); for (int i = 0; i < size; i++) { in.readString(); // type - cannot assert on _doc because 7x allows arbitrary type names @@ -446,7 +446,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeInt(order); out.writeBoolean(create); settings.writeTo(out); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeVInt(mappings == null ? 0 : 1); if (mappings != null) { out.writeString(MapperService.SINGLE_MAPPING_NAME); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ShardValidateQueryRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ShardValidateQueryRequest.java index e5a399aed85fe..e2ffd97addb42 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ShardValidateQueryRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ShardValidateQueryRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.indices.validate.query; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.support.broadcast.BroadcastShardRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -33,7 +33,7 @@ public class ShardValidateQueryRequest extends BroadcastShardRequest { public ShardValidateQueryRequest(StreamInput in) throws IOException { super(in); query = in.readNamedWriteable(QueryBuilder.class); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { int typesSize = in.readVInt(); if (typesSize > 0) { for (int i = 0; i < typesSize; i++) { @@ -80,7 +80,7 @@ public long nowInMillis() { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeNamedWriteable(query); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeVInt(0); // no types to filter } filteringAliases.writeTo(out); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryRequest.java index 6747b76f2aec0..2564f5eb13dc6 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.indices.validate.query; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.support.IndicesOptions; @@ -48,7 +48,7 @@ public ValidateQueryRequest() { public ValidateQueryRequest(StreamInput in) throws IOException { super(in); query = in.readNamedWriteable(QueryBuilder.class); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { int typesSize = in.readVInt(); if (typesSize > 0) { for (int i = 0; i < typesSize; i++) { @@ -137,7 +137,7 @@ public boolean allShards() { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeNamedWriteable(query); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeVInt(0); // no types to filter } out.writeBoolean(explain); diff --git a/server/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java b/server/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java index b5894d322b90e..e0b15558b860d 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ExceptionsHelper; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.DocWriteRequest.OpType; import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.delete.DeleteResponse; @@ -237,7 +237,7 @@ private Failure(String index, String id, Exception cause, RestStatus status, lon */ public Failure(StreamInput in) throws IOException { index = in.readString(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readString(); // can't make an assertion about type names here because too many tests still set their own // types bypassing various checks @@ -253,7 +253,7 @@ public Failure(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(index); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeString(MapperService.SINGLE_MAPPING_NAME); } out.writeOptionalString(id); diff --git a/server/src/main/java/org/elasticsearch/action/datastreams/CreateDataStreamAction.java b/server/src/main/java/org/elasticsearch/action/datastreams/CreateDataStreamAction.java index f4eae07cc291d..68a4e0d0b04c9 100644 --- a/server/src/main/java/org/elasticsearch/action/datastreams/CreateDataStreamAction.java +++ b/server/src/main/java/org/elasticsearch/action/datastreams/CreateDataStreamAction.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.action.datastreams; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.IndicesRequest; @@ -66,7 +66,7 @@ public ActionRequestValidationException validate() { public Request(StreamInput in) throws IOException { super(in); this.name = in.readString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { this.startTime = in.readVLong(); } else { this.startTime = System.currentTimeMillis(); @@ -77,7 +77,7 @@ public Request(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeString(name); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { out.writeVLong(startTime); } } diff --git a/server/src/main/java/org/elasticsearch/action/datastreams/GetDataStreamAction.java b/server/src/main/java/org/elasticsearch/action/datastreams/GetDataStreamAction.java index 85ebd93f61317..6da8e298fb3b6 100644 --- a/server/src/main/java/org/elasticsearch/action/datastreams/GetDataStreamAction.java +++ b/server/src/main/java/org/elasticsearch/action/datastreams/GetDataStreamAction.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.action.datastreams; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; @@ -71,7 +71,7 @@ public Request(StreamInput in) throws IOException { super(in); this.names = in.readOptionalStringArray(); this.indicesOptions = IndicesOptions.readIndicesOptions(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { this.includeDefaults = in.readBoolean(); } else { this.includeDefaults = false; @@ -83,7 +83,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeOptionalStringArray(names); indicesOptions.writeIndicesOptions(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeBoolean(includeDefaults); } } @@ -188,7 +188,7 @@ public DataStreamInfo( ClusterHealthStatus.readFrom(in), in.readOptionalString(), in.readOptionalString(), - in.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0) ? in.readOptionalWriteable(TimeSeries::new) : null + in.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0) ? in.readOptionalWriteable(TimeSeries::new) : null ); } @@ -221,7 +221,7 @@ public void writeTo(StreamOutput out) throws IOException { dataStreamStatus.writeTo(out); out.writeOptionalString(indexTemplate); out.writeOptionalString(ilmPolicyName); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { out.writeOptionalWriteable(timeSeries); } } @@ -342,7 +342,7 @@ public Response(List dataStreams, @Nullable RolloverConfiguratio public Response(StreamInput in) throws IOException { this( in.readCollectionAsList(DataStreamInfo::new), - in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010) + in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010) ? in.readOptionalWriteable(RolloverConfiguration::new) : null ); @@ -360,7 +360,7 @@ public RolloverConfiguration getRolloverConfiguration() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeCollection(dataStreams); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeOptionalWriteable(rolloverConfiguration); } } diff --git a/server/src/main/java/org/elasticsearch/action/delete/DeleteRequest.java b/server/src/main/java/org/elasticsearch/action/delete/DeleteRequest.java index f151ae6eca2d7..70f0a9a12e02e 100644 --- a/server/src/main/java/org/elasticsearch/action/delete/DeleteRequest.java +++ b/server/src/main/java/org/elasticsearch/action/delete/DeleteRequest.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.delete; import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.CompositeIndicesRequest; import org.elasticsearch.action.DocWriteRequest; @@ -62,7 +62,7 @@ public DeleteRequest(StreamInput in) throws IOException { public DeleteRequest(@Nullable ShardId shardId, StreamInput in) throws IOException { super(shardId, in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { String type = in.readString(); assert MapperService.SINGLE_MAPPING_NAME.equals(type) : "Expected [_doc] but received [" + type + "]"; } @@ -254,7 +254,7 @@ public void writeThin(StreamOutput out) throws IOException { } private void writeBody(StreamOutput out) throws IOException { - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeString(MapperService.SINGLE_MAPPING_NAME); } out.writeString(id); diff --git a/server/src/main/java/org/elasticsearch/action/downsample/DownsampleAction.java b/server/src/main/java/org/elasticsearch/action/downsample/DownsampleAction.java index 4911053b0f2a0..c2008823b0523 100644 --- a/server/src/main/java/org/elasticsearch/action/downsample/DownsampleAction.java +++ b/server/src/main/java/org/elasticsearch/action/downsample/DownsampleAction.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.action.downsample; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; @@ -64,7 +64,7 @@ public Request(StreamInput in) throws IOException { super(in); sourceIndex = in.readString(); targetIndex = in.readString(); - waitTimeout = in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_054) + waitTimeout = in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_054) ? TimeValue.parseTimeValue(in.readString(), "timeout") : DEFAULT_WAIT_TIMEOUT; downsampleConfig = new DownsampleConfig(in); @@ -91,7 +91,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(sourceIndex); out.writeString(targetIndex); out.writeString( - out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_054) + out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_054) ? waitTimeout.getStringRep() : DEFAULT_WAIT_TIMEOUT.getStringRep() ); diff --git a/server/src/main/java/org/elasticsearch/action/explain/ExplainRequest.java b/server/src/main/java/org/elasticsearch/action/explain/ExplainRequest.java index 685eb0b8a1995..d1e48574fe226 100644 --- a/server/src/main/java/org/elasticsearch/action/explain/ExplainRequest.java +++ b/server/src/main/java/org/elasticsearch/action/explain/ExplainRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.explain; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.support.single.shard.SingleShardRequest; @@ -54,7 +54,7 @@ public ExplainRequest(String index, String id) { ExplainRequest(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { String type = in.readString(); assert MapperService.SINGLE_MAPPING_NAME.equals(type); } @@ -160,7 +160,7 @@ public ActionRequestValidationException validate() { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeString(MapperService.SINGLE_MAPPING_NAME); } out.writeString(id); diff --git a/server/src/main/java/org/elasticsearch/action/explain/ExplainResponse.java b/server/src/main/java/org/elasticsearch/action/explain/ExplainResponse.java index 97c56069fa762..51e7509863796 100644 --- a/server/src/main/java/org/elasticsearch/action/explain/ExplainResponse.java +++ b/server/src/main/java/org/elasticsearch/action/explain/ExplainResponse.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.explain; import org.apache.lucene.search.Explanation; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -69,7 +69,7 @@ public ExplainResponse(String index, String id, boolean exists, Explanation expl public ExplainResponse(StreamInput in) throws IOException { super(in); index = in.readString(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readString(); } id = in.readString(); @@ -118,7 +118,7 @@ public RestStatus status() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(index); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeString(MapperService.SINGLE_MAPPING_NAME); } out.writeString(id); diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilities.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilities.java index e7c4191f8b8ce..095a5ec8f5594 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilities.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilities.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.fieldcaps; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -226,7 +226,7 @@ public FieldCapabilities( this.isMetadataField = in.readBoolean(); this.isSearchable = in.readBoolean(); this.isAggregatable = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { this.isDimension = in.readBoolean(); this.metricType = in.readOptionalEnum(TimeSeriesParams.MetricType.class); } else { @@ -236,7 +236,7 @@ public FieldCapabilities( this.indices = in.readOptionalStringArray(); this.nonSearchableIndices = in.readOptionalStringArray(); this.nonAggregatableIndices = in.readOptionalStringArray(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { this.nonDimensionIndices = in.readOptionalStringArray(); this.metricConflictsIndices = in.readOptionalStringArray(); } else { @@ -253,14 +253,14 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(isMetadataField); out.writeBoolean(isSearchable); out.writeBoolean(isAggregatable); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeBoolean(isDimension); out.writeOptionalEnum(metricType); } out.writeOptionalStringArray(indices); out.writeOptionalStringArray(nonSearchableIndices); out.writeOptionalStringArray(nonAggregatableIndices); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeOptionalStringArray(nonDimensionIndices); out.writeOptionalStringArray(metricConflictsIndices); } diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesIndexResponse.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesIndexResponse.java index 30d6e05d59bb9..aac322c4a1de7 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesIndexResponse.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesIndexResponse.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.fieldcaps; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -23,7 +24,7 @@ import java.util.stream.Stream; final class FieldCapabilitiesIndexResponse implements Writeable { - private static final TransportVersion MAPPING_HASH_VERSION = TransportVersion.V_8_2_0; + private static final TransportVersion MAPPING_HASH_VERSION = TransportVersions.V_8_2_0; private final String indexName; @Nullable diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesNodeRequest.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesNodeRequest.java index d4e01a7e6f284..ba238638efba4 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesNodeRequest.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesNodeRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.fieldcaps; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.IndicesRequest; @@ -44,7 +44,7 @@ class FieldCapabilitiesNodeRequest extends ActionRequest implements IndicesReque super(in); shardIds = in.readCollectionAsList(ShardId::new); fields = in.readStringArray(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { filters = in.readStringArray(); allowedTypes = in.readStringArray(); } else { @@ -124,7 +124,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeCollection(shardIds); out.writeStringArray(fields); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { out.writeStringArray(filters); out.writeStringArray(allowedTypes); } diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequest.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequest.java index 18e08b2e8bdf9..95555cfd59ab2 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequest.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.fieldcaps; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.IndicesRequest; @@ -58,7 +58,7 @@ public FieldCapabilitiesRequest(StreamInput in) throws IOException { indexFilter = in.readOptionalNamedWriteable(QueryBuilder.class); nowInMillis = in.readOptionalLong(); runtimeFields = in.readMap(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { filters = in.readStringArray(); types = in.readStringArray(); } @@ -96,7 +96,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalNamedWriteable(indexFilter); out.writeOptionalLong(nowInMillis); out.writeGenericMap(runtimeFields); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { out.writeStringArray(filters); out.writeStringArray(types); } diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/IndexFieldCapabilities.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/IndexFieldCapabilities.java index 463d0e9881f11..57a9dd049d26c 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/IndexFieldCapabilities.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/IndexFieldCapabilities.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.fieldcaps; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -68,7 +68,7 @@ public class IndexFieldCapabilities implements Writeable { this.isMetadatafield = in.readBoolean(); this.isSearchable = in.readBoolean(); this.isAggregatable = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { this.isDimension = in.readBoolean(); this.metricType = in.readOptionalEnum(TimeSeriesParams.MetricType.class); } else { @@ -85,7 +85,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(isMetadatafield); out.writeBoolean(isSearchable); out.writeBoolean(isAggregatable); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeBoolean(isDimension); out.writeOptionalEnum(metricType); } diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/ResponseRewriter.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/ResponseRewriter.java index d7d923ec089aa..37313c435319c 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/ResponseRewriter.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/ResponseRewriter.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.fieldcaps; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import java.util.HashMap; import java.util.Map; @@ -29,7 +30,7 @@ public static Map rewriteOldResponses( String[] filters, String[] allowedTypes ) { - if (version.onOrAfter(TransportVersion.V_8_2_0)) { + if (version.onOrAfter(TransportVersions.V_8_2_0)) { return input; // nothing needs to be done } Function transformer = buildTransformer(input, filters, allowedTypes); diff --git a/server/src/main/java/org/elasticsearch/action/get/GetRequest.java b/server/src/main/java/org/elasticsearch/action/get/GetRequest.java index 2654a69b12728..f15bb2ef448df 100644 --- a/server/src/main/java/org/elasticsearch/action/get/GetRequest.java +++ b/server/src/main/java/org/elasticsearch/action/get/GetRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.get; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.RealtimeRequest; import org.elasticsearch.action.ValidateActions; @@ -66,7 +66,7 @@ public GetRequest() {} GetRequest(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readString(); } id = in.readString(); @@ -79,7 +79,7 @@ public GetRequest() {} this.versionType = VersionType.fromValue(in.readByte()); this.version = in.readLong(); fetchSourceContext = in.readOptionalWriteable(FetchSourceContext::readFrom); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { forceSyntheticSource = in.readBoolean(); } else { forceSyntheticSource = false; @@ -89,7 +89,7 @@ public GetRequest() {} @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeString(MapperService.SINGLE_MAPPING_NAME); } out.writeString(id); @@ -102,7 +102,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeByte(versionType.getValue()); out.writeLong(version); out.writeOptionalWriteable(fetchSourceContext); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeBoolean(forceSyntheticSource); } else { if (forceSyntheticSource) { diff --git a/server/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java b/server/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java index faa93a61902d3..e00edefc26289 100644 --- a/server/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java +++ b/server/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.get; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.CompositeIndicesRequest; @@ -85,7 +85,7 @@ public Item() { public Item(StreamInput in) throws IOException { index = in.readString(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readOptionalString(); } id = in.readString(); @@ -179,7 +179,7 @@ public Item fetchSourceContext(FetchSourceContext fetchSourceContext) { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(index); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeOptionalString(MapperService.SINGLE_MAPPING_NAME); } out.writeString(id); @@ -263,7 +263,7 @@ public MultiGetRequest(StreamInput in) throws IOException { refresh = in.readBoolean(); realtime = in.readBoolean(); items = in.readCollectionAsList(Item::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { forceSyntheticSource = in.readBoolean(); } else { forceSyntheticSource = false; @@ -277,7 +277,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(refresh); out.writeBoolean(realtime); out.writeCollection(items); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeBoolean(forceSyntheticSource); } else { if (forceSyntheticSource) { diff --git a/server/src/main/java/org/elasticsearch/action/get/MultiGetResponse.java b/server/src/main/java/org/elasticsearch/action/get/MultiGetResponse.java index b7c68a51ed604..e91329e810397 100644 --- a/server/src/main/java/org/elasticsearch/action/get/MultiGetResponse.java +++ b/server/src/main/java/org/elasticsearch/action/get/MultiGetResponse.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.get; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.collect.Iterators; import org.elasticsearch.common.io.stream.StreamInput; @@ -57,7 +57,7 @@ public Failure(String index, String id, Exception exception) { Failure(StreamInput in) throws IOException { index = in.readString(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readOptionalString(); } id = in.readString(); @@ -88,7 +88,7 @@ public String getMessage() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(index); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeOptionalString(MapperService.SINGLE_MAPPING_NAME); } out.writeString(id); diff --git a/server/src/main/java/org/elasticsearch/action/get/MultiGetShardRequest.java b/server/src/main/java/org/elasticsearch/action/get/MultiGetShardRequest.java index 2f2615f64cbd1..fd0aa8ea2e232 100644 --- a/server/src/main/java/org/elasticsearch/action/get/MultiGetShardRequest.java +++ b/server/src/main/java/org/elasticsearch/action/get/MultiGetShardRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.get; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.single.shard.SingleShardRequest; import org.elasticsearch.common.io.stream.StreamInput; @@ -83,7 +83,7 @@ public int hashCode() { preference = in.readOptionalString(); refresh = in.readBoolean(); realtime = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { forceSyntheticSource = in.readBoolean(); } else { forceSyntheticSource = false; @@ -103,7 +103,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(preference); out.writeBoolean(refresh); out.writeBoolean(realtime); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeBoolean(forceSyntheticSource); } else { if (forceSyntheticSource) { diff --git a/server/src/main/java/org/elasticsearch/action/index/IndexRequest.java b/server/src/main/java/org/elasticsearch/action/index/IndexRequest.java index 94d0b8c44b81a..b1beecd980cee 100644 --- a/server/src/main/java/org/elasticsearch/action/index/IndexRequest.java +++ b/server/src/main/java/org/elasticsearch/action/index/IndexRequest.java @@ -11,6 +11,7 @@ import org.apache.lucene.util.RamUsageEstimator; import org.elasticsearch.ElasticsearchGenerationException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.CompositeIndicesRequest; @@ -67,7 +68,7 @@ public class IndexRequest extends ReplicatedWriteRequest implements DocWriteRequest, CompositeIndicesRequest { private static final long SHALLOW_SIZE = RamUsageEstimator.shallowSizeOfInstance(IndexRequest.class); - private static final TransportVersion PIPELINES_HAVE_RUN_FIELD_ADDED = TransportVersion.V_8_500_049; + private static final TransportVersion PIPELINES_HAVE_RUN_FIELD_ADDED = TransportVersions.V_8_500_049; /** * Max length of the source document to include into string() @@ -129,7 +130,7 @@ public IndexRequest(StreamInput in) throws IOException { public IndexRequest(@Nullable ShardId shardId, StreamInput in) throws IOException { super(shardId, in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { String type = in.readOptionalString(); assert MapperService.SINGLE_MAPPING_NAME.equals(type) : "Expected [_doc] but received [" + type + "]"; } @@ -140,10 +141,10 @@ public IndexRequest(@Nullable ShardId shardId, StreamInput in) throws IOExceptio version = in.readLong(); versionType = VersionType.fromValue(in.readByte()); pipeline = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_5_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_5_0)) { finalPipeline = in.readOptionalString(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_5_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_5_0)) { isPipelineResolved = in.readBoolean(); } isRetry = in.readBoolean(); @@ -155,12 +156,12 @@ public IndexRequest(@Nullable ShardId shardId, StreamInput in) throws IOExceptio } ifSeqNo = in.readZLong(); ifPrimaryTerm = in.readVLong(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { requireAlias = in.readBoolean(); } else { requireAlias = false; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { dynamicTemplates = in.readMap(StreamInput::readString); } if (in.getTransportVersion().onOrAfter(PIPELINES_HAVE_RUN_FIELD_ADDED)) { @@ -654,7 +655,7 @@ public void reset() { } public void checkAutoIdWithOpTypeCreateSupportedByVersion(TransportVersion version) { - if (id == null && opType == OpType.CREATE && version.before(TransportVersion.V_7_5_0)) { + if (id == null && opType == OpType.CREATE && version.before(TransportVersions.V_7_5_0)) { throw new IllegalArgumentException( "optype create not supported for indexing requests without explicit id below transport version 7500099, current version " + version @@ -687,7 +688,7 @@ public void writeThin(StreamOutput out) throws IOException { } private void writeBody(StreamOutput out) throws IOException { - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeOptionalString(MapperService.SINGLE_MAPPING_NAME); } out.writeOptionalString(id); @@ -697,10 +698,10 @@ private void writeBody(StreamOutput out) throws IOException { out.writeLong(version); out.writeByte(versionType.getValue()); out.writeOptionalString(pipeline); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_5_0)) { out.writeOptionalString(finalPipeline); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_5_0)) { out.writeBoolean(isPipelineResolved); } out.writeBoolean(isRetry); @@ -713,10 +714,10 @@ private void writeBody(StreamOutput out) throws IOException { } out.writeZLong(ifSeqNo); out.writeVLong(ifPrimaryTerm); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeBoolean(requireAlias); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { out.writeMap(dynamicTemplates, StreamOutput::writeString); } else { if (dynamicTemplates.isEmpty() == false) { diff --git a/server/src/main/java/org/elasticsearch/action/ingest/SimulateProcessorResult.java b/server/src/main/java/org/elasticsearch/action/ingest/SimulateProcessorResult.java index 0271afb9a9b77..d4ae5e33f3b10 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/SimulateProcessorResult.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/SimulateProcessorResult.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.ingest; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -160,7 +160,7 @@ public SimulateProcessorResult(String type, String processorTag, String descript * Read from a stream. */ SimulateProcessorResult(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { this.processorTag = in.readOptionalString(); } else { this.processorTag = in.readString(); @@ -179,7 +179,7 @@ public SimulateProcessorResult(String type, String processorTag, String descript @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeOptionalString(processorTag); } else { out.writeString(processorTag); diff --git a/server/src/main/java/org/elasticsearch/action/search/CanMatchNodeRequest.java b/server/src/main/java/org/elasticsearch/action/search/CanMatchNodeRequest.java index 4cca20d3d0c30..865b7bdf8abfa 100644 --- a/server/src/main/java/org/elasticsearch/action/search/CanMatchNodeRequest.java +++ b/server/src/main/java/org/elasticsearch/action/search/CanMatchNodeRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.search; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.action.support.IndicesOptions; @@ -151,7 +151,7 @@ public CanMatchNodeRequest(StreamInput in) throws IOException { source = in.readOptionalWriteable(SearchSourceBuilder::new); indicesOptions = IndicesOptions.readIndicesOptions(in); searchType = SearchType.fromId(in.readByte()); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types no longer relevant so ignore String[] types = in.readStringArray(); if (types.length > 0) { @@ -177,7 +177,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(source); indicesOptions.writeIndicesOptions(out); out.writeByte(searchType.id()); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types not supported so send an empty array to previous versions out.writeStringArray(Strings.EMPTY_ARRAY); } diff --git a/server/src/main/java/org/elasticsearch/action/search/OpenPointInTimeRequest.java b/server/src/main/java/org/elasticsearch/action/search/OpenPointInTimeRequest.java index a8cb8002a80d8..83731c276a769 100644 --- a/server/src/main/java/org/elasticsearch/action/search/OpenPointInTimeRequest.java +++ b/server/src/main/java/org/elasticsearch/action/search/OpenPointInTimeRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.search; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.IndicesRequest; @@ -51,7 +51,7 @@ public OpenPointInTimeRequest(StreamInput in) throws IOException { this.keepAlive = in.readTimeValue(); this.routing = in.readOptionalString(); this.preference = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_017)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_017)) { this.maxConcurrentShardRequests = in.readVInt(); } } @@ -64,7 +64,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeTimeValue(keepAlive); out.writeOptionalString(routing); out.writeOptionalString(preference); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_017)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_017)) { out.writeVInt(maxConcurrentShardRequests); } } diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchRequest.java b/server/src/main/java/org/elasticsearch/action/search/SearchRequest.java index d20ffab777595..55ad5a2522967 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchRequest.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchRequest.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.search; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; @@ -239,7 +240,7 @@ public SearchRequest(StreamInput in) throws IOException { preference = in.readOptionalString(); scroll = in.readOptionalWriteable(Scroll::new); source = in.readOptionalWriteable(SearchSourceBuilder::new); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types no longer relevant so ignore String[] types = in.readStringArray(); if (types.length > 0) { @@ -263,16 +264,16 @@ public SearchRequest(StreamInput in) throws IOException { finalReduce = true; } ccsMinimizeRoundtrips = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_12_0) && in.readBoolean()) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_12_0) && in.readBoolean()) { minCompatibleShardNode = Version.readVersion(in); } else { minCompatibleShardNode = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { waitForCheckpoints = in.readMap(StreamInput::readLongArray); waitForCheckpointsTimeout = in.readTimeValue(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { forceSyntheticSource = in.readBoolean(); } else { forceSyntheticSource = false; @@ -288,7 +289,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(preference); out.writeOptionalWriteable(scroll); out.writeOptionalWriteable(source); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types not supported so send an empty array to previous versions out.writeStringArray(Strings.EMPTY_ARRAY); } @@ -304,13 +305,13 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(finalReduce); } out.writeBoolean(ccsMinimizeRoundtrips); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_12_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_12_0)) { out.writeBoolean(minCompatibleShardNode != null); if (minCompatibleShardNode != null) { Version.writeVersion(minCompatibleShardNode, out); } } - TransportVersion waitForCheckpointsVersion = TransportVersion.V_7_16_0; + TransportVersion waitForCheckpointsVersion = TransportVersions.V_7_16_0; if (out.getTransportVersion().onOrAfter(waitForCheckpointsVersion)) { out.writeMap(waitForCheckpoints, StreamOutput::writeLongArray); out.writeTimeValue(waitForCheckpointsTimeout); @@ -324,7 +325,7 @@ public void writeTo(StreamOutput out) throws IOException { + "] or greater." ); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeBoolean(forceSyntheticSource); } else { if (forceSyntheticSource) { diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchResponse.java b/server/src/main/java/org/elasticsearch/action/search/SearchResponse.java index 4d9453d50c869..fd995d284ea69 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchResponse.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchResponse.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.search; import org.apache.lucene.search.TotalHits; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.common.Strings; @@ -95,7 +95,7 @@ public SearchResponse(StreamInput in) throws IOException { scrollId = in.readOptionalString(); tookInMillis = in.readVLong(); skippedShards = in.readVInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { pointInTimeId = in.readOptionalString(); } else { pointInTimeId = null; @@ -440,7 +440,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(scrollId); out.writeVLong(tookInMillis); out.writeVInt(skippedShards); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeOptionalString(pointInTimeId); } } @@ -537,7 +537,7 @@ public Clusters(StreamInput in) throws IOException { this.total = in.readVInt(); this.successful = in.readVInt(); this.skipped = in.readVInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_053)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_053)) { List clusterList = in.readCollectionAsList(Cluster::new); if (clusterList.isEmpty()) { this.clusterInfo = Collections.emptyMap(); @@ -569,7 +569,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVInt(total); out.writeVInt(successful); out.writeVInt(skipped); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_053)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_053)) { if (clusterInfo != null) { List clusterList = clusterInfo.values().stream().map(AtomicReference::get).toList(); out.writeCollection(clusterList); @@ -885,7 +885,7 @@ public Cluster(StreamInput in) throws IOException { } this.timedOut = in.readBoolean(); this.failures = Collections.unmodifiableList(in.readCollectionAsList(ShardSearchFailure::readShardSearchFailure)); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_066)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_066)) { this.skipUnavailable = in.readBoolean(); } else { this.skipUnavailable = SKIP_UNAVAILABLE_DEFAULT; @@ -990,7 +990,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalLong(took == null ? null : took.millis()); out.writeBoolean(timedOut); out.writeCollection(failures); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_067)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_067)) { out.writeBoolean(skipUnavailable); } } diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchTransportService.java b/server/src/main/java/org/elasticsearch/action/search/SearchTransportService.java index 34cd7e6165c4b..9714fc7574418 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchTransportService.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchTransportService.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.search; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListenerResponseHandler; @@ -155,7 +155,7 @@ public void sendCanMatch( SearchTask task, final ActionListener listener ) { - if (connection.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0) + if (connection.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0) && connection.getNode().getVersion().onOrAfter(Version.V_7_16_0)) { transportService.sendChildRequest( connection, diff --git a/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java b/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java index a185b9acadb8c..f0b89188f7124 100644 --- a/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java +++ b/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java @@ -10,7 +10,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListenerResponseHandler; import org.elasticsearch.action.IndicesRequest; @@ -691,7 +691,7 @@ Map createFinalResponse() { final String[] indices = entry.getValue().indices(); final Executor responseExecutor = transportService.getThreadPool().executor(ThreadPool.Names.SEARCH_COORDINATION); // TODO: support point-in-time - if (searchContext == null && connection.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (searchContext == null && connection.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { SearchShardsRequest searchShardsRequest = new SearchShardsRequest( indices, indicesOptions, diff --git a/server/src/main/java/org/elasticsearch/action/search/TransportSearchHelper.java b/server/src/main/java/org/elasticsearch/action/search/TransportSearchHelper.java index 5680a4525b468..d603324ff5c26 100644 --- a/server/src/main/java/org/elasticsearch/action/search/TransportSearchHelper.java +++ b/server/src/main/java/org/elasticsearch/action/search/TransportSearchHelper.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.search; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.ByteArrayStreamInput; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.VersionCheckingStreamOutput; @@ -105,14 +105,14 @@ static ParsedScrollId parseScrollId(String scrollId) { */ public static void checkCCSVersionCompatibility(Writeable writeableRequest) { try { - writeableRequest.writeTo(new VersionCheckingStreamOutput(TransportVersion.MINIMUM_CCS_VERSION)); + writeableRequest.writeTo(new VersionCheckingStreamOutput(TransportVersions.MINIMUM_CCS_VERSION)); } catch (Exception e) { // if we cannot serialize, raise this as an error to indicate to the caller that CCS has problems with this request throw new IllegalArgumentException( "[" + writeableRequest.getClass() + "] is not compatible with version " - + TransportVersion.MINIMUM_CCS_VERSION + + TransportVersions.MINIMUM_CCS_VERSION + " and the '" + SearchService.CCS_VERSION_CHECK_SETTING.getKey() + "' setting is enabled.", diff --git a/server/src/main/java/org/elasticsearch/action/support/broadcast/unpromotable/BroadcastUnpromotableRequest.java b/server/src/main/java/org/elasticsearch/action/support/broadcast/unpromotable/BroadcastUnpromotableRequest.java index 64c6b3e98bc8b..f1835ac413af2 100644 --- a/server/src/main/java/org/elasticsearch/action/support/broadcast/unpromotable/BroadcastUnpromotableRequest.java +++ b/server/src/main/java/org/elasticsearch/action/support/broadcast/unpromotable/BroadcastUnpromotableRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.support.broadcast.unpromotable; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.IndicesRequest; @@ -46,7 +46,7 @@ public BroadcastUnpromotableRequest(StreamInput in) throws IOException { indexShardRoutingTable = null; shardId = new ShardId(in); indices = new String[] { shardId.getIndex().getName() }; - failShardOnError = in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010) && in.readBoolean(); + failShardOnError = in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010) && in.readBoolean(); } public BroadcastUnpromotableRequest(IndexShardRoutingTable indexShardRoutingTable) { @@ -77,7 +77,7 @@ public ActionRequestValidationException validate() { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeWriteable(shardId); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeBoolean(failShardOnError); } } diff --git a/server/src/main/java/org/elasticsearch/action/support/master/info/ClusterInfoRequest.java b/server/src/main/java/org/elasticsearch/action/support/master/info/ClusterInfoRequest.java index 8e80444cc125c..22f0da70137af 100644 --- a/server/src/main/java/org/elasticsearch/action/support/master/info/ClusterInfoRequest.java +++ b/server/src/main/java/org/elasticsearch/action/support/master/info/ClusterInfoRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.support.master.info; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.master.MasterNodeReadRequest; @@ -31,7 +31,7 @@ public ClusterInfoRequest() {} public ClusterInfoRequest(StreamInput in) throws IOException { super(in); indices = in.readStringArray(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readStringArray(); } indicesOptions = IndicesOptions.readIndicesOptions(in); @@ -41,7 +41,7 @@ public ClusterInfoRequest(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeStringArray(indices); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeStringArray(Strings.EMPTY_ARRAY); } indicesOptions.writeIndicesOptions(out); diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsResponse.java b/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsResponse.java index 150545f51b14e..b631d30cfd8bb 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsResponse.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.termvectors; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.collect.Iterators; import org.elasticsearch.common.io.stream.StreamInput; @@ -41,7 +41,7 @@ public Failure(String index, String id, Exception cause) { public Failure(StreamInput in) throws IOException { index = in.readString(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types no longer relevant so ignore String type = in.readOptionalString(); if (type != null) { @@ -76,7 +76,7 @@ public Exception getCause() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(index); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types not supported so send an empty array to previous versions out.writeOptionalString(null); } diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java index fb5f1f6ee1348..6a1f67a821c7c 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.termvectors; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.RealtimeRequest; import org.elasticsearch.action.ValidateActions; @@ -128,7 +128,7 @@ public TermVectorsRequest() {} TermVectorsRequest(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types no longer relevant so ignore in.readString(); } @@ -477,7 +477,7 @@ public ActionRequestValidationException validate() { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types not supported so send an empty array to previous versions out.writeString("_doc"); } diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsResponse.java b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsResponse.java index 82174485d8292..e0c9b86e4139f 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsResponse.java @@ -16,7 +16,7 @@ import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.CharsRefBuilder; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.termvectors.TermVectorsRequest.Flag; import org.elasticsearch.common.bytes.BytesArray; @@ -91,7 +91,7 @@ public TermVectorsResponse(String index, String id) { TermVectorsResponse(StreamInput in) throws IOException { index = in.readString(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types no longer relevant so ignore in.readString(); } @@ -109,7 +109,7 @@ public TermVectorsResponse(String index, String id) { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(index); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types not supported so send an empty array to previous versions out.writeString(MapperService.SINGLE_MAPPING_NAME); } diff --git a/server/src/main/java/org/elasticsearch/action/update/UpdateRequest.java b/server/src/main/java/org/elasticsearch/action/update/UpdateRequest.java index 6801bf2c0fd10..600790b2fd841 100644 --- a/server/src/main/java/org/elasticsearch/action/update/UpdateRequest.java +++ b/server/src/main/java/org/elasticsearch/action/update/UpdateRequest.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.update; import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.DocWriteRequest; import org.elasticsearch.action.index.IndexRequest; @@ -136,7 +136,7 @@ public UpdateRequest(StreamInput in) throws IOException { public UpdateRequest(@Nullable ShardId shardId, StreamInput in) throws IOException { super(shardId, in); waitForActiveShards = ActiveShardCount.readFrom(in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { String type = in.readString(); assert MapperService.SINGLE_MAPPING_NAME.equals(type) : "Expected [_doc] but received [" + type + "]"; } @@ -159,7 +159,7 @@ public UpdateRequest(@Nullable ShardId shardId, StreamInput in) throws IOExcepti ifPrimaryTerm = in.readVLong(); detectNoop = in.readBoolean(); scriptedUpsert = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { requireAlias = in.readBoolean(); } else { requireAlias = false; @@ -860,7 +860,7 @@ public void writeThin(StreamOutput out) throws IOException { private void doWrite(StreamOutput out, boolean thin) throws IOException { waitForActiveShards.writeTo(out); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeString(MapperService.SINGLE_MAPPING_NAME); } out.writeString(id); @@ -905,7 +905,7 @@ private void doWrite(StreamOutput out, boolean thin) throws IOException { out.writeVLong(ifPrimaryTerm); out.writeBoolean(detectNoop); out.writeBoolean(scriptedUpsert); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeBoolean(requireAlias); } } diff --git a/server/src/main/java/org/elasticsearch/cluster/ClusterInfo.java b/server/src/main/java/org/elasticsearch/cluster/ClusterInfo.java index cae304a74a211..dba181d8e8159 100644 --- a/server/src/main/java/org/elasticsearch/cluster/ClusterInfo.java +++ b/server/src/main/java/org/elasticsearch/cluster/ClusterInfo.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.routing.RecoverySource; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.UnassignedInfo; @@ -48,8 +49,8 @@ public class ClusterInfo implements ChunkedToXContent, Writeable { public static final ClusterInfo EMPTY = new ClusterInfo(); - public static final TransportVersion DATA_SET_SIZE_SIZE_VERSION = TransportVersion.V_7_13_0; - public static final TransportVersion DATA_PATH_NEW_KEY_VERSION = TransportVersion.V_8_6_0; + public static final TransportVersion DATA_SET_SIZE_SIZE_VERSION = TransportVersions.V_7_13_0; + public static final TransportVersion DATA_PATH_NEW_KEY_VERSION = TransportVersions.V_8_6_0; private final Map leastAvailableSpaceUsage; private final Map mostAvailableSpaceUsage; diff --git a/server/src/main/java/org/elasticsearch/cluster/ClusterState.java b/server/src/main/java/org/elasticsearch/cluster/ClusterState.java index 5bd4469935b6f..67c314881d49f 100644 --- a/server/src/main/java/org/elasticsearch/cluster/ClusterState.java +++ b/server/src/main/java/org/elasticsearch/cluster/ClusterState.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.support.master.TransportMasterNodeAction; import org.elasticsearch.cluster.block.ClusterBlock; @@ -222,12 +223,12 @@ public ClusterState( assert assertConsistentRoutingNodes(routingTable, nodes, routingNodes); this.minTransportVersion = blocks.hasGlobalBlock(STATE_NOT_RECOVERED_BLOCK) - ? TransportVersion.MINIMUM_COMPATIBLE + ? TransportVersions.MINIMUM_COMPATIBLE : transportVersions.values() .stream() .min(Comparator.naturalOrder()) // In practice transportVersions is always nonempty (except in tests) but use a conservative default anyway: - .orElse(TransportVersion.MINIMUM_COMPATIBLE); + .orElse(TransportVersions.MINIMUM_COMPATIBLE); } private static boolean assertConsistentRoutingNodes( @@ -922,7 +923,7 @@ public static ClusterState readFrom(StreamInput in, DiscoveryNode localNode) thr builder.metadata = Metadata.readFrom(in); builder.routingTable = RoutingTable.readFrom(in); builder.nodes = DiscoveryNodes.readFrom(in, localNode); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { builder.transportVersions(in.readMap(TransportVersion::readVersion)); } else { // this clusterstate is from a pre-8.8.0 node @@ -935,7 +936,7 @@ public static ClusterState readFrom(StreamInput in, DiscoveryNode localNode) thr Custom customIndexMetadata = in.readNamedWriteable(Custom.class); builder.putCustom(customIndexMetadata.getWriteableName(), customIndexMetadata); } - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readVInt(); // used to be minimumMasterNodesOnPublishingMaster, which was used in 7.x for BWC with 6.x } return builder.build(); @@ -945,7 +946,7 @@ public static ClusterState readFrom(StreamInput in, DiscoveryNode localNode) thr * If the cluster state does not contain transport version information, this is the version * that is inferred for all nodes on version 8.8.0 or above. */ - public static final TransportVersion INFERRED_TRANSPORT_VERSION = TransportVersion.V_8_8_0; + public static final TransportVersion INFERRED_TRANSPORT_VERSION = TransportVersions.V_8_8_0; private static TransportVersion inferTransportVersion(DiscoveryNode node) { TransportVersion tv; @@ -967,12 +968,12 @@ public void writeTo(StreamOutput out) throws IOException { metadata.writeTo(out); routingTable.writeTo(out); nodes.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeMap(transportVersions, (o, v) -> TransportVersion.writeVersion(v, o)); } blocks.writeTo(out); VersionedNamedWriteable.writeVersionedWritables(out, customs); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeVInt(-1); // used to be minimumMasterNodesOnPublishingMaster, which was used in 7.x for BWC with 6.x } } @@ -1025,7 +1026,7 @@ private static class ClusterStateDiff implements Diff { toVersion = in.readLong(); routingTable = RoutingTable.readDiffFrom(in); nodes = DiscoveryNodes.readDiffFrom(in, localNode); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0) && in.readBoolean()) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0) && in.readBoolean()) { transportVersions = DiffableUtils.readJdkMapDiff( in, DiffableUtils.getStringKeySerializer(), @@ -1037,7 +1038,7 @@ private static class ClusterStateDiff implements Diff { metadata = Metadata.readDiffFrom(in); blocks = ClusterBlocks.readDiffFrom(in); customs = DiffableUtils.readJdkMapDiff(in, DiffableUtils.getStringKeySerializer(), CUSTOM_VALUE_SERIALIZER); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readVInt(); // used to be minimumMasterNodesOnPublishingMaster, which was used in 7.x for BWC with 6.x } } @@ -1050,13 +1051,13 @@ public void writeTo(StreamOutput out) throws IOException { out.writeLong(toVersion); routingTable.writeTo(out); nodes.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeOptionalWriteable(transportVersions); } metadata.writeTo(out); blocks.writeTo(out); customs.writeTo(out); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeVInt(-1); // used to be minimumMasterNodesOnPublishingMaster, which was used in 7.x for BWC with 6.x } } diff --git a/server/src/main/java/org/elasticsearch/cluster/RepositoryCleanupInProgress.java b/server/src/main/java/org/elasticsearch/cluster/RepositoryCleanupInProgress.java index 3e63ee71e2eb6..d3a9397d148cf 100644 --- a/server/src/main/java/org/elasticsearch/cluster/RepositoryCleanupInProgress.java +++ b/server/src/main/java/org/elasticsearch/cluster/RepositoryCleanupInProgress.java @@ -8,6 +8,7 @@ package org.elasticsearch.cluster; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.collect.Iterators; import org.elasticsearch.common.io.stream.StreamInput; @@ -88,7 +89,7 @@ public String toString() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_4_0; + return TransportVersions.V_7_4_0; } public static final class Entry implements Writeable, RepositoryOperation { diff --git a/server/src/main/java/org/elasticsearch/cluster/RestoreInProgress.java b/server/src/main/java/org/elasticsearch/cluster/RestoreInProgress.java index 390e755cc5ff5..bd7a2ed1cffc0 100644 --- a/server/src/main/java/org/elasticsearch/cluster/RestoreInProgress.java +++ b/server/src/main/java/org/elasticsearch/cluster/RestoreInProgress.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest; import org.elasticsearch.cluster.ClusterState.Custom; import org.elasticsearch.common.collect.Iterators; @@ -349,7 +350,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } public static NamedDiff readDiffFrom(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/elasticsearch/cluster/SnapshotDeletionsInProgress.java b/server/src/main/java/org/elasticsearch/cluster/SnapshotDeletionsInProgress.java index e9a051ce6fca6..a4fde4993a47e 100644 --- a/server/src/main/java/org/elasticsearch/cluster/SnapshotDeletionsInProgress.java +++ b/server/src/main/java/org/elasticsearch/cluster/SnapshotDeletionsInProgress.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterState.Custom; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.collect.Iterators; @@ -162,7 +163,7 @@ public static NamedDiff readDiffFrom(StreamInput in) throws IOException @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } @Override diff --git a/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java b/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java index 32f4c4c6b4cd5..0f046d4ab94f1 100644 --- a/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java +++ b/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterState.Custom; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.Strings; @@ -192,10 +193,10 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } - private static final TransportVersion DIFFABLE_VERSION = TransportVersion.V_8_5_0; + private static final TransportVersion DIFFABLE_VERSION = TransportVersions.V_8_5_0; public static NamedDiff readDiffFrom(StreamInput in) throws IOException { if (in.getTransportVersion().onOrAfter(DIFFABLE_VERSION)) { @@ -1614,7 +1615,7 @@ public SnapshotsInProgress apply(Custom part) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } @Override diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/JoinRequest.java b/server/src/main/java/org/elasticsearch/cluster/coordination/JoinRequest.java index 45335689a6635..702580e2f5ccd 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/JoinRequest.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/JoinRequest.java @@ -8,6 +8,7 @@ package org.elasticsearch.cluster.coordination; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -55,7 +56,7 @@ public JoinRequest(DiscoveryNode sourceNode, TransportVersion transportVersion, public JoinRequest(StreamInput in) throws IOException { super(in); sourceNode = new DiscoveryNode(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { transportVersion = TransportVersion.readVersion(in); } else { // there's a 1-1 mapping from Version to TransportVersion before 8.8.0 @@ -69,7 +70,7 @@ public JoinRequest(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); sourceNode.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { TransportVersion.writeVersion(transportVersion, out); } out.writeLong(minimumTerm); diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/PublicationTransportHandler.java b/server/src/main/java/org/elasticsearch/cluster/coordination/PublicationTransportHandler.java index 4cf5cd6787ab6..45079b2bccd60 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/PublicationTransportHandler.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/PublicationTransportHandler.java @@ -11,6 +11,7 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionRunnable; import org.elasticsearch.cluster.ClusterState; @@ -89,7 +90,7 @@ public class PublicationTransportHandler { TransportRequestOptions.Type.STATE ); - public static final TransportVersion INCLUDES_LAST_COMMITTED_DATA_VERSION = TransportVersion.V_8_6_0; + public static final TransportVersion INCLUDES_LAST_COMMITTED_DATA_VERSION = TransportVersions.V_8_6_0; private final SerializationStatsTracker serializationStatsTracker = new SerializationStatsTracker(); diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/ValidateJoinRequest.java b/server/src/main/java/org/elasticsearch/cluster/coordination/ValidateJoinRequest.java index d2f9f18466aa1..c6463949f774f 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/ValidateJoinRequest.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/ValidateJoinRequest.java @@ -8,6 +8,7 @@ package org.elasticsearch.cluster.coordination; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.CheckedSupplier; import org.elasticsearch.common.bytes.BytesReference; @@ -28,7 +29,7 @@ public class ValidateJoinRequest extends TransportRequest { public ValidateJoinRequest(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { // recent versions send a BytesTransportRequest containing a compressed representation of the state final var bytes = in.readReleasableBytesReference(); final var version = in.getTransportVersion(); @@ -67,7 +68,7 @@ public ValidateJoinRequest(ClusterState state) { @Override public void writeTo(StreamOutput out) throws IOException { - assert out.getTransportVersion().before(TransportVersion.V_8_3_0); + assert out.getTransportVersion().before(TransportVersions.V_8_3_0); super.writeTo(out); stateSupplier.get().writeTo(out); } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplateMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplateMetadata.java index ec6d6fd252899..71966deb076b6 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplateMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplateMetadata.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; @@ -87,7 +88,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_7_0; + return TransportVersions.V_7_7_0; } @Override @@ -164,7 +165,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_7_0; + return TransportVersions.V_7_7_0; } } } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java index 2af48b0799e3c..bd745e7ff4ea6 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java @@ -8,7 +8,7 @@ package org.elasticsearch.cluster.metadata; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.admin.indices.rollover.RolloverConfiguration; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.SimpleDiffable; @@ -173,7 +173,7 @@ public ComposableIndexTemplate(StreamInput in) throws IOException { this.metadata = in.readMap(); this.dataStreamTemplate = in.readOptionalWriteable(DataStreamTemplate::new); this.allowAutoCreate = in.readOptionalBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { this.ignoreMissingComponentTemplates = in.readOptionalStringCollectionAsList(); } else { this.ignoreMissingComponentTemplates = null; @@ -265,7 +265,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeGenericMap(this.metadata); out.writeOptionalWriteable(dataStreamTemplate); out.writeOptionalBoolean(allowAutoCreate); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeOptionalStringCollection(ignoreMissingComponentTemplates); } } @@ -394,12 +394,12 @@ public DataStreamTemplate(boolean hidden, boolean allowCustomRouting) { DataStreamTemplate(StreamInput in) throws IOException { hidden = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { allowCustomRouting = in.readBoolean(); } else { allowCustomRouting = false; } - if (in.getTransportVersion().between(TransportVersion.V_8_1_0, TransportVersion.V_8_3_0)) { + if (in.getTransportVersion().between(TransportVersions.V_8_1_0, TransportVersions.V_8_3_0)) { // Accidentally included index_mode to binary node to node protocol in previous releases. // (index_mode is removed and was part of code based when tsdb was behind a feature flag) // (index_mode was behind a feature in the xcontent parser, so it could never actually used) @@ -438,10 +438,10 @@ public boolean isAllowCustomRouting() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(hidden); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeBoolean(allowCustomRouting); } - if (out.getTransportVersion().between(TransportVersion.V_8_1_0, TransportVersion.V_8_3_0)) { + if (out.getTransportVersion().between(TransportVersions.V_8_1_0, TransportVersions.V_8_3_0)) { // See comment in constructor. out.writeBoolean(false); } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplateMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplateMetadata.java index 736b5a27c1e9d..8fd606048d539 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplateMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplateMetadata.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; @@ -92,7 +93,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_7_0; + return TransportVersions.V_7_7_0; } @Override @@ -165,7 +166,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_7_0; + return TransportVersions.V_7_7_0; } } } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java index f7cf0d53cc93c..5fce32febc2ef 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java @@ -11,7 +11,7 @@ import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.PointValues; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.DocWriteRequest; import org.elasticsearch.action.admin.indices.rollover.RolloverConfiguration; import org.elasticsearch.action.admin.indices.rollover.RolloverInfo; @@ -787,9 +787,9 @@ public DataStream(StreamInput in) throws IOException { in.readBoolean(), in.readBoolean(), in.readBoolean(), - in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0) ? in.readBoolean() : false, - in.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0) ? in.readOptionalEnum(IndexMode.class) : null, - in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010) ? in.readOptionalWriteable(DataStreamLifecycle::new) : null + in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0) ? in.readBoolean() : false, + in.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0) ? in.readOptionalEnum(IndexMode.class) : null, + in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010) ? in.readOptionalWriteable(DataStreamLifecycle::new) : null ); } @@ -812,13 +812,13 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(hidden); out.writeBoolean(replicated); out.writeBoolean(system); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeBoolean(allowCustomRouting); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { out.writeOptionalEnum(indexMode); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeOptionalWriteable(lifecycle); } } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java index 0f2e91e2f141d..4c86a91ee82f2 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.cluster.metadata; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.SimpleDiffable; import org.elasticsearch.common.ParsingException; @@ -167,7 +167,7 @@ public DataStreamAlias(StreamInput in) throws IOException { this.name = in.readString(); this.dataStreams = in.readStringCollectionAsList(); this.writeDataStream = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { this.dataStreamToFilterMap = in.readMap(CompressedXContent::readCompressedString); } else { this.dataStreamToFilterMap = new HashMap<>(); @@ -398,7 +398,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(name); out.writeStringCollection(dataStreams); out.writeOptionalString(writeDataStream); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeMap(dataStreamToFilterMap, StreamOutput::writeWriteable); } else { if (dataStreamToFilterMap.isEmpty()) { diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamLifecycle.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamLifecycle.java index 6f24fe94387e9..e78a6e748902a 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamLifecycle.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamLifecycle.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.admin.indices.rollover.RolloverConfiguration; import org.elasticsearch.action.downsample.DownsampleConfig; import org.elasticsearch.cluster.Diff; @@ -46,7 +47,7 @@ public class DataStreamLifecycle implements SimpleDiffable, ToXContentObject { // Versions over the wire - public static final TransportVersion ADDED_ENABLED_FLAG_VERSION = TransportVersion.V_8_500_057; + public static final TransportVersion ADDED_ENABLED_FLAG_VERSION = TransportVersions.V_8_500_057; public static final Setting CLUSTER_LIFECYCLE_DEFAULT_ROLLOVER_SETTING = new Setting<>( "cluster.lifecycle.default.rollover", @@ -172,10 +173,10 @@ public int hashCode() { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeOptionalWriteable(dataRetention); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_026)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_026)) { out.writeOptionalWriteable(downsampling); } if (out.getTransportVersion().onOrAfter(ADDED_ENABLED_FLAG_VERSION)) { @@ -184,12 +185,12 @@ public void writeTo(StreamOutput out) throws IOException { } public DataStreamLifecycle(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { dataRetention = in.readOptionalWriteable(Retention::read); } else { dataRetention = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_026)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_026)) { downsampling = in.readOptionalWriteable(Downsampling::read); } else { downsampling = null; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java index 45b6c4a513f75..fef9ebe993a4d 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java @@ -10,6 +10,7 @@ import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; @@ -216,7 +217,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_7_0; + return TransportVersions.V_7_7_0; } @Override @@ -313,7 +314,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_7_0; + return TransportVersions.V_7_7_0; } } } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DesiredNode.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DesiredNode.java index 0a7eb6fa954c2..de46e04ea6215 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DesiredNode.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DesiredNode.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeRole; @@ -40,7 +41,7 @@ public final class DesiredNode implements Writeable, ToXContentObject, Comparable { public static final Version RANGE_FLOAT_PROCESSORS_SUPPORT_VERSION = Version.V_8_3_0; - public static final TransportVersion RANGE_FLOAT_PROCESSORS_SUPPORT_TRANSPORT_VERSION = TransportVersion.V_8_3_0; + public static final TransportVersion RANGE_FLOAT_PROCESSORS_SUPPORT_TRANSPORT_VERSION = TransportVersions.V_8_3_0; private static final ParseField SETTINGS_FIELD = new ParseField("settings"); private static final ParseField PROCESSORS_FIELD = new ParseField("processors"); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DesiredNodeWithStatus.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DesiredNodeWithStatus.java index 036b31fa65be5..9c5710b91966c 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DesiredNodeWithStatus.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DesiredNodeWithStatus.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -31,7 +32,7 @@ public record DesiredNodeWithStatus(DesiredNode desiredNode, Status status) ToXContentObject, Comparable { - private static final TransportVersion STATUS_TRACKING_SUPPORT_VERSION = TransportVersion.V_8_4_0; + private static final TransportVersion STATUS_TRACKING_SUPPORT_VERSION = TransportVersions.V_8_4_0; private static final ParseField STATUS_FIELD = new ParseField("status"); public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DesiredNodesMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DesiredNodesMetadata.java index f307d060f4494..ab5c324150f2b 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DesiredNodesMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DesiredNodesMetadata.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.AbstractNamedDiffable; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.NamedDiff; @@ -27,7 +28,7 @@ import java.util.Objects; public class DesiredNodesMetadata extends AbstractNamedDiffable implements Metadata.Custom { - private static final TransportVersion MIN_SUPPORTED_VERSION = TransportVersion.V_8_1_0; + private static final TransportVersion MIN_SUPPORTED_VERSION = TransportVersions.V_8_1_0; public static final String TYPE = "desired_nodes"; public static final DesiredNodesMetadata EMPTY = new DesiredNodesMetadata((DesiredNodes) null); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexGraveyard.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexGraveyard.java index aff52b62ffad9..140eeb2e240ff 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexGraveyard.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexGraveyard.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.common.io.stream.StreamInput; @@ -88,7 +89,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } @Override @@ -334,7 +335,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java index f542afffb7d2d..5ab39cb265daa 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java @@ -11,6 +11,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.admin.indices.rollover.RolloverInfo; import org.elasticsearch.action.support.ActiveShardCount; @@ -544,9 +545,9 @@ public Iterator> settings() { public static final String INDEX_STATE_FILE_PREFIX = "state-"; - static final TransportVersion SYSTEM_INDEX_FLAG_ADDED = TransportVersion.V_7_10_0; + static final TransportVersion SYSTEM_INDEX_FLAG_ADDED = TransportVersions.V_7_10_0; - static final TransportVersion STATS_AND_FORECAST_ADDED = TransportVersion.V_8_6_0; + static final TransportVersion STATS_AND_FORECAST_ADDED = TransportVersions.V_8_6_0; private final int routingNumShards; private final int routingFactor; @@ -1444,7 +1445,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } - private static final TransportVersion SETTING_DIFF_VERSION = TransportVersion.V_8_5_0; + private static final TransportVersion SETTING_DIFF_VERSION = TransportVersions.V_8_5_0; private static class IndexMetadataDiff implements Diff { @@ -1525,7 +1526,7 @@ private static class IndexMetadataDiff implements Diff { version = in.readLong(); mappingVersion = in.readVLong(); settingsVersion = in.readVLong(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { aliasesVersion = in.readVLong(); } else { aliasesVersion = 1; @@ -1576,7 +1577,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeLong(version); out.writeVLong(mappingVersion); out.writeVLong(settingsVersion); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { out.writeVLong(aliasesVersion); } out.writeByte(state.id); @@ -1649,7 +1650,7 @@ public static IndexMetadata readFrom(StreamInput in, @Nullable Function mapping) { } public static void writeMappingMetadata(StreamOutput out, Map mappings) throws IOException { - out.writeMap(mappings, out.getTransportVersion().before(TransportVersion.V_8_0_0) ? (o, v) -> { + out.writeMap(mappings, out.getTransportVersion().before(TransportVersions.V_8_0_0) ? (o, v) -> { o.writeVInt(v == EMPTY_MAPPINGS ? 0 : 1); if (v != EMPTY_MAPPINGS) { o.writeString(MapperService.SINGLE_MAPPING_NAME); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java index 84acb68f183e4..23fe76690f598 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java @@ -12,6 +12,7 @@ import org.apache.logging.log4j.Logger; import org.apache.lucene.util.CollectionUtil; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.Diffable; @@ -1467,7 +1468,7 @@ public Map getMappingsByHash() { private static class MetadataDiff implements Diff { - private static final TransportVersion NOOP_METADATA_DIFF_VERSION = TransportVersion.V_8_5_0; + private static final TransportVersion NOOP_METADATA_DIFF_VERSION = TransportVersions.V_8_5_0; private static final TransportVersion NOOP_METADATA_DIFF_SAFE_VERSION = PublicationTransportHandler.INCLUDES_LAST_COMMITTED_DATA_VERSION; @@ -1535,7 +1536,7 @@ private MetadataDiff(StreamInput in) throws IOException { coordinationMetadata = new CoordinationMetadata(in); transientSettings = Settings.readSettingsFromStream(in); persistentSettings = Settings.readSettingsFromStream(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_3_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_3_0)) { hashesOfConsistentSettings = DiffableStringMap.readDiffFrom(in); } else { hashesOfConsistentSettings = DiffableStringMap.DiffableStringMapDiff.EMPTY; @@ -1543,7 +1544,7 @@ private MetadataDiff(StreamInput in) throws IOException { indices = DiffableUtils.readImmutableOpenMapDiff(in, DiffableUtils.getStringKeySerializer(), INDEX_METADATA_DIFF_VALUE_READER); templates = DiffableUtils.readImmutableOpenMapDiff(in, DiffableUtils.getStringKeySerializer(), TEMPLATES_DIFF_VALUE_READER); customs = DiffableUtils.readImmutableOpenMapDiff(in, DiffableUtils.getStringKeySerializer(), CUSTOM_VALUE_SERIALIZER); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { reservedStateMetadata = DiffableUtils.readJdkMapDiff( in, DiffableUtils.getStringKeySerializer(), @@ -1572,13 +1573,13 @@ public void writeTo(StreamOutput out) throws IOException { coordinationMetadata.writeTo(out); transientSettings.writeTo(out); persistentSettings.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_3_0)) { hashesOfConsistentSettings.writeTo(out); } indices.writeTo(out); templates.writeTo(out); customs.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { reservedStateMetadata.writeTo(out); } } @@ -1611,7 +1612,7 @@ public Metadata apply(Metadata part) { } } - public static final TransportVersion MAPPINGS_AS_HASH_VERSION = TransportVersion.V_8_1_0; + public static final TransportVersion MAPPINGS_AS_HASH_VERSION = TransportVersions.V_8_1_0; public static Metadata readFrom(StreamInput in) throws IOException { Builder builder = new Builder(); @@ -1621,7 +1622,7 @@ public static Metadata readFrom(StreamInput in) throws IOException { builder.coordinationMetadata(new CoordinationMetadata(in)); builder.transientSettings(readSettingsFromStream(in)); builder.persistentSettings(readSettingsFromStream(in)); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_3_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_3_0)) { builder.hashesOfConsistentSettings(DiffableStringMap.readFrom(in)); } final Function mappingLookup; @@ -1648,7 +1649,7 @@ public static Metadata readFrom(StreamInput in) throws IOException { Custom customIndexMetadata = in.readNamedWriteable(Custom.class); builder.putCustom(customIndexMetadata.getWriteableName(), customIndexMetadata); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { int reservedStateSize = in.readVInt(); for (int i = 0; i < reservedStateSize; i++) { builder.put(ReservedStateMetadata.readFrom(in)); @@ -1665,7 +1666,7 @@ public void writeTo(StreamOutput out) throws IOException { coordinationMetadata.writeTo(out); transientSettings.writeTo(out); persistentSettings.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_3_0)) { hashesOfConsistentSettings.writeTo(out); } // Starting in #MAPPINGS_AS_HASH_VERSION we write the mapping metadata first and then write the indices without metadata so that @@ -1680,7 +1681,7 @@ public void writeTo(StreamOutput out) throws IOException { } out.writeCollection(templates.values()); VersionedNamedWriteable.writeVersionedWritables(out, customs); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeCollection(reservedStateMetadata.values()); } } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadata.java index 17dc83258868e..08b0d56da782a 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadata.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; @@ -41,7 +42,7 @@ */ public class NodesShutdownMetadata implements Metadata.Custom { public static final String TYPE = "node_shutdown"; - public static final TransportVersion NODE_SHUTDOWN_VERSION = TransportVersion.V_7_13_0; + public static final TransportVersion NODE_SHUTDOWN_VERSION = TransportVersions.V_7_13_0; public static final NodesShutdownMetadata EMPTY = new NodesShutdownMetadata(Map.of()); private static final ParseField NODES_FIELD = new ParseField("nodes"); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/RepositoriesMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/RepositoriesMetadata.java index b469b141a8de0..9b07fbadb2328 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/RepositoriesMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/RepositoriesMetadata.java @@ -10,6 +10,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.AbstractNamedDiffable; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.NamedDiff; @@ -174,7 +175,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } public RepositoriesMetadata(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownShardMigrationStatus.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownShardMigrationStatus.java index 7f7f8a87cbfb2..5597f3359a1c7 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownShardMigrationStatus.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownShardMigrationStatus.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.routing.allocation.ShardAllocationDecision; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -22,7 +23,7 @@ import java.util.Objects; public class ShutdownShardMigrationStatus implements Writeable, ToXContentObject { - private static final TransportVersion ALLOCATION_DECISION_ADDED_VERSION = TransportVersion.V_7_16_0; + private static final TransportVersion ALLOCATION_DECISION_ADDED_VERSION = TransportVersions.V_7_16_0; public static final String NODE_ALLOCATION_DECISION_KEY = "node_allocation_decision"; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java index c94178488ed3f..a248bb52e1a84 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.SimpleDiffable; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -33,9 +34,9 @@ */ public class SingleNodeShutdownMetadata implements SimpleDiffable, ToXContentObject { - public static final TransportVersion REPLACE_SHUTDOWN_TYPE_ADDED_VERSION = TransportVersion.V_7_16_0; - public static final TransportVersion SIGTERM_ADDED_VERSION = TransportVersion.V_8_500_010; - public static final TransportVersion GRACE_PERIOD_ADDED_VERSION = TransportVersion.V_8_500_010; + public static final TransportVersion REPLACE_SHUTDOWN_TYPE_ADDED_VERSION = TransportVersions.V_7_16_0; + public static final TransportVersion SIGTERM_ADDED_VERSION = TransportVersions.V_8_500_010; + public static final TransportVersion GRACE_PERIOD_ADDED_VERSION = TransportVersions.V_8_500_010; public static final ParseField NODE_ID_FIELD = new ParseField("node_id"); public static final ParseField TYPE_FIELD = new ParseField("type"); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/Template.java b/server/src/main/java/org/elasticsearch/cluster/metadata/Template.java index 85364a4543784..11cf31516a53a 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/Template.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/Template.java @@ -8,7 +8,7 @@ package org.elasticsearch.cluster.metadata; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.admin.indices.rollover.RolloverConfiguration; import org.elasticsearch.cluster.SimpleDiffable; import org.elasticsearch.common.Strings; @@ -123,7 +123,7 @@ public Template(StreamInput in) throws IOException { } if (in.getTransportVersion().onOrAfter(DataStreamLifecycle.ADDED_ENABLED_FLAG_VERSION)) { this.lifecycle = in.readOptionalWriteable(DataStreamLifecycle::new); - } else if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + } else if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { boolean isExplicitNull = in.readBoolean(); if (isExplicitNull) { this.lifecycle = DataStreamLifecycle.newBuilder().enabled(false).build(); @@ -177,7 +177,7 @@ public void writeTo(StreamOutput out) throws IOException { } if (out.getTransportVersion().onOrAfter(DataStreamLifecycle.ADDED_ENABLED_FLAG_VERSION)) { out.writeOptionalWriteable(lifecycle); - } else if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + } else if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { boolean isExplicitNull = lifecycle != null && lifecycle.isEnabled() == false; out.writeBoolean(isExplicitNull); if (isExplicitNull == false) { diff --git a/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNode.java b/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNode.java index bf96ab5d62742..31cbe3b0763e1 100644 --- a/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNode.java +++ b/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNode.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.node; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.common.Strings; import org.elasticsearch.common.UUIDs; @@ -68,7 +69,7 @@ public static boolean isServerless() { } static final String COORDINATING_ONLY = "coordinating_only"; - public static final TransportVersion EXTERNAL_ID_VERSION = TransportVersion.V_8_3_0; + public static final TransportVersion EXTERNAL_ID_VERSION = TransportVersions.V_8_3_0; public static final Comparator DISCOVERY_NODE_COMPARATOR = Comparator.comparing(DiscoveryNode::getName) .thenComparing(DiscoveryNode::getId); @@ -344,7 +345,7 @@ public DiscoveryNode(StreamInput in) throws IOException { } } this.roles = Collections.unmodifiableSortedSet(roles); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_024)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_024)) { versionInfo = new VersionInformation(Version.readVersion(in), IndexVersion.readVersion(in), IndexVersion.readVersion(in)); } else { versionInfo = inferVersionInformation(Version.readVersion(in)); @@ -381,7 +382,7 @@ public void writeTo(StreamOutput out) throws IOException { o.writeString(role.roleNameAbbreviation()); o.writeBoolean(role.canContainData()); }); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_024)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_024)) { Version.writeVersion(versionInfo.nodeVersion(), out); IndexVersion.writeVersion(versionInfo.minIndexVersion(), out); IndexVersion.writeVersion(versionInfo.maxIndexVersion(), out); diff --git a/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNodes.java b/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNodes.java index 9443a0fd951b8..2973544f86871 100644 --- a/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNodes.java +++ b/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNodes.java @@ -8,7 +8,7 @@ package org.elasticsearch.cluster.node; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.SimpleDiffable; @@ -666,7 +666,7 @@ public String shortSummary() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(masterNodeId); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeVLong(nodeLeftGeneration); } // else nodeLeftGeneration is zero, or we're sending this to a remote cluster which does not care about the nodeLeftGeneration out.writeCollection(nodes.values()); @@ -681,7 +681,7 @@ public static DiscoveryNodes readFrom(StreamInput in, DiscoveryNode localNode) t builder.localNodeId(localNode.getId()); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { builder.nodeLeftGeneration(in.readVLong()); } // else nodeLeftGeneration is zero, or we're receiving this from a remote cluster so the nodeLeftGeneration does not matter to us diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/ShardRouting.java b/server/src/main/java/org/elasticsearch/cluster/routing/ShardRouting.java index 37ae9784d9cfa..b0c79102fcd80 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/ShardRouting.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/ShardRouting.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.routing; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.routing.RecoverySource.ExistingStoreRecoverySource; import org.elasticsearch.cluster.routing.RecoverySource.PeerRecoverySource; @@ -38,8 +39,8 @@ public final class ShardRouting implements Writeable, ToXContentObject { * Used if shard size is not available */ public static final long UNAVAILABLE_EXPECTED_SHARD_SIZE = -1; - private static final TransportVersion EXPECTED_SHARD_SIZE_FOR_STARTED_VERSION = TransportVersion.V_8_5_0; - private static final TransportVersion RELOCATION_FAILURE_INFO_VERSION = TransportVersion.V_8_6_0; + private static final TransportVersion EXPECTED_SHARD_SIZE_FOR_STARTED_VERSION = TransportVersions.V_8_5_0; + private static final TransportVersion RELOCATION_FAILURE_INFO_VERSION = TransportVersions.V_8_6_0; private final ShardId shardId; private final String currentNodeId; @@ -352,7 +353,7 @@ public ShardRouting(ShardId shardId, StreamInput in) throws IOException { } else { expectedShardSize = UNAVAILABLE_EXPECTED_SHARD_SIZE; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { role = Role.readFrom(in); } else { role = Role.DEFAULT; @@ -389,7 +390,7 @@ public void writeToThin(StreamOutput out) throws IOException { out.writeLong(expectedShardSize); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { role.writeTo(out); } else if (role != Role.DEFAULT) { throw new IllegalStateException( diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/UnassignedInfo.java b/server/src/main/java/org/elasticsearch/cluster/routing/UnassignedInfo.java index e986971a9c971..59b344080c054 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/UnassignedInfo.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/UnassignedInfo.java @@ -10,6 +10,7 @@ import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.metadata.NodesShutdownMetadata; @@ -49,8 +50,8 @@ public final class UnassignedInfo implements ToXContentFragment, Writeable { * The version that the {@code lastAllocatedNode} field was added in. Used to adapt streaming of this class as appropriate for the * version of the node sending/receiving it. Should be removed once wire compatibility with this version is no longer necessary. */ - private static final TransportVersion VERSION_LAST_ALLOCATED_NODE_ADDED = TransportVersion.V_7_15_0; - private static final TransportVersion VERSION_UNPROMOTABLE_REPLICA_ADDED = TransportVersion.V_8_7_0; + private static final TransportVersion VERSION_LAST_ALLOCATED_NODE_ADDED = TransportVersions.V_7_15_0; + private static final TransportVersion VERSION_UNPROMOTABLE_REPLICA_ADDED = TransportVersions.V_8_7_0; public static final DateFormatter DATE_TIME_FORMATTER = DateFormatter.forPattern("date_optional_time").withZone(ZoneOffset.UTC); diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/ClusterBalanceStats.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/ClusterBalanceStats.java index f96e2a9b2da27..853a26263fe9f 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/ClusterBalanceStats.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/ClusterBalanceStats.java @@ -8,7 +8,7 @@ package org.elasticsearch.cluster.routing.allocation.allocator; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterInfo; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.Metadata; @@ -210,8 +210,8 @@ private static NodeBalanceStats createFrom( public static NodeBalanceStats readFrom(StreamInput in) throws IOException { return new NodeBalanceStats( - in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0) ? in.readString() : UNKNOWN_NODE_ID, - in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0) ? in.readStringCollectionAsList() : List.of(), + in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0) ? in.readString() : UNKNOWN_NODE_ID, + in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0) ? in.readStringCollectionAsList() : List.of(), in.readInt(), in.readDouble(), in.readLong(), @@ -221,10 +221,10 @@ public static NodeBalanceStats readFrom(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeString(nodeId); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeStringCollection(roles); } out.writeInt(shards); diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/DesiredBalanceStats.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/DesiredBalanceStats.java index b465b1fcbc619..c017d77362427 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/DesiredBalanceStats.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/DesiredBalanceStats.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.routing.allocation.allocator; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -30,7 +31,7 @@ public record DesiredBalanceStats( long cumulativeReconciliationTime ) implements Writeable, ToXContentObject { - private static final TransportVersion COMPUTED_SHARD_MOVEMENTS_VERSION = TransportVersion.V_8_8_0; + private static final TransportVersion COMPUTED_SHARD_MOVEMENTS_VERSION = TransportVersions.V_8_8_0; public static DesiredBalanceStats readFrom(StreamInput in) throws IOException { return new DesiredBalanceStats( diff --git a/server/src/main/java/org/elasticsearch/cluster/service/ClusterStateUpdateStats.java b/server/src/main/java/org/elasticsearch/cluster/service/ClusterStateUpdateStats.java index 2efafb228bb54..a21d182ae32f8 100644 --- a/server/src/main/java/org/elasticsearch/cluster/service/ClusterStateUpdateStats.java +++ b/server/src/main/java/org/elasticsearch/cluster/service/ClusterStateUpdateStats.java @@ -8,7 +8,7 @@ package org.elasticsearch.cluster.service; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -117,7 +117,7 @@ public ClusterStateUpdateStats(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - assert out.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0) : out.getTransportVersion(); + assert out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0) : out.getTransportVersion(); out.writeVLong(unchangedTaskCount); out.writeVLong(publicationSuccessCount); out.writeVLong(publicationFailureCount); diff --git a/server/src/main/java/org/elasticsearch/common/compress/CompressedXContent.java b/server/src/main/java/org/elasticsearch/common/compress/CompressedXContent.java index 177bbeb6dc2cb..bda33e28fa315 100644 --- a/server/src/main/java/org/elasticsearch/common/compress/CompressedXContent.java +++ b/server/src/main/java/org/elasticsearch/common/compress/CompressedXContent.java @@ -9,7 +9,7 @@ package org.elasticsearch.common.compress; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.hash.MessageDigests; @@ -205,7 +205,7 @@ public String getSha256() { public static CompressedXContent readCompressedString(StreamInput in) throws IOException { final String sha256; final byte[] compressedData; - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { sha256 = in.readString(); compressedData = in.readByteArray(); } else { @@ -218,7 +218,7 @@ public static CompressedXContent readCompressedString(StreamInput in) throws IOE @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeString(sha256); } else { int crc32 = crc32FromCompressed(bytes); diff --git a/server/src/main/java/org/elasticsearch/common/document/DocumentField.java b/server/src/main/java/org/elasticsearch/common/document/DocumentField.java index 60344e18517bc..2cbb14141b7fc 100644 --- a/server/src/main/java/org/elasticsearch/common/document/DocumentField.java +++ b/server/src/main/java/org/elasticsearch/common/document/DocumentField.java @@ -8,7 +8,7 @@ package org.elasticsearch.common.document; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -44,12 +44,12 @@ public class DocumentField implements Writeable, Iterable { public DocumentField(StreamInput in) throws IOException { name = in.readString(); values = in.readCollectionAsList(StreamInput::readGenericValue); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { ignoredValues = in.readCollectionAsList(StreamInput::readGenericValue); } else { ignoredValues = Collections.emptyList(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { lookupFields = in.readCollectionAsList(LookupField::new); } else { lookupFields = List.of(); @@ -114,10 +114,10 @@ public List getIgnoredValues() { public void writeTo(StreamOutput out) throws IOException { out.writeString(name); out.writeCollection(values, StreamOutput::writeGenericValue); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { out.writeCollection(ignoredValues, StreamOutput::writeGenericValue); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { out.writeCollection(lookupFields); } else { if (lookupFields.isEmpty() == false) { diff --git a/server/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java b/server/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java index af624a28cd60c..f4bed74ec8db2 100644 --- a/server/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java +++ b/server/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java @@ -13,6 +13,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; @@ -762,10 +763,10 @@ public Object readGenericValue() throws IOException { case 6 -> readByteArray(); case 7 -> readCollection(StreamInput::readGenericValue, ArrayList::new, Collections.emptyList()); case 8 -> readArray(); - case 9 -> getTransportVersion().onOrAfter(TransportVersion.V_8_7_0) + case 9 -> getTransportVersion().onOrAfter(TransportVersions.V_8_7_0) ? readOrderedMap(StreamInput::readGenericValue, StreamInput::readGenericValue) : readOrderedMap(StreamInput::readString, StreamInput::readGenericValue); - case 10 -> getTransportVersion().onOrAfter(TransportVersion.V_8_7_0) + case 10 -> getTransportVersion().onOrAfter(TransportVersions.V_8_7_0) ? readMap(StreamInput::readGenericValue, StreamInput::readGenericValue) : readMap(StreamInput::readGenericValue); case 11 -> readByte(); diff --git a/server/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java b/server/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java index 65c424aad05de..aa30c8af85499 100644 --- a/server/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java +++ b/server/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java @@ -13,6 +13,7 @@ import org.apache.lucene.util.BytesRefBuilder; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.geo.GeoPoint; @@ -552,7 +553,7 @@ public void writeMapWithConsistentOrder(@Nullable Map Iterator> iterator = map.entrySet().stream().sorted(Map.Entry.comparingByKey()).iterator(); while (iterator.hasNext()) { Map.Entry next = iterator.next(); - if (this.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (this.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { this.writeGenericValue(next.getKey()); } else { this.writeString(next.getKey()); @@ -667,7 +668,7 @@ public final void writeOptionalInstant(@Nullable Instant instant) throws IOExcep } else { o.writeByte((byte) 10); } - if (o.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (o.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { final Map map = (Map) v; o.writeMap(map, StreamOutput::writeGenericValue, StreamOutput::writeGenericValue); } else { diff --git a/server/src/main/java/org/elasticsearch/common/unit/Processors.java b/server/src/main/java/org/elasticsearch/common/unit/Processors.java index 0e0f88ac7f9c5..d5421e1475655 100644 --- a/server/src/main/java/org/elasticsearch/common/unit/Processors.java +++ b/server/src/main/java/org/elasticsearch/common/unit/Processors.java @@ -9,6 +9,7 @@ package org.elasticsearch.common.unit; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -31,9 +32,9 @@ public class Processors implements Writeable, Comparable, ToXContent public static final Processors MAX_PROCESSORS = new Processors(Double.MAX_VALUE); public static final Version FLOAT_PROCESSORS_SUPPORT_VERSION = Version.V_8_3_0; - public static final TransportVersion FLOAT_PROCESSORS_SUPPORT_TRANSPORT_VERSION = TransportVersion.V_8_3_0; + public static final TransportVersion FLOAT_PROCESSORS_SUPPORT_TRANSPORT_VERSION = TransportVersions.V_8_3_0; public static final Version DOUBLE_PROCESSORS_SUPPORT_VERSION = Version.V_8_5_0; - public static final TransportVersion DOUBLE_PROCESSORS_SUPPORT_TRANSPORT_VERSION = TransportVersion.V_8_5_0; + public static final TransportVersion DOUBLE_PROCESSORS_SUPPORT_TRANSPORT_VERSION = TransportVersions.V_8_5_0; static final int NUMBER_OF_DECIMAL_PLACES = 5; private static final double MIN_REPRESENTABLE_PROCESSORS = 1E-5; diff --git a/server/src/main/java/org/elasticsearch/common/xcontent/XContentHelper.java b/server/src/main/java/org/elasticsearch/common/xcontent/XContentHelper.java index 3bd9cfee16775..4ac8f34571624 100644 --- a/server/src/main/java/org/elasticsearch/common/xcontent/XContentHelper.java +++ b/server/src/main/java/org/elasticsearch/common/xcontent/XContentHelper.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchGenerationException; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; @@ -643,7 +643,7 @@ public static BytesReference childBytes(XContentParser parser) throws IOExceptio * @param xContentType an instance to serialize */ public static void writeTo(StreamOutput out, XContentType xContentType) throws IOException { - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { // when sending an enumeration to { public Request(StreamInput in) throws IOException { super(in); shardId = new ShardId(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { customDataPath = in.readString(); } else { customDataPath = null; @@ -221,7 +221,7 @@ public String getCustomDataPath() { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); shardId.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { out.writeString(customDataPath); } } @@ -261,7 +261,7 @@ public static class NodeRequest extends TransportRequest { public NodeRequest(StreamInput in) throws IOException { super(in); shardId = new ShardId(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { customDataPath = in.readString(); } else { customDataPath = null; @@ -277,7 +277,7 @@ public NodeRequest(Request request) { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); shardId.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { assert customDataPath != null; out.writeString(customDataPath); } diff --git a/server/src/main/java/org/elasticsearch/health/metadata/HealthMetadata.java b/server/src/main/java/org/elasticsearch/health/metadata/HealthMetadata.java index 9ae58b5ef849e..6577171202169 100644 --- a/server/src/main/java/org/elasticsearch/health/metadata/HealthMetadata.java +++ b/server/src/main/java/org/elasticsearch/health/metadata/HealthMetadata.java @@ -9,6 +9,7 @@ package org.elasticsearch.health.metadata; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.AbstractNamedDiffable; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.NamedDiff; @@ -62,7 +63,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_5_0; + return TransportVersions.V_8_5_0; } @Override @@ -161,7 +162,7 @@ public record ShardLimits(int maxShardsPerNode, int maxShardsPerNodeFrozen) impl private static final String TYPE = "shard_limits"; private static final ParseField MAX_SHARDS_PER_NODE = new ParseField("max_shards_per_node"); private static final ParseField MAX_SHARDS_PER_NODE_FROZEN = new ParseField("max_shards_per_node_frozen"); - static final TransportVersion VERSION_SUPPORTING_SHARD_LIMIT_FIELDS = TransportVersion.V_8_8_0; + static final TransportVersion VERSION_SUPPORTING_SHARD_LIMIT_FIELDS = TransportVersions.V_8_8_0; static ShardLimits readFrom(StreamInput in) throws IOException { return new ShardLimits(in.readInt(), in.readInt()); @@ -230,7 +231,7 @@ public record Disk( ) implements ToXContentFragment, Writeable { public static final String TYPE = "disk"; - public static final TransportVersion VERSION_SUPPORTING_HEADROOM_FIELDS = TransportVersion.V_8_5_0; + public static final TransportVersion VERSION_SUPPORTING_HEADROOM_FIELDS = TransportVersions.V_8_5_0; private static final ParseField HIGH_WATERMARK_FIELD = new ParseField("high_watermark"); private static final ParseField HIGH_MAX_HEADROOM_FIELD = new ParseField("high_max_headroom"); diff --git a/server/src/main/java/org/elasticsearch/health/node/selection/HealthNodeTaskParams.java b/server/src/main/java/org/elasticsearch/health/node/selection/HealthNodeTaskParams.java index 4a68115af6348..a18f9c5c10b33 100644 --- a/server/src/main/java/org/elasticsearch/health/node/selection/HealthNodeTaskParams.java +++ b/server/src/main/java/org/elasticsearch/health/node/selection/HealthNodeTaskParams.java @@ -9,6 +9,7 @@ package org.elasticsearch.health.node.selection; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.persistent.PersistentTaskParams; @@ -47,7 +48,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_5_0; + return TransportVersions.V_8_5_0; } @Override diff --git a/server/src/main/java/org/elasticsearch/index/engine/Segment.java b/server/src/main/java/org/elasticsearch/index/engine/Segment.java index 14f354dd85c51..9098aaecfeea6 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/Segment.java +++ b/server/src/main/java/org/elasticsearch/index/engine/Segment.java @@ -14,7 +14,7 @@ import org.apache.lucene.search.SortedNumericSortField; import org.apache.lucene.search.SortedSetSelector; import org.apache.lucene.search.SortedSetSortField; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -52,7 +52,7 @@ public Segment(StreamInput in) throws IOException { version = Lucene.parseVersionLenient(in.readOptionalString(), null); compound = in.readOptionalBoolean(); mergeId = in.readOptionalString(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readLong(); // memoryInBytes } if (in.readBoolean()) { @@ -159,7 +159,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(version.toString()); out.writeOptionalBoolean(compound); out.writeOptionalString(mergeId); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeLong(0); // memoryInBytes } @@ -252,7 +252,7 @@ private static void writeSegmentSort(StreamOutput out, Sort sort) throws IOExcep o.writeBoolean(((SortedNumericSortField) field).getSelector() == SortedNumericSelector.Type.MAX); o.writeBoolean(field.getReverse()); } else if (field.getType().equals(SortField.Type.STRING)) { - if (o.getTransportVersion().before(TransportVersion.V_8_5_0)) { + if (o.getTransportVersion().before(TransportVersions.V_8_5_0)) { // The closest supported version before 8.5.0 was SortedSet fields, so we mimic that o.writeByte(SORT_STRING_SET); o.writeOptionalBoolean(field.getMissingValue() == null ? null : field.getMissingValue() == SortField.STRING_FIRST); diff --git a/server/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java b/server/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java index 5a2edcb059787..1b8069c726ab3 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java +++ b/server/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.engine; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -39,7 +39,7 @@ public SegmentsStats() { public SegmentsStats(StreamInput in) throws IOException { count = in.readVLong(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readLong(); // memoryInBytes in.readLong(); // termsMemoryInBytes in.readLong(); // storedFieldsMemoryInBytes @@ -220,7 +220,7 @@ static final class Fields { @Override public void writeTo(StreamOutput out) throws IOException { out.writeVLong(count); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeLong(0L); // memoryInBytes out.writeLong(0L); // termsMemoryInBytes out.writeLong(0L); // storedFieldsMemoryInBytes @@ -250,7 +250,7 @@ public static class FileStats implements Writeable, ToXContentFragment { private final long max; FileStats(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { this.ext = in.readString(); this.total = in.readVLong(); this.count = in.readVLong(); @@ -295,7 +295,7 @@ public long getMax() { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { out.writeString(ext); out.writeVLong(total); out.writeVLong(count); diff --git a/server/src/main/java/org/elasticsearch/index/fielddata/FieldDataStats.java b/server/src/main/java/org/elasticsearch/index/fielddata/FieldDataStats.java index 088dc56026936..c5c2035bdd39e 100644 --- a/server/src/main/java/org/elasticsearch/index/fielddata/FieldDataStats.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/FieldDataStats.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.fielddata; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.FieldMemoryStats; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -47,7 +47,7 @@ public FieldDataStats(StreamInput in) throws IOException { memorySize = in.readVLong(); evictions = in.readVLong(); fields = in.readOptionalWriteable(FieldMemoryStats::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { long buildTimeMillis = in.readVLong(); Map fieldGlobalOrdinalsStats = null; if (in.readBoolean()) { @@ -110,7 +110,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(memorySize); out.writeVLong(evictions); out.writeOptionalWriteable(fields); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeVLong(globalOrdinalsStats.buildTimeMillis); if (globalOrdinalsStats.fieldGlobalOrdinalsStats != null) { out.writeBoolean(true); diff --git a/server/src/main/java/org/elasticsearch/index/get/GetResult.java b/server/src/main/java/org/elasticsearch/index/get/GetResult.java index efedb141d2460..7d542d1e35275 100644 --- a/server/src/main/java/org/elasticsearch/index/get/GetResult.java +++ b/server/src/main/java/org/elasticsearch/index/get/GetResult.java @@ -9,7 +9,7 @@ package org.elasticsearch.index.get; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressorFactory; @@ -66,7 +66,7 @@ public class GetResult implements Writeable, Iterable, ToXContent public GetResult(StreamInput in) throws IOException { index = in.readString(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readOptionalString(); } id = in.readString(); @@ -386,7 +386,7 @@ public static GetResult fromXContent(XContentParser parser) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(index); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeOptionalString(MapperService.SINGLE_MAPPING_NAME); } out.writeString(id); diff --git a/server/src/main/java/org/elasticsearch/index/query/AbstractGeometryQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/AbstractGeometryQueryBuilder.java index d0a67dcc34483..ac67c3c95719c 100644 --- a/server/src/main/java/org/elasticsearch/index/query/AbstractGeometryQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/AbstractGeometryQueryBuilder.java @@ -11,7 +11,7 @@ import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.get.GetRequest; import org.elasticsearch.client.internal.Client; @@ -158,7 +158,7 @@ protected AbstractGeometryQueryBuilder(StreamInput in) throws IOException { } else { shape = null; indexedShapeId = in.readOptionalString(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { String type = in.readOptionalString(); assert MapperService.SINGLE_MAPPING_NAME.equals(type) : "Expected type [_doc], got [" + type + "]"; } @@ -183,7 +183,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { GeometryIO.writeGeometry(out, shape); } else { out.writeOptionalString(indexedShapeId); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeOptionalString(MapperService.SINGLE_MAPPING_NAME); } out.writeOptionalString(indexedShapeIndex); diff --git a/server/src/main/java/org/elasticsearch/index/query/BoolQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/BoolQueryBuilder.java index cbec4ea4d324c..4b4727bca4198 100644 --- a/server/src/main/java/org/elasticsearch/index/query/BoolQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/BoolQueryBuilder.java @@ -14,6 +14,7 @@ import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -407,6 +408,6 @@ private static boolean rewriteClauses( @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/BoostingQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/BoostingQueryBuilder.java index fc08aa1f23cce..a857261bb62d9 100644 --- a/server/src/main/java/org/elasticsearch/index/query/BoostingQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/BoostingQueryBuilder.java @@ -11,6 +11,7 @@ import org.apache.lucene.queries.function.FunctionScoreQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -230,6 +231,6 @@ protected void extractInnerHitBuilders(Map inner @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/CombinedFieldsQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/CombinedFieldsQueryBuilder.java index 86b4320659a00..ee1eb5ec3d5d3 100644 --- a/server/src/main/java/org/elasticsearch/index/query/CombinedFieldsQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/CombinedFieldsQueryBuilder.java @@ -22,6 +22,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.QueryBuilder; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -459,6 +460,6 @@ protected boolean doEquals(CombinedFieldsQueryBuilder other) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_13_0; + return TransportVersions.V_7_13_0; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java index 2fb9275e125f7..c8249ce673b1e 100644 --- a/server/src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.logging.DeprecationLogger; @@ -63,6 +64,6 @@ public static CommonTermsQueryBuilder fromXContent(XContentParser parser) throws @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/ConstantScoreQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/ConstantScoreQueryBuilder.java index 80fd568f7210b..a87e45c797d14 100644 --- a/server/src/main/java/org/elasticsearch/index/query/ConstantScoreQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/ConstantScoreQueryBuilder.java @@ -11,6 +11,7 @@ import org.apache.lucene.search.ConstantScoreQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -161,6 +162,6 @@ protected void extractInnerHitBuilders(Map inner @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/DisMaxQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/DisMaxQueryBuilder.java index 8cfc43f92fb03..92ad781da00aa 100644 --- a/server/src/main/java/org/elasticsearch/index/query/DisMaxQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/DisMaxQueryBuilder.java @@ -11,6 +11,7 @@ import org.apache.lucene.search.DisjunctionMaxQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -224,6 +225,6 @@ protected void extractInnerHitBuilders(Map inner @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/DistanceFeatureQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/DistanceFeatureQueryBuilder.java index 3b67f59e81c84..97f924a0c89ee 100644 --- a/server/src/main/java/org/elasticsearch/index/query/DistanceFeatureQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/DistanceFeatureQueryBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeoUtils; @@ -199,6 +200,6 @@ public String toString() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_2_0; + return TransportVersions.V_7_2_0; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/ExistsQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/ExistsQueryBuilder.java index ec08a2fde0f8d..8645f6680a314 100644 --- a/server/src/main/java/org/elasticsearch/index/query/ExistsQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/ExistsQueryBuilder.java @@ -14,6 +14,7 @@ import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -177,6 +178,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/FieldMaskingSpanQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/FieldMaskingSpanQueryBuilder.java index 05723117ebea1..831bdadebd3e6 100644 --- a/server/src/main/java/org/elasticsearch/index/query/FieldMaskingSpanQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/FieldMaskingSpanQueryBuilder.java @@ -12,6 +12,7 @@ import org.apache.lucene.queries.spans.SpanQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -177,6 +178,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/FuzzyQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/FuzzyQueryBuilder.java index 1f0fcbab51fd4..a4b18d6e06d62 100644 --- a/server/src/main/java/org/elasticsearch/index/query/FuzzyQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/FuzzyQueryBuilder.java @@ -11,6 +11,7 @@ import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -360,6 +361,6 @@ protected boolean doEquals(FuzzyQueryBuilder other) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxQueryBuilder.java index 9afadc1a8d9d8..3305e8ea58c6b 100644 --- a/server/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxQueryBuilder.java @@ -12,6 +12,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Numbers; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.geo.GeoBoundingBox; @@ -83,7 +84,7 @@ public GeoBoundingBoxQueryBuilder(StreamInput in) throws IOException { super(in); fieldName = in.readString(); geoBoundingBox = new GeoBoundingBox(in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readVInt(); // ignore value } validationMethod = GeoValidationMethod.readFromStream(in); @@ -94,7 +95,7 @@ public GeoBoundingBoxQueryBuilder(StreamInput in) throws IOException { protected void doWriteTo(StreamOutput out) throws IOException { out.writeString(fieldName); geoBoundingBox.writeTo(out); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeVInt(0); } validationMethod.writeTo(out); @@ -407,6 +408,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/GeoDistanceQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/GeoDistanceQueryBuilder.java index 5b35a9af99931..763eb4fd5f3bf 100644 --- a/server/src/main/java/org/elasticsearch/index/query/GeoDistanceQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/GeoDistanceQueryBuilder.java @@ -11,6 +11,7 @@ import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.GeoDistance; @@ -402,6 +403,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryBuilder.java index a662d08fdd474..21ff620907b0a 100644 --- a/server/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryBuilder.java @@ -15,6 +15,7 @@ import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.GeoPoint; @@ -329,6 +330,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java index fb342d6b71a98..687df8af1adf1 100644 --- a/server/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java @@ -11,6 +11,7 @@ import org.apache.lucene.search.ConstantScoreQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.geo.GeometryParser; import org.elasticsearch.common.geo.ShapeRelation; @@ -271,6 +272,6 @@ public static GeoShapeQueryBuilder fromXContent(XContentParser parser) throws IO @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java index d8969f037c512..a95740aa7f32e 100644 --- a/server/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -53,7 +54,7 @@ public IdsQueryBuilder() { */ public IdsQueryBuilder(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types no longer relevant so ignore String[] types = in.readStringArray(); if (types.length > 0) { @@ -65,7 +66,7 @@ public IdsQueryBuilder(StreamInput in) throws IOException { @Override protected void doWriteTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types not supported so send an empty array to previous versions out.writeStringArray(Strings.EMPTY_ARRAY); } @@ -156,6 +157,6 @@ protected boolean doEquals(IdsQueryBuilder other) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java b/server/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java index 2bba8916916f7..750553ef0a001 100644 --- a/server/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.index.query; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -189,7 +189,7 @@ public InnerHitBuilder(StreamInput in) throws IOException { highlightBuilder = in.readOptionalWriteable(HighlightBuilder::new); this.innerCollapseBuilder = in.readOptionalWriteable(CollapseBuilder::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { if (in.readBoolean()) { fetchFields = in.readCollectionAsList(FieldAndFormat::new); } @@ -229,7 +229,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(highlightBuilder); out.writeOptionalWriteable(innerCollapseBuilder); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeBoolean(fetchFields != null); if (fetchFields != null) { out.writeCollection(fetchFields); diff --git a/server/src/main/java/org/elasticsearch/index/query/IntervalQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/IntervalQueryBuilder.java index 5d42a6eb750db..c3ca5d8abccdb 100644 --- a/server/src/main/java/org/elasticsearch/index/query/IntervalQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/IntervalQueryBuilder.java @@ -12,6 +12,7 @@ import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -156,6 +157,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/IntervalsSourceProvider.java b/server/src/main/java/org/elasticsearch/index/query/IntervalsSourceProvider.java index e00de8f1daa07..9a326cf927cf6 100644 --- a/server/src/main/java/org/elasticsearch/index/query/IntervalsSourceProvider.java +++ b/server/src/main/java/org/elasticsearch/index/query/IntervalsSourceProvider.java @@ -13,7 +13,7 @@ import org.apache.lucene.queries.intervals.Intervals; import org.apache.lucene.queries.intervals.IntervalsSource; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.StreamInput; @@ -120,7 +120,7 @@ public Match(StreamInput in) throws IOException { this.ordered = in.readBoolean(); this.analyzer = in.readOptionalString(); this.filter = in.readOptionalWriteable(IntervalFilter::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { this.useField = in.readOptionalString(); } else { this.useField = null; @@ -204,7 +204,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(ordered); out.writeOptionalString(analyzer); out.writeOptionalWriteable(filter); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { out.writeOptionalString(useField); } } diff --git a/server/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java index ff50fd1e8e8a6..9b7040e4e7bdc 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -83,6 +84,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/MatchBoolPrefixQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MatchBoolPrefixQueryBuilder.java index 5d6a5892e6caa..0f9105134961a 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MatchBoolPrefixQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MatchBoolPrefixQueryBuilder.java @@ -11,6 +11,7 @@ import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -405,6 +406,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_2_0; + return TransportVersions.V_7_2_0; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/MatchNoneQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MatchNoneQueryBuilder.java index ca9e1c6428864..97bea569a3c95 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MatchNoneQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MatchNoneQueryBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -38,14 +39,14 @@ public MatchNoneQueryBuilder(String rewriteReason) { */ public MatchNoneQueryBuilder(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_029)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_029)) { rewriteReason = in.readOptionalString(); } } @Override protected void doWriteTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_029)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_029)) { out.writeOptionalString(rewriteReason); } } @@ -115,6 +116,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java index d7df607a2c701..b0dd18fdcbee5 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java @@ -11,6 +11,7 @@ import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -64,7 +65,7 @@ public MatchPhrasePrefixQueryBuilder(StreamInput in) throws IOException { slop = in.readVInt(); maxExpansions = in.readVInt(); analyzer = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { this.zeroTermsQuery = ZeroTermsQueryOption.readFromStream(in); } } @@ -76,7 +77,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeVInt(slop); out.writeVInt(maxExpansions); out.writeOptionalString(analyzer); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { zeroTermsQuery.writeTo(out); } } @@ -293,6 +294,6 @@ public static MatchPhrasePrefixQueryBuilder fromXContent(XContentParser parser) @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/MatchPhraseQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MatchPhraseQueryBuilder.java index f1dc5d1259556..48448ab806faa 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MatchPhraseQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MatchPhraseQueryBuilder.java @@ -11,6 +11,7 @@ import org.apache.lucene.analysis.core.KeywordAnalyzer; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -286,6 +287,6 @@ public static MatchPhraseQueryBuilder fromXContent(XContentParser parser) throws @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/MatchQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MatchQueryBuilder.java index e06051154c547..0d11289a0999a 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MatchQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MatchQueryBuilder.java @@ -12,6 +12,7 @@ import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -117,7 +118,7 @@ public MatchQueryBuilder(StreamInput in) throws IOException { fuzzyRewrite = in.readOptionalString(); fuzziness = in.readOptionalWriteable(Fuzziness::new); // cutoff_frequency has been removed - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readOptionalFloat(); } autoGenerateSynonymsPhraseQuery = in.readBoolean(); @@ -139,7 +140,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeOptionalString(fuzzyRewrite); out.writeOptionalWriteable(fuzziness); // cutoff_frequency has been removed - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeOptionalFloat(null); } out.writeBoolean(autoGenerateSynonymsPhraseQuery); @@ -574,6 +575,6 @@ public static MatchQueryBuilder fromXContent(XContentParser parser) throws IOExc @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java index e744a691a5ffb..acf4893de5280 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java @@ -16,6 +16,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.RoutingMissingException; import org.elasticsearch.action.termvectors.MultiTermVectorsItemResponse; import org.elasticsearch.action.termvectors.MultiTermVectorsRequest; @@ -206,7 +207,7 @@ public Item(@Nullable String index, XContentBuilder doc) { @SuppressWarnings("unchecked") Item(StreamInput in) throws IOException { index = in.readOptionalString(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types no longer relevant so ignore String type = in.readOptionalString(); if (type != null) { @@ -229,7 +230,7 @@ public Item(@Nullable String index, XContentBuilder doc) { @Override public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(index); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types not supported so send an empty array to previous versions out.writeOptionalString(null); } @@ -1186,6 +1187,6 @@ protected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/MultiMatchQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MultiMatchQueryBuilder.java index 755609d6d81ac..e591f7e07e2ba 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MultiMatchQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MultiMatchQueryBuilder.java @@ -12,6 +12,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -223,7 +224,7 @@ public MultiMatchQueryBuilder(StreamInput in) throws IOException { fuzzyRewrite = in.readOptionalString(); tieBreaker = in.readOptionalFloat(); lenient = in.readOptionalBoolean(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readOptionalFloat(); } zeroTermsQuery = ZeroTermsQueryOption.readFromStream(in); @@ -246,7 +247,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeOptionalString(fuzzyRewrite); out.writeOptionalFloat(tieBreaker); out.writeOptionalBoolean(lenient); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeOptionalFloat(null); } zeroTermsQuery.writeTo(out); @@ -827,6 +828,6 @@ protected boolean doEquals(MultiMatchQueryBuilder other) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java index d36e2f7d7eef0..83d31c71d4f76 100644 --- a/server/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java @@ -25,6 +25,7 @@ import org.apache.lucene.search.join.ScoreMode; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.search.MaxScoreCollector; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; @@ -439,6 +440,6 @@ public TopDocsAndMaxScore topDocs(SearchHit hit) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/PrefixQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/PrefixQueryBuilder.java index d86754028dceb..5042ab358a96c 100644 --- a/server/src/main/java/org/elasticsearch/index/query/PrefixQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/PrefixQueryBuilder.java @@ -13,6 +13,7 @@ import org.apache.lucene.search.MultiTermQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -72,7 +73,7 @@ public PrefixQueryBuilder(StreamInput in) throws IOException { fieldName = in.readString(); value = in.readString(); rewrite = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { caseInsensitive = in.readBoolean(); } } @@ -82,7 +83,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeString(fieldName); out.writeString(value); out.writeOptionalString(rewrite); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeBoolean(caseInsensitive); } } @@ -232,6 +233,6 @@ protected boolean doEquals(PrefixQueryBuilder other) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/QueryStringQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/QueryStringQueryBuilder.java index f3146988500fd..fa07cceeece30 100644 --- a/server/src/main/java/org/elasticsearch/index/query/QueryStringQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/QueryStringQueryBuilder.java @@ -13,6 +13,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.util.automaton.Operations; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -968,6 +969,6 @@ protected Query doToQuery(SearchExecutionContext context) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java index 6a5e10b0e79d2..4d2a6d3eaecdb 100644 --- a/server/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java @@ -12,6 +12,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.util.BytesRef; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.ShapeRelation; @@ -559,6 +560,6 @@ protected boolean doEquals(RangeQueryBuilder other) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/RegexpQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/RegexpQueryBuilder.java index ad9afc79faf67..b46e30401a0a2 100644 --- a/server/src/main/java/org/elasticsearch/index/query/RegexpQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/RegexpQueryBuilder.java @@ -15,6 +15,7 @@ import org.apache.lucene.util.automaton.Operations; import org.apache.lucene.util.automaton.RegExp; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -86,7 +87,7 @@ public RegexpQueryBuilder(StreamInput in) throws IOException { syntaxFlagsValue = in.readVInt(); maxDeterminizedStates = in.readVInt(); rewrite = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { caseInsensitive = in.readBoolean(); } } @@ -98,7 +99,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeVInt(syntaxFlagsValue); out.writeVInt(maxDeterminizedStates); out.writeOptionalString(rewrite); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeBoolean(caseInsensitive); } } @@ -321,6 +322,6 @@ protected boolean doEquals(RegexpQueryBuilder other) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/ScriptQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/ScriptQueryBuilder.java index 6200d660d5657..597e23881362b 100644 --- a/server/src/main/java/org/elasticsearch/index/query/ScriptQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/ScriptQueryBuilder.java @@ -21,6 +21,7 @@ import org.apache.lucene.search.Weight; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -225,6 +226,6 @@ protected boolean doEquals(ScriptQueryBuilder other) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/SimpleQueryStringBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SimpleQueryStringBuilder.java index 603654dcd6340..15ed11654b9e6 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SimpleQueryStringBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SimpleQueryStringBuilder.java @@ -12,6 +12,7 @@ import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -90,7 +91,7 @@ public class SimpleQueryStringBuilder extends AbstractQueryBuilder { public static final String NAME = "terms"; - private static final TransportVersion VERSION_STORE_VALUES_AS_BYTES_REFERENCE = TransportVersion.V_7_12_0; + private static final TransportVersion VERSION_STORE_VALUES_AS_BYTES_REFERENCE = TransportVersions.V_7_12_0; private final String fieldName; private final Values values; @@ -666,6 +667,6 @@ public int hashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/TermsSetQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/TermsSetQueryBuilder.java index bf8ef78751b01..ce6ab1db835ab 100644 --- a/server/src/main/java/org/elasticsearch/index/query/TermsSetQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/TermsSetQueryBuilder.java @@ -19,6 +19,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -44,7 +45,7 @@ public final class TermsSetQueryBuilder extends AbstractQueryBuilder inner @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/index/query/functionscore/WeightBuilder.java b/server/src/main/java/org/elasticsearch/index/query/functionscore/WeightBuilder.java index 2af55eaaf844b..ee6b720b97442 100644 --- a/server/src/main/java/org/elasticsearch/index/query/functionscore/WeightBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/functionscore/WeightBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.index.query.functionscore; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.function.ScoreFunction; @@ -58,7 +59,7 @@ protected int doHashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/main/java/org/elasticsearch/index/refresh/RefreshStats.java b/server/src/main/java/org/elasticsearch/index/refresh/RefreshStats.java index 5b627e4a77eb8..ee95fdd925c00 100644 --- a/server/src/main/java/org/elasticsearch/index/refresh/RefreshStats.java +++ b/server/src/main/java/org/elasticsearch/index/refresh/RefreshStats.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.refresh; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -39,7 +39,7 @@ public RefreshStats() {} public RefreshStats(StreamInput in) throws IOException { total = in.readVLong(); totalTimeInMillis = in.readVLong(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { externalTotal = in.readVLong(); externalTotalTimeInMillis = in.readVLong(); } @@ -50,7 +50,7 @@ public RefreshStats(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { out.writeVLong(total); out.writeVLong(totalTimeInMillis); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { out.writeVLong(externalTotal); out.writeVLong(externalTotalTimeInMillis); } diff --git a/server/src/main/java/org/elasticsearch/index/reindex/RemoteInfo.java b/server/src/main/java/org/elasticsearch/index/reindex/RemoteInfo.java index f168ef9ec2dcf..68eec49f082ce 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/RemoteInfo.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/RemoteInfo.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.reindex; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -99,7 +99,7 @@ public RemoteInfo(StreamInput in) throws IOException { port = in.readVInt(); query = in.readBytesReference(); username = in.readOptionalString(); - if (in.getTransportVersion().before(TransportVersion.V_8_2_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_2_0)) { password = new SecureString(in.readOptionalString().toCharArray()); } else { password = in.readOptionalSecureString(); @@ -122,7 +122,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVInt(port); out.writeBytesReference(query); out.writeOptionalString(username); - if (out.getTransportVersion().before(TransportVersion.V_8_2_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_2_0)) { out.writeOptionalString(password.toString()); } else { out.writeOptionalSecureString(password); diff --git a/server/src/main/java/org/elasticsearch/index/search/stats/FieldUsageStats.java b/server/src/main/java/org/elasticsearch/index/search/stats/FieldUsageStats.java index 0b235de9292bc..04f3e49fec820 100644 --- a/server/src/main/java/org/elasticsearch/index/search/stats/FieldUsageStats.java +++ b/server/src/main/java/org/elasticsearch/index/search/stats/FieldUsageStats.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.search.stats; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -210,7 +210,7 @@ public PerFieldUsageStats(StreamInput in) throws IOException { payloads = in.readVLong(); termVectors = in.readVLong(); points = in.readVLong(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { knnVectors = in.readVLong(); } else { knnVectors = 0; @@ -232,7 +232,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(payloads); out.writeVLong(termVectors); out.writeVLong(points); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { out.writeVLong(knnVectors); } } diff --git a/server/src/main/java/org/elasticsearch/index/shard/IndexingStats.java b/server/src/main/java/org/elasticsearch/index/shard/IndexingStats.java index 22f3da92eebaf..1823c4bdfbfa1 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/IndexingStats.java +++ b/server/src/main/java/org/elasticsearch/index/shard/IndexingStats.java @@ -9,6 +9,7 @@ package org.elasticsearch.index.shard; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -27,7 +28,7 @@ public class IndexingStats implements Writeable, ToXContentFragment { public static class Stats implements Writeable, ToXContentFragment { - private static final TransportVersion WRITE_LOAD_AVG_SUPPORTED_VERSION = TransportVersion.V_8_6_0; + private static final TransportVersion WRITE_LOAD_AVG_SUPPORTED_VERSION = TransportVersions.V_8_6_0; private long indexCount; private long indexTimeInMillis; @@ -268,7 +269,7 @@ public IndexingStats() { public IndexingStats(StreamInput in) throws IOException { totalStats = new Stats(in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { if (in.readBoolean()) { Map typeStats = in.readMap(Stats::new); assert typeStats.size() == 1; @@ -349,7 +350,7 @@ static final class Fields { @Override public void writeTo(StreamOutput out) throws IOException { totalStats.writeTo(out); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeBoolean(false); } } diff --git a/server/src/main/java/org/elasticsearch/index/stats/IndexingPressureStats.java b/server/src/main/java/org/elasticsearch/index/stats/IndexingPressureStats.java index e4db6921a44d2..81eb40e6f6f61 100644 --- a/server/src/main/java/org/elasticsearch/index/stats/IndexingPressureStats.java +++ b/server/src/main/java/org/elasticsearch/index/stats/IndexingPressureStats.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.stats; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -57,7 +57,7 @@ public IndexingPressureStats(StreamInput in) throws IOException { primaryRejections = in.readVLong(); replicaRejections = in.readVLong(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { memoryLimit = in.readVLong(); } else { memoryLimit = -1L; @@ -129,7 +129,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(primaryRejections); out.writeVLong(replicaRejections); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeVLong(memoryLimit); } } diff --git a/server/src/main/java/org/elasticsearch/index/store/StoreFileMetadata.java b/server/src/main/java/org/elasticsearch/index/store/StoreFileMetadata.java index d9422c648ef8a..9a2655cd6e56f 100644 --- a/server/src/main/java/org/elasticsearch/index/store/StoreFileMetadata.java +++ b/server/src/main/java/org/elasticsearch/index/store/StoreFileMetadata.java @@ -16,6 +16,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.Version; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -29,7 +30,7 @@ public class StoreFileMetadata implements Writeable { public static final BytesRef UNAVAILABLE_WRITER_UUID = new BytesRef(); - private static final TransportVersion WRITER_UUID_MIN_VERSION = TransportVersion.V_7_16_0; + private static final TransportVersion WRITER_UUID_MIN_VERSION = TransportVersions.V_7_16_0; private final String name; diff --git a/server/src/main/java/org/elasticsearch/index/store/StoreStats.java b/server/src/main/java/org/elasticsearch/index/store/StoreStats.java index 0820f859355ae..cda87a421bd32 100644 --- a/server/src/main/java/org/elasticsearch/index/store/StoreStats.java +++ b/server/src/main/java/org/elasticsearch/index/store/StoreStats.java @@ -9,6 +9,7 @@ package org.elasticsearch.index.store; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -27,8 +28,8 @@ public class StoreStats implements Writeable, ToXContentFragment { */ public static final long UNKNOWN_RESERVED_BYTES = -1L; - public static final TransportVersion RESERVED_BYTES_VERSION = TransportVersion.V_7_9_0; - public static final TransportVersion TOTAL_DATA_SET_SIZE_SIZE_VERSION = TransportVersion.V_7_13_0; + public static final TransportVersion RESERVED_BYTES_VERSION = TransportVersions.V_7_9_0; + public static final TransportVersion TOTAL_DATA_SET_SIZE_SIZE_VERSION = TransportVersions.V_7_13_0; private long sizeInBytes; private long totalDataSetSizeInBytes; diff --git a/server/src/main/java/org/elasticsearch/index/translog/Translog.java b/server/src/main/java/org/elasticsearch/index/translog/Translog.java index 871de3c9f9f87..ed273a8701c41 100644 --- a/server/src/main/java/org/elasticsearch/index/translog/Translog.java +++ b/server/src/main/java/org/elasticsearch/index/translog/Translog.java @@ -9,7 +9,7 @@ package org.elasticsearch.index.translog; import org.apache.lucene.store.AlreadyClosedException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.bytes.BytesReference; @@ -1223,7 +1223,7 @@ public long version() { @Override public void writeBody(final StreamOutput out) throws IOException { - final int format = out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0) + final int format = out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0) ? SERIALIZATION_FORMAT : FORMAT_NO_VERSION_TYPE; out.writeVInt(format); @@ -1364,7 +1364,7 @@ public long version() { @Override public void writeBody(final StreamOutput out) throws IOException { - final int format = out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0) + final int format = out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0) ? SERIALIZATION_FORMAT : FORMAT_NO_VERSION_TYPE; out.writeVInt(format); @@ -1504,7 +1504,7 @@ public static List readOperations(StreamInput input, String source) t ArrayList operations = new ArrayList<>(); int numOps = input.readInt(); final BufferedChecksumStreamInput checksumStreamInput = new BufferedChecksumStreamInput(input, source); - if (input.getTransportVersion().before(TransportVersion.V_8_8_0)) { + if (input.getTransportVersion().before(TransportVersions.V_8_8_0)) { for (int i = 0; i < numOps; i++) { operations.add(readOperation(checksumStreamInput)); } @@ -1554,7 +1554,7 @@ public static void writeOperations(StreamOutput outStream, List toWri if (size == 0) { return; } - if (outStream.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (outStream.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { final BufferedChecksumStreamOutput checksumStreamOutput = new BufferedChecksumStreamOutput(outStream); for (Operation op : toWrite) { writeOperationNoSize(checksumStreamOutput, op); diff --git a/server/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java b/server/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java index 1d21b0aac0e50..98f535ec7cefb 100644 --- a/server/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java +++ b/server/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java @@ -9,6 +9,7 @@ package org.elasticsearch.indices; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.NodeStatsLevel; import org.elasticsearch.action.admin.indices.stats.CommonStats; import org.elasticsearch.action.admin.indices.stats.IndexShardStats; @@ -57,7 +58,7 @@ */ public class NodeIndicesStats implements Writeable, ChunkedToXContent { - private static final TransportVersion VERSION_SUPPORTING_STATS_BY_INDEX = TransportVersion.V_8_5_0; + private static final TransportVersion VERSION_SUPPORTING_STATS_BY_INDEX = TransportVersions.V_8_5_0; private final CommonStats stats; private final Map> statsByShard; diff --git a/server/src/main/java/org/elasticsearch/indices/TermsLookup.java b/server/src/main/java/org/elasticsearch/indices/TermsLookup.java index b18cf552c6451..d819cdf128572 100644 --- a/server/src/main/java/org/elasticsearch/indices/TermsLookup.java +++ b/server/src/main/java/org/elasticsearch/indices/TermsLookup.java @@ -8,7 +8,7 @@ package org.elasticsearch.indices; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -56,7 +56,7 @@ public TermsLookup(String index, String id, String path) { * Read from a stream. */ public TermsLookup(StreamInput in) throws IOException { - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readOptionalString(); } id = in.readString(); @@ -67,7 +67,7 @@ public TermsLookup(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeOptionalString(MapperService.SINGLE_MAPPING_NAME); } out.writeString(id); diff --git a/server/src/main/java/org/elasticsearch/indices/recovery/RecoverySettings.java b/server/src/main/java/org/elasticsearch/indices/recovery/RecoverySettings.java index 06bb809fdcaf9..1199e6ba5503f 100644 --- a/server/src/main/java/org/elasticsearch/indices/recovery/RecoverySettings.java +++ b/server/src/main/java/org/elasticsearch/indices/recovery/RecoverySettings.java @@ -13,6 +13,7 @@ import org.apache.lucene.store.RateLimiter; import org.apache.lucene.store.RateLimiter.SimpleRateLimiter; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeRole; @@ -47,9 +48,9 @@ public class RecoverySettings { public static final Version SNAPSHOT_RECOVERIES_SUPPORTED_VERSION = Version.V_7_15_0; public static final IndexVersion SNAPSHOT_RECOVERIES_SUPPORTED_INDEX_VERSION = IndexVersion.V_7_15_0; - public static final TransportVersion SNAPSHOT_RECOVERIES_SUPPORTED_TRANSPORT_VERSION = TransportVersion.V_7_15_0; + public static final TransportVersion SNAPSHOT_RECOVERIES_SUPPORTED_TRANSPORT_VERSION = TransportVersions.V_7_15_0; public static final IndexVersion SEQ_NO_SNAPSHOT_RECOVERIES_SUPPORTED_VERSION = IndexVersion.V_7_16_0; - public static final TransportVersion SNAPSHOT_FILE_DOWNLOAD_THROTTLING_SUPPORTED_TRANSPORT_VERSION = TransportVersion.V_7_16_0; + public static final TransportVersion SNAPSHOT_FILE_DOWNLOAD_THROTTLING_SUPPORTED_TRANSPORT_VERSION = TransportVersions.V_7_16_0; private static final Logger logger = LogManager.getLogger(RecoverySettings.class); diff --git a/server/src/main/java/org/elasticsearch/indices/store/TransportNodesListShardStoreMetadata.java b/server/src/main/java/org/elasticsearch/indices/store/TransportNodesListShardStoreMetadata.java index ee9fbe9e1492c..479b42fdf2e87 100644 --- a/server/src/main/java/org/elasticsearch/indices/store/TransportNodesListShardStoreMetadata.java +++ b/server/src/main/java/org/elasticsearch/indices/store/TransportNodesListShardStoreMetadata.java @@ -11,7 +11,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.FailedNodeException; import org.elasticsearch.action.support.ActionFilters; @@ -203,7 +203,7 @@ public record StoreFilesMetadata(Store.MetadataSnapshot metadataSnapshot, List getPipelines() { @@ -148,7 +149,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } } diff --git a/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java b/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java index ff907b405a671..afeac8019b219 100644 --- a/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java +++ b/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java @@ -9,7 +9,7 @@ package org.elasticsearch.monitor.jvm; import org.apache.lucene.util.Constants; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -268,7 +268,7 @@ public JvmInfo(StreamInput in) throws IOException { vmName = in.readString(); vmVersion = in.readString(); vmVendor = in.readString(); - if (in.getTransportVersion().before(TransportVersion.V_8_3_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_3_0)) { // Before 8.0 the no-jdk distributions could have bundledJdk false, this is always true now. in.readBoolean(); } @@ -302,7 +302,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(vmName); out.writeString(vmVersion); out.writeString(vmVendor); - if (out.getTransportVersion().before(TransportVersion.V_8_3_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_3_0)) { out.writeBoolean(true); } out.writeOptionalBoolean(usingBundledJdk); diff --git a/server/src/main/java/org/elasticsearch/monitor/os/OsInfo.java b/server/src/main/java/org/elasticsearch/monitor/os/OsInfo.java index d956ee4f6852c..9f0f0c6ed53f8 100644 --- a/server/src/main/java/org/elasticsearch/monitor/os/OsInfo.java +++ b/server/src/main/java/org/elasticsearch/monitor/os/OsInfo.java @@ -9,6 +9,7 @@ package org.elasticsearch.monitor.os; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.Processors; @@ -19,7 +20,7 @@ import java.io.IOException; public class OsInfo implements ReportingService.Info { - private static final TransportVersion DOUBLE_PRECISION_ALLOCATED_PROCESSORS_SUPPORT = TransportVersion.V_8_5_0; + private static final TransportVersion DOUBLE_PRECISION_ALLOCATED_PROCESSORS_SUPPORT = TransportVersions.V_8_5_0; private final long refreshInterval; private final int availableProcessors; diff --git a/server/src/main/java/org/elasticsearch/monitor/os/OsStats.java b/server/src/main/java/org/elasticsearch/monitor/os/OsStats.java index dab3eb100e9fb..f4ca89c8604bf 100644 --- a/server/src/main/java/org/elasticsearch/monitor/os/OsStats.java +++ b/server/src/main/java/org/elasticsearch/monitor/os/OsStats.java @@ -10,7 +10,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -276,7 +276,7 @@ public Mem(StreamInput in) throws IOException { total = 0; } this.total = total; - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { long adjustedTotal = in.readLong(); assert adjustedTotal >= 0 : "expected adjusted total memory to be positive, got: " + adjustedTotal; if (adjustedTotal < 0) { @@ -299,7 +299,7 @@ public Mem(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { out.writeLong(total); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeLong(adjustedTotal); } out.writeLong(free); diff --git a/server/src/main/java/org/elasticsearch/persistent/PersistentTasksCustomMetadata.java b/server/src/main/java/org/elasticsearch/persistent/PersistentTasksCustomMetadata.java index 1fbd758719cf2..5fdac777b5a75 100644 --- a/server/src/main/java/org/elasticsearch/persistent/PersistentTasksCustomMetadata.java +++ b/server/src/main/java/org/elasticsearch/persistent/PersistentTasksCustomMetadata.java @@ -10,6 +10,7 @@ import org.elasticsearch.ResourceAlreadyExistsException; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.AbstractNamedDiffable; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.NamedDiff; @@ -199,7 +200,7 @@ public long getNumberOfTasksOnNode(String nodeId, String taskName) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } @Override diff --git a/server/src/main/java/org/elasticsearch/plugins/PluginDescriptor.java b/server/src/main/java/org/elasticsearch/plugins/PluginDescriptor.java index 8d489c856befb..46028ad36b66c 100644 --- a/server/src/main/java/org/elasticsearch/plugins/PluginDescriptor.java +++ b/server/src/main/java/org/elasticsearch/plugins/PluginDescriptor.java @@ -9,6 +9,7 @@ package org.elasticsearch.plugins; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -46,9 +47,9 @@ public class PluginDescriptor implements Writeable, ToXContentObject { public static final String ES_PLUGIN_POLICY = "plugin-security.policy"; - private static final TransportVersion LICENSED_PLUGINS_SUPPORT = TransportVersion.V_7_11_0; - private static final TransportVersion MODULE_NAME_SUPPORT = TransportVersion.V_8_3_0; - private static final TransportVersion BOOTSTRAP_SUPPORT_REMOVED = TransportVersion.V_8_4_0; + private static final TransportVersion LICENSED_PLUGINS_SUPPORT = TransportVersions.V_7_11_0; + private static final TransportVersion MODULE_NAME_SUPPORT = TransportVersions.V_8_3_0; + private static final TransportVersion BOOTSTRAP_SUPPORT_REMOVED = TransportVersions.V_8_4_0; private final String name; private final String description; @@ -137,7 +138,7 @@ public PluginDescriptor(final StreamInput in) throws IOException { isLicensed = false; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { isModular = in.readBoolean(); isStable = in.readBoolean(); } else { @@ -167,7 +168,7 @@ public void writeTo(final StreamOutput out) throws IOException { } out.writeBoolean(isLicensed); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeBoolean(isModular); out.writeBoolean(isStable); } diff --git a/server/src/main/java/org/elasticsearch/plugins/PluginRuntimeInfo.java b/server/src/main/java/org/elasticsearch/plugins/PluginRuntimeInfo.java index f58f14bcd7a77..87ef68c91f363 100644 --- a/server/src/main/java/org/elasticsearch/plugins/PluginRuntimeInfo.java +++ b/server/src/main/java/org/elasticsearch/plugins/PluginRuntimeInfo.java @@ -8,7 +8,7 @@ package org.elasticsearch.plugins; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -40,7 +40,7 @@ public PluginRuntimeInfo(StreamInput in) throws IOException { } private static Boolean readIsOfficial(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { return in.readBoolean(); } else { return null; @@ -48,7 +48,7 @@ private static Boolean readIsOfficial(StreamInput in) throws IOException { } private static PluginApiInfo readApiInfo(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { return in.readOptionalWriteable(PluginApiInfo::new); } else { return null; @@ -72,7 +72,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws @Override public void writeTo(StreamOutput out) throws IOException { descriptor.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { out.writeBoolean(isOfficial); out.writeOptionalWriteable(pluginApiInfo); } diff --git a/server/src/main/java/org/elasticsearch/repositories/RepositoriesStats.java b/server/src/main/java/org/elasticsearch/repositories/RepositoriesStats.java index 271d872d76572..f1cd2d5d87abd 100644 --- a/server/src/main/java/org/elasticsearch/repositories/RepositoriesStats.java +++ b/server/src/main/java/org/elasticsearch/repositories/RepositoriesStats.java @@ -8,7 +8,7 @@ package org.elasticsearch.repositories; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -28,7 +28,7 @@ public class RepositoriesStats implements Writeable, ToXContentFragment { private final Map repositoryThrottlingStats; public RepositoriesStats(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_011)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_011)) { repositoryThrottlingStats = in.readMap(ThrottlingStats::new); } else { repositoryThrottlingStats = new HashMap<>(); @@ -41,7 +41,7 @@ public RepositoriesStats(Map repositoryThrottlingStats) @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_011)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_011)) { out.writeMap(repositoryThrottlingStats, StreamOutput::writeWriteable); } } diff --git a/server/src/main/java/org/elasticsearch/script/ScriptContextStats.java b/server/src/main/java/org/elasticsearch/script/ScriptContextStats.java index 8b947e5034168..7af41d922d8df 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptContextStats.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptContextStats.java @@ -8,7 +8,7 @@ package org.elasticsearch.script; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -60,10 +60,10 @@ public static ScriptContextStats read(StreamInput in) throws IOException { var compilationLimitTriggered = in.readVLong(); TimeSeries compilationsHistory; TimeSeries cacheEvictionsHistory; - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { compilationsHistory = new TimeSeries(in); cacheEvictionsHistory = new TimeSeries(in); - } else if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + } else if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { compilationsHistory = new TimeSeries(in).withTotal(compilations); cacheEvictionsHistory = new TimeSeries(in).withTotal(cacheEvictions); } else { @@ -98,7 +98,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(compilations); out.writeVLong(cacheEvictions); out.writeVLong(compilationLimitTriggered); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { compilationsHistory.writeTo(out); cacheEvictionsHistory.writeTo(out); } diff --git a/server/src/main/java/org/elasticsearch/script/ScriptException.java b/server/src/main/java/org/elasticsearch/script/ScriptException.java index 67b64db658d97..4b57b90624acb 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptException.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptException.java @@ -9,7 +9,7 @@ package org.elasticsearch.script; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -78,7 +78,7 @@ public ScriptException(StreamInput in) throws IOException { scriptStack = Arrays.asList(in.readStringArray()); script = in.readString(); lang = in.readString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0) && in.readBoolean()) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0) && in.readBoolean()) { pos = new Position(in); } else { pos = null; @@ -91,7 +91,7 @@ protected void writeTo(StreamOutput out, Writer nestedExceptionsWrite out.writeStringCollection(scriptStack); out.writeString(script); out.writeString(lang); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { if (pos == null) { out.writeBoolean(false); } else { diff --git a/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java b/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java index d098f1de0a36a..bf076692133a5 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java @@ -11,6 +11,7 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; @@ -129,7 +130,7 @@ public void writeTo(StreamOutput out) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } } @@ -281,7 +282,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } @Override diff --git a/server/src/main/java/org/elasticsearch/script/ScriptStats.java b/server/src/main/java/org/elasticsearch/script/ScriptStats.java index 6720d67e3ac08..e45f75124e923 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptStats.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptStats.java @@ -8,7 +8,7 @@ package org.elasticsearch.script; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.collect.Iterators; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -128,7 +128,7 @@ public static ScriptStats read(StreamInput in) throws IOException { TimeSeries cacheEvictionsHistory; long compilations; long cacheEvictions; - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { compilationsHistory = new TimeSeries(in); cacheEvictionsHistory = new TimeSeries(in); compilations = compilationsHistory.total; @@ -153,7 +153,7 @@ public static ScriptStats read(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { compilationsHistory.writeTo(out); cacheEvictionsHistory.writeTo(out); } else { diff --git a/server/src/main/java/org/elasticsearch/script/TimeSeries.java b/server/src/main/java/org/elasticsearch/script/TimeSeries.java index 2c541fef08e0c..38114b8089180 100644 --- a/server/src/main/java/org/elasticsearch/script/TimeSeries.java +++ b/server/src/main/java/org/elasticsearch/script/TimeSeries.java @@ -8,7 +8,7 @@ package org.elasticsearch.script; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -58,7 +58,7 @@ public TimeSeries(StreamInput in) throws IOException { fiveMinutes = in.readVLong(); fifteenMinutes = in.readVLong(); twentyFourHours = in.readVLong(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { total = in.readVLong(); } else { total = 0; @@ -79,7 +79,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(fiveMinutes); out.writeVLong(fifteenMinutes); out.writeVLong(twentyFourHours); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { out.writeVLong(total); } } diff --git a/server/src/main/java/org/elasticsearch/search/CanMatchShardResponse.java b/server/src/main/java/org/elasticsearch/search/CanMatchShardResponse.java index d432a5b4f89d9..a42fa9d8eec36 100644 --- a/server/src/main/java/org/elasticsearch/search/CanMatchShardResponse.java +++ b/server/src/main/java/org/elasticsearch/search/CanMatchShardResponse.java @@ -8,7 +8,7 @@ package org.elasticsearch.search; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.sort.MinAndMax; @@ -25,7 +25,7 @@ public final class CanMatchShardResponse extends SearchPhaseResult { public CanMatchShardResponse(StreamInput in) throws IOException { super(in); this.canMatch = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { estimatedMinAndMax = in.readOptionalWriteable(MinAndMax::new); } else { estimatedMinAndMax = null; @@ -40,7 +40,7 @@ public CanMatchShardResponse(boolean canMatch, MinAndMax estimatedMinAndMax) @Override public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(canMatch); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { out.writeOptionalWriteable(estimatedMinAndMax); } } diff --git a/server/src/main/java/org/elasticsearch/search/DocValueFormat.java b/server/src/main/java/org/elasticsearch/search/DocValueFormat.java index 651bcfbef045d..013c3587e84f5 100644 --- a/server/src/main/java/org/elasticsearch/search/DocValueFormat.java +++ b/server/src/main/java/org/elasticsearch/search/DocValueFormat.java @@ -10,7 +10,7 @@ import org.apache.lucene.document.InetAddressPoint; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.StreamInput; @@ -241,14 +241,14 @@ public DateTime(StreamInput in) throws IOException { this.formatter = DateFormatter.forPattern(formatterPattern).withZone(this.timeZone); this.parser = formatter.toDateMathParser(); this.resolution = DateFieldMapper.Resolution.ofOrdinal(in.readVInt()); - if (in.getTransportVersion().between(TransportVersion.V_7_7_0, TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().between(TransportVersions.V_7_7_0, TransportVersions.V_8_0_0)) { /* when deserialising from 7.7+ nodes expect a flag indicating if a pattern is of joda style This is only used to support joda style indices in 7.x, in 8 we no longer support this. All indices in 8 should use java style pattern. Hence we can ignore this flag. */ in.readBoolean(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { this.formatSortValues = in.readBoolean(); } else { this.formatSortValues = false; @@ -265,14 +265,14 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(formatter.pattern()); out.writeString(timeZone.getId()); out.writeVInt(resolution.ordinal()); - if (out.getTransportVersion().between(TransportVersion.V_7_7_0, TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().between(TransportVersions.V_7_7_0, TransportVersions.V_8_0_0)) { /* when serializing to 7.7+ send out a flag indicating if a pattern is of joda style This is only used to support joda style indices in 7.x, in 8 we no longer support this. All indices in 8 should use java style pattern. Hence this flag is always false. */ out.writeBoolean(false); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { out.writeBoolean(formatSortValues); } } diff --git a/server/src/main/java/org/elasticsearch/search/SearchExtBuilder.java b/server/src/main/java/org/elasticsearch/search/SearchExtBuilder.java index 76dc2cb69122f..26dc0027e3840 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchExtBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/SearchExtBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.VersionedNamedWriteable; @@ -43,6 +44,6 @@ public abstract class SearchExtBuilder implements VersionedNamedWriteable, ToXCo @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/SearchHit.java b/server/src/main/java/org/elasticsearch/search/SearchHit.java index 962d041c227a1..9fa99bb4a773f 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchHit.java +++ b/server/src/main/java/org/elasticsearch/search/SearchHit.java @@ -10,7 +10,7 @@ import org.apache.lucene.search.Explanation; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; @@ -138,11 +138,11 @@ public SearchHit(int nestedTopDocId, String id, NestedIdentity nestedIdentity) { public SearchHit(StreamInput in) throws IOException { docId = -1; score = in.readFloat(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { rank = in.readVInt(); } id = in.readOptionalText(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readOptionalText(); } nestedIdentity = in.readOptionalWriteable(NestedIdentity::new); @@ -156,7 +156,7 @@ public SearchHit(StreamInput in) throws IOException { if (in.readBoolean()) { explanation = readExplanation(in); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_8_0)) { documentFields.putAll(in.readMap(DocumentField::new)); metaFields.putAll(in.readMap(DocumentField::new)); } else { @@ -186,7 +186,7 @@ public SearchHit(StreamInput in) throws IOException { sortValues = new SearchSortValues(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { matchedQueries = in.readOrderedMap(StreamInput::readString, StreamInput::readFloat); } else { size = in.readVInt(); @@ -243,13 +243,13 @@ private static void writeFields(StreamOutput out, Map fie @Override public void writeTo(StreamOutput out) throws IOException { out.writeFloat(score); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeVInt(rank); } else if (rank != NO_RANK) { throw new IllegalArgumentException("cannot serialize [rank] to version [" + out.getTransportVersion() + "]"); } out.writeOptionalText(id); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeOptionalText(SINGLE_MAPPING_TYPE); } out.writeOptionalWriteable(nestedIdentity); @@ -263,7 +263,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(true); writeExplanation(out, explanation); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_8_0)) { out.writeMap(documentFields, StreamOutput::writeWriteable); out.writeMap(metaFields, StreamOutput::writeWriteable); } else { @@ -276,7 +276,7 @@ public void writeTo(StreamOutput out) throws IOException { } sortValues.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeMap(matchedQueries, StreamOutput::writeFloat); } else { out.writeStringCollection(matchedQueries.keySet()); diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregationBuilder.java index 272d0db8cd002..6b894b3a9dbbd 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.composite; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.index.mapper.TimeSeriesIdFieldMapper.TimeSeriesIdFieldType; @@ -304,6 +305,6 @@ public boolean equals(Object obj) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java index 49c29bf722a9c..6bbebc0ec9e5e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.aggregations.bucket.composite; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -55,7 +55,7 @@ public abstract class CompositeValuesSourceBuilder builder, StreamOutput } else if (builder.getClass() == HistogramValuesSourceBuilder.class) { code = 2; } else if (builder.getClass() == GeoTileGridValuesSourceBuilder.class) { - if (out.getTransportVersion().before(TransportVersion.V_7_5_0)) { + if (out.getTransportVersion().before(TransportVersions.V_7_5_0)) { throw new IOException( "Attempting to serialize [" + builder.getClass().getSimpleName() diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java index 036a96dc8757d..2cd33e470e3e5 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.composite; import org.apache.lucene.index.IndexReader; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Rounding; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -105,7 +105,7 @@ protected DateHistogramValuesSourceBuilder(StreamInput in) throws IOException { super(in); dateHistogramInterval = new DateIntervalWrapper(in); timeZone = in.readOptionalZoneId(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { offset = in.readLong(); } } @@ -114,7 +114,7 @@ protected DateHistogramValuesSourceBuilder(StreamInput in) throws IOException { protected void innerWriteTo(StreamOutput out) throws IOException { dateHistogramInterval.writeTo(out); out.writeOptionalZoneId(timeZone); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { out.writeLong(offset); } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/InternalComposite.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/InternalComposite.java index b779df7ebd621..927104a92deb2 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/InternalComposite.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/InternalComposite.java @@ -10,7 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.PriorityQueue; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.DocValueFormat; @@ -100,7 +100,7 @@ public InternalComposite(StreamInput in) throws IOException { formats.add(in.readNamedWriteable(DocValueFormat.class)); } this.reverseMuls = in.readIntArray(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { this.missingOrders = in.readArray(MissingOrder::readFromStream, MissingOrder[]::new); } else { this.missingOrders = new MissingOrder[reverseMuls.length]; @@ -108,7 +108,7 @@ public InternalComposite(StreamInput in) throws IOException { } this.buckets = in.readCollectionAsList((input) -> new InternalBucket(input, sourceNames, formats, reverseMuls, missingOrders)); this.afterKey = in.readOptionalWriteable(CompositeKey::new); - this.earlyTerminated = in.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0) ? in.readBoolean() : false; + this.earlyTerminated = in.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0) ? in.readBoolean() : false; } @Override @@ -119,12 +119,12 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeNamedWriteable(format); } out.writeIntArray(reverseMuls); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { out.writeArray(missingOrders); } out.writeCollection(buckets); out.writeOptionalWriteable(afterKey); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { out.writeBoolean(earlyTerminated); } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java index 69f51e12d86ae..dc11658437670 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.filter; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.index.query.QueryBuilder; @@ -151,7 +152,7 @@ public QueryBuilder getFilter() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } public static class FilterAggregatorFactory extends AggregatorFactory { diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregationBuilder.java index 637fdaf81f07e..81678404d1dab 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.filter; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -126,7 +127,7 @@ public FiltersAggregationBuilder(StreamInput in) throws IOException { } otherBucket = in.readBoolean(); otherBucketKey = in.readString(); - keyedBucket = in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0) ? in.readBoolean() : true; + keyedBucket = in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0) ? in.readBoolean() : true; } @Override @@ -135,7 +136,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeCollection(filters, keyed ? StreamOutput::writeWriteable : (o, v) -> o.writeNamedWriteable(v.filter())); out.writeBoolean(otherBucket); out.writeString(otherBucketKey); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeBoolean(keyedBucket); } } @@ -392,6 +393,6 @@ public String getType() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/InternalFilters.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/InternalFilters.java index 8f0d8a2f10be9..726589ca7c1b5 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/InternalFilters.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/InternalFilters.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.aggregations.bucket.filter; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.Maps; @@ -147,7 +147,7 @@ public InternalFilters(String name, List buckets, boolean keyed, public InternalFilters(StreamInput in) throws IOException { super(in); keyed = in.readBoolean(); - keyedBucket = in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0) ? in.readBoolean() : true; + keyedBucket = in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0) ? in.readBoolean() : true; int size = in.readVInt(); List buckets = new ArrayList<>(size); for (int i = 0; i < size; i++) { @@ -160,7 +160,7 @@ public InternalFilters(StreamInput in) throws IOException { @Override protected void doWriteTo(StreamOutput out) throws IOException { out.writeBoolean(keyed); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeBoolean(keyedBucket); } out.writeCollection(buckets); diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java index 5adb8bbebd471..882b4960dd36c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.geogrid; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.geo.GeoBoundingBox; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.io.stream.StreamInput; @@ -91,7 +91,7 @@ public GeoGridAggregationBuilder(StreamInput in) throws IOException { precision = in.readVInt(); requiredSize = in.readVInt(); shardSize = in.readVInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { geoBoundingBox = new GeoBoundingBox(in); } } @@ -111,7 +111,7 @@ protected void innerWriteTo(StreamOutput out) throws IOException { out.writeVInt(precision); out.writeVInt(requiredSize); out.writeVInt(shardSize); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { geoBoundingBox.writeTo(out); } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridAggregationBuilder.java index ac51799acf70d..9fd1e3a393046 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.geogrid; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.geo.GeoBoundingBox; import org.elasticsearch.common.geo.GeoUtils; import org.elasticsearch.common.io.stream.StreamInput; @@ -116,6 +117,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileGridAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileGridAggregationBuilder.java index 7d6c6bbd15e38..2ee29c8a049ef 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileGridAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileGridAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.geogrid; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.geo.GeoBoundingBox; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -112,6 +113,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_0_0; + return TransportVersions.V_7_0_0; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/global/GlobalAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/global/GlobalAggregationBuilder.java index 3d34824644df7..d0aedf7e3aad6 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/global/GlobalAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/global/GlobalAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.global; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; @@ -80,6 +81,6 @@ public String getType() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregationBuilder.java index 2c1537e17f672..ebbb290e1db9c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.histogram; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Rounding; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -156,7 +157,7 @@ public DateHistogramAggregationBuilder(StreamInput in) throws IOException { dateHistogramInterval = new DateIntervalWrapper(in); offset = in.readLong(); extendedBounds = in.readOptionalWriteable(LongBounds::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { hardBounds = in.readOptionalWriteable(LongBounds::new); } } @@ -179,7 +180,7 @@ protected void innerWriteTo(StreamOutput out) throws IOException { dateHistogramInterval.writeTo(out); out.writeLong(offset); out.writeOptionalWriteable(extendedBounds); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeOptionalWriteable(hardBounds); } } @@ -519,7 +520,7 @@ public boolean equals(Object obj) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/HistogramAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/HistogramAggregationBuilder.java index edf5b72fc0d1c..0740557a526d3 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/HistogramAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/HistogramAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.histogram; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -145,7 +146,7 @@ public HistogramAggregationBuilder(StreamInput in) throws IOException { minDocCount = in.readVLong(); interval = in.readDouble(); offset = in.readDouble(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { extendedBounds = in.readOptionalWriteable(DoubleBounds::new); hardBounds = in.readOptionalWriteable(DoubleBounds::new); } else { @@ -166,7 +167,7 @@ protected void innerWriteTo(StreamOutput out) throws IOException { out.writeVLong(minDocCount); out.writeDouble(interval); out.writeDouble(offset); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeOptionalWriteable(extendedBounds); out.writeOptionalWriteable(hardBounds); } else { @@ -442,7 +443,7 @@ public boolean equals(Object obj) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregationBuilder.java index a0a42ba101981..9ca606f460fbb 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.histogram; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; @@ -247,6 +248,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_9_0; + return TransportVersions.V_7_9_0; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/missing/MissingAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/missing/MissingAggregationBuilder.java index c198ed4d038f6..915d7c32b4c74 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/missing/MissingAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/missing/MissingAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.missing; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -120,6 +121,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java index 0839b2b83ceeb..b6e6a39356d46 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.nested; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -161,6 +162,6 @@ public String getType() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java index ce8616b8fc530..e6c4e59bf3f93 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.nested; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -177,6 +178,6 @@ public String getType() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/prefix/IpPrefixAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/prefix/IpPrefixAggregationBuilder.java index 304d3426c4f30..733a306a70c75 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/prefix/IpPrefixAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/prefix/IpPrefixAggregationBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -315,6 +316,6 @@ public int hashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_1_0; + return TransportVersions.V_8_1_0; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java index fa53153d50d6e..1dfb7a8dac2f5 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.range; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; @@ -130,7 +131,7 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java index 4da11de4b100e..a44d92f024e46 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.range; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.geo.GeoDistance; import org.elasticsearch.common.geo.GeoPoint; @@ -503,7 +504,7 @@ public boolean equals(Object obj) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalBinaryRange.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalBinaryRange.java index 03e20f7f6ee41..23105bbe2d4f3 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalBinaryRange.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalBinaryRange.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.range; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.DocValueFormat; @@ -72,8 +72,8 @@ private static String generateKey(BytesRef from, BytesRef to, DocValueFormat for private static Bucket createFromStream(StreamInput in, DocValueFormat format, boolean keyed) throws IOException { // NOTE: the key is required in version == 8.0.0 and version <= 7.17.0, // while it is optional for all subsequent versions. - String key = in.getTransportVersion().equals(TransportVersion.V_8_0_0) ? in.readString() - : in.getTransportVersion().onOrAfter(TransportVersion.V_7_17_1) ? in.readOptionalString() + String key = in.getTransportVersion().equals(TransportVersions.V_8_0_0) ? in.readString() + : in.getTransportVersion().onOrAfter(TransportVersions.V_7_17_1) ? in.readOptionalString() : in.readString(); BytesRef from = in.readBoolean() ? in.readBytesRef() : null; BytesRef to = in.readBoolean() ? in.readBytesRef() : null; @@ -85,9 +85,9 @@ private static Bucket createFromStream(StreamInput in, DocValueFormat format, bo @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().equals(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().equals(TransportVersions.V_8_0_0)) { out.writeString(key == null ? generateKey(from, to, format) : key); - } else if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_17_1)) { + } else if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_17_1)) { out.writeOptionalString(key); } else { out.writeString(key == null ? generateKey(from, to, format) : key); diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java index f821aa3440303..f125e19c75b48 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.search.aggregations.bucket.range; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.DocValueFormat; @@ -160,19 +160,19 @@ private static String generateKey(double from, double to, DocValueFormat format) public void writeTo(StreamOutput out) throws IOException { // NOTE: the key is required in version == 8.0.0 and version <= 7.17.0, // while it is optional for all subsequent versions. - if (out.getTransportVersion().equals(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().equals(TransportVersions.V_8_0_0)) { out.writeString(key == null ? generateKey(from, to, format) : key); - } else if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_17_1)) { + } else if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_17_1)) { out.writeOptionalString(key); } else { out.writeString(key == null ? generateKey(from, to, format) : key); } out.writeDouble(from); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_17_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0)) { out.writeOptionalDouble(from); } out.writeDouble(to); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_17_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0)) { out.writeOptionalDouble(to); } out.writeVLong(docCount); @@ -270,11 +270,11 @@ public InternalRange(StreamInput in) throws IOException { for (int i = 0; i < size; i++) { // NOTE: the key is required in version == 8.0.0 and version <= 7.17.0, // while it is optional for all subsequent versions. - final String key = in.getTransportVersion().equals(TransportVersion.V_8_0_0) ? in.readString() - : in.getTransportVersion().onOrAfter(TransportVersion.V_7_17_1) ? in.readOptionalString() + final String key = in.getTransportVersion().equals(TransportVersions.V_8_0_0) ? in.readString() + : in.getTransportVersion().onOrAfter(TransportVersions.V_7_17_1) ? in.readOptionalString() : in.readString(); double from = in.readDouble(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_17_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0)) { final Double originalFrom = in.readOptionalDouble(); if (originalFrom != null) { from = originalFrom; @@ -283,7 +283,7 @@ public InternalRange(StreamInput in) throws IOException { } } double to = in.readDouble(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_17_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0)) { final Double originalTo = in.readOptionalDouble(); if (originalTo != null) { to = originalTo; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java index 64b3c6a0839bc..ef580929521d0 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.document.InetAddressPoint; import org.apache.lucene.util.BytesRef; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -427,6 +428,6 @@ public boolean equals(Object obj) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregationBuilder.java index c94c0176983b7..9fdbaa10509e6 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.range; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -211,6 +212,6 @@ private static String generateKey(double from, double to, DocValueFormat format) @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregator.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregator.java index 8c86201bafefe..98237d19f0f33 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregator.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregator.java @@ -9,7 +9,7 @@ import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.ScorerSupplier; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -174,8 +174,8 @@ public Range(StreamInput in) throws IOException { toAsStr = in.readOptionalString(); from = in.readDouble(); to = in.readDouble(); - originalFrom = in.getTransportVersion().onOrAfter(TransportVersion.V_7_17_0) ? in.readOptionalDouble() : Double.valueOf(from); - originalTo = in.getTransportVersion().onOrAfter(TransportVersion.V_7_17_0) ? in.readOptionalDouble() : Double.valueOf(to); + originalFrom = in.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0) ? in.readOptionalDouble() : Double.valueOf(from); + originalTo = in.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0) ? in.readOptionalDouble() : Double.valueOf(to); } @Override @@ -185,7 +185,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(toAsStr); out.writeDouble(from); out.writeDouble(to); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_17_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0)) { out.writeOptionalDouble(originalFrom); out.writeOptionalDouble(originalTo); } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/DiversifiedAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/DiversifiedAggregationBuilder.java index b05a68f6f4f90..6dd998c0db043 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/DiversifiedAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/DiversifiedAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.sampler; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -212,6 +213,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/SamplerAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/SamplerAggregationBuilder.java index 116a0d6dbb32e..9795097f308da 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/SamplerAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/SamplerAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.sampler; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -145,6 +146,6 @@ public String getType() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/random/RandomSamplerAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/random/RandomSamplerAggregationBuilder.java index becbc8d809e0a..80d396d9aff7d 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/random/RandomSamplerAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/random/RandomSamplerAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.sampler.random; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Randomness; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -169,7 +170,7 @@ public String getType() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_2_0; + return TransportVersions.V_8_2_0; } @Override diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/IncludeExclude.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/IncludeExclude.java index 26468dc8fc54a..eb50de5f7ea59 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/IncludeExclude.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/IncludeExclude.java @@ -21,7 +21,7 @@ import org.apache.lucene.util.automaton.Operations; import org.apache.lucene.util.hppc.BitMixer; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -387,7 +387,7 @@ public IncludeExclude(StreamInput in) throws IOException { include = includeString == null ? null : new RegExp(includeString); String excludeString = in.readOptionalString(); exclude = excludeString == null ? null : new RegExp(excludeString); - if (in.getTransportVersion().before(TransportVersion.V_7_11_0)) { + if (in.getTransportVersion().before(TransportVersions.V_7_11_0)) { incZeroBasedPartition = 0; incNumPartitions = 0; includeValues = null; @@ -427,7 +427,7 @@ public void writeTo(StreamOutput out) throws IOException { if (regexBased) { out.writeOptionalString(include == null ? null : include.getOriginalString()); out.writeOptionalString(exclude == null ? null : exclude.getOriginalString()); - if (out.getTransportVersion().before(TransportVersion.V_7_11_0)) { + if (out.getTransportVersion().before(TransportVersions.V_7_11_0)) { return; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedTerms.java index 1b453abba292e..fe41df12feafa 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedTerms.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.aggregations.bucket.terms; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.DocValueFormat; @@ -63,7 +63,7 @@ protected InternalMappedTerms( */ protected InternalMappedTerms(StreamInput in, Bucket.Reader bucketReader) throws IOException { super(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_15_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_15_0)) { if (in.readBoolean()) { docCountError = in.readZLong(); } else { @@ -81,7 +81,7 @@ protected InternalMappedTerms(StreamInput in, Bucket.Reader bucketReader) thr @Override protected final void writeTermTypeInfoTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_15_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_15_0)) { if (docCountError != null) { out.writeBoolean(true); out.writeZLong(docCountError); diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalTerms.java index 318f8c16893b6..85307a903a3eb 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalTerms.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.search.aggregations.bucket.terms; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.DocValueFormat; @@ -197,7 +197,7 @@ protected InternalTerms( protected InternalTerms(StreamInput in) throws IOException { super(in); reduceOrder = InternalOrder.Streams.readOrder(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { order = InternalOrder.Streams.readOrder(in); } else { order = reduceOrder; @@ -208,7 +208,7 @@ protected InternalTerms(StreamInput in) throws IOException { @Override protected final void doWriteTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { reduceOrder.writeTo(out); } order.writeTo(out); diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsAggregationBuilder.java index 66e91ef01e0ab..768c962d13db9 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.search.aggregations.bucket.terms; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -250,6 +251,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_3_0; + return TransportVersions.V_7_3_0; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregationBuilder.java index d4589a533c67f..9fa9e65eb145a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.search.aggregations.bucket.terms; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.index.query.QueryBuilder; @@ -380,6 +381,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_3_0; + return TransportVersions.V_7_3_0; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTextAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTextAggregationBuilder.java index 77f2551fad6f9..a73d12c23a378 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTextAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTextAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.terms; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.index.query.AbstractQueryBuilder; @@ -400,6 +401,6 @@ public String getType() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_3_0; + return TransportVersions.V_7_3_0; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregationBuilder.java index cf75abfee4d02..46b5e2d6d7980 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.search.aggregations.bucket.terms; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; @@ -442,6 +443,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalHDRPercentiles.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalHDRPercentiles.java index 7f31fc9110efc..ee81039569f92 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalHDRPercentiles.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalHDRPercentiles.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.HdrHistogram.DoubleHistogram; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.DocValueFormat; @@ -58,7 +58,7 @@ abstract class AbstractInternalHDRPercentiles extends InternalNumericMetricsAggr protected AbstractInternalHDRPercentiles(StreamInput in) throws IOException { super(in); keys = in.readDoubleArray(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { if (in.readBoolean()) { state = decode(in); } else { @@ -87,7 +87,7 @@ private DoubleHistogram decode(StreamInput in) throws IOException { protected void doWriteTo(StreamOutput out) throws IOException { out.writeNamedWriteable(format); out.writeDoubleArray(keys); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { if (this.state != null) { out.writeBoolean(true); encode(this.state, out); @@ -96,7 +96,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { } } else { DoubleHistogram state = this.state != null ? this.state - : out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0) ? EMPTY_HISTOGRAM_ZERO_DIGITS + : out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0) ? EMPTY_HISTOGRAM_ZERO_DIGITS : EMPTY_HISTOGRAM_THREE_DIGITS; encode(state, out); } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalTDigestPercentiles.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalTDigestPercentiles.java index 0f5e8c1c6e75e..0faa01c8c4410 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalTDigestPercentiles.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalTDigestPercentiles.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.DocValueFormat; @@ -61,7 +61,7 @@ abstract class AbstractInternalTDigestPercentiles extends InternalNumericMetrics protected AbstractInternalTDigestPercentiles(StreamInput in) throws IOException { super(in); keys = in.readDoubleArray(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { if (in.readBoolean()) { state = TDigestState.read(in); } else { @@ -77,7 +77,7 @@ protected AbstractInternalTDigestPercentiles(StreamInput in) throws IOException protected void doWriteTo(StreamOutput out) throws IOException { out.writeNamedWriteable(format); out.writeDoubleArray(keys); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { if (this.state != null) { out.writeBoolean(true); TDigestState.write(state, out); diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java index 55976bb41825c..c66a93b480558 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.TriFunction; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -146,7 +146,7 @@ public static > ConstructingO this.valuesField = valuesField; values = in.readDoubleArray(); keyed = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_8_0)) { percentilesConfig = (PercentilesConfig) in.readOptionalWriteable((Reader) PercentilesConfig::fromStream); } else { int numberOfSignificantValueDigits = in.readVInt(); @@ -165,7 +165,7 @@ public boolean supportsSampling() { protected void innerWriteTo(StreamOutput out) throws IOException { out.writeDoubleArray(values); out.writeBoolean(keyed); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_8_0)) { out.writeOptionalWriteable(percentilesConfig); } else { // Legacy method serialized both SigFigs and compression, even though we only need one. So we need diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AvgAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AvgAggregationBuilder.java index 13f2f79c1282b..e66d3d0a34580 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AvgAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AvgAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -105,6 +106,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregationBuilder.java index 51037b85ab292..03e3dc93675d3 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -85,7 +86,7 @@ public CardinalityAggregationBuilder(StreamInput in) throws IOException { if (in.readBoolean()) { precisionThreshold = in.readLong(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { executionHint = in.readOptionalString(); } } @@ -102,7 +103,7 @@ protected void innerWriteTo(StreamOutput out) throws IOException { if (hasPrecisionThreshold) { out.writeLong(precisionThreshold); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeOptionalString(executionHint); } } @@ -224,6 +225,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java index ee9895cade71e..1078f48a39317 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -150,6 +151,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsAggregationBuilder.java index 4c7b25da338fb..db7fdb5995eec 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -157,6 +158,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoCentroidAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoCentroidAggregationBuilder.java index 1a3a6966521c4..ac0ffae7ac2e1 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoCentroidAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoCentroidAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -112,6 +113,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalGeoCentroid.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalGeoCentroid.java index 6adf77af3f92a..15f10b3a6d110 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalGeoCentroid.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalGeoCentroid.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.apache.lucene.geo.GeoEncodingUtils; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.SpatialPoint; import org.elasticsearch.common.io.stream.StreamInput; @@ -64,7 +64,7 @@ public static InternalGeoCentroid empty(String name, Map metadat @Override protected GeoPoint centroidFromStream(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { return new GeoPoint(in.readDouble(), in.readDouble()); } else { final long hash = in.readLong(); @@ -74,7 +74,7 @@ protected GeoPoint centroidFromStream(StreamInput in) throws IOException { @Override protected void centroidToStream(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { out.writeDouble(centroid.getY()); out.writeDouble(centroid.getX()); } else { diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetric.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetric.java index 6d20d8c3081f8..1580c9ce22a29 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetric.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetric.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.CollectionUtils; @@ -45,7 +45,7 @@ public class InternalScriptedMetric extends InternalAggregation implements Scrip public InternalScriptedMetric(StreamInput in) throws IOException { super(in); reduceScript = in.readOptionalWriteable(Script::new); - if (in.getTransportVersion().before(TransportVersion.V_7_8_0)) { + if (in.getTransportVersion().before(TransportVersions.V_7_8_0)) { aggregations = singletonList(in.readGenericValue()); } else { aggregations = in.readCollectionAsList(StreamInput::readGenericValue); @@ -55,7 +55,7 @@ public InternalScriptedMetric(StreamInput in) throws IOException { @Override protected void doWriteTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(reduceScript); - if (out.getTransportVersion().before(TransportVersion.V_7_8_0)) { + if (out.getTransportVersion().before(TransportVersions.V_7_8_0)) { if (aggregations.size() > 1) { /* * If aggregations has more than one entry we're trying to diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MaxAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MaxAggregationBuilder.java index 57b97bbb6fe9f..b4bb1f01b0662 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MaxAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MaxAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -109,6 +110,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java index b30bf50e5a8ea..814b35578923d 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -63,9 +64,9 @@ public MedianAbsoluteDeviationAggregationBuilder(String name) { public MedianAbsoluteDeviationAggregationBuilder(StreamInput in) throws IOException { super(in); compression = in.readDouble(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_018)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_018)) { executionHint = in.readOptionalWriteable(TDigestExecutionHint::readFrom); - } else if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_014)) { + } else if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_014)) { executionHint = TDigestExecutionHint.readFrom(in); } else { executionHint = TDigestExecutionHint.HIGH_ACCURACY; @@ -128,9 +129,9 @@ protected ValuesSourceType defaultValueSourceType() { @Override protected void innerWriteTo(StreamOutput out) throws IOException { out.writeDouble(compression); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_018)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_018)) { out.writeOptionalWriteable(executionHint); - } else if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_014)) { + } else if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_014)) { (executionHint == null ? TDigestExecutionHint.DEFAULT : executionHint).writeTo(out); } } @@ -197,6 +198,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MinAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MinAggregationBuilder.java index fff112e04f7b2..3d4957feba7db 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MinAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MinAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -111,6 +112,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentileRanksAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentileRanksAggregationBuilder.java index e7b869091976b..e61105b5822cf 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentileRanksAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentileRanksAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -116,6 +117,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesAggregationBuilder.java index 96fd8052c0cc4..0347d157cf3c5 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -152,6 +153,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesConfig.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesConfig.java index a9c567b9dd22d..ca6b6d1546135 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesConfig.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesConfig.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -143,8 +143,8 @@ public TDigest(double compression, TDigestExecutionHint executionHint) { TDigest(StreamInput in) throws IOException { this( in.readDouble(), - in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_018) ? in.readOptionalWriteable(TDigestExecutionHint::readFrom) - : in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_014) ? TDigestExecutionHint.readFrom(in) + in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_018) ? in.readOptionalWriteable(TDigestExecutionHint::readFrom) + : in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_014) ? TDigestExecutionHint.readFrom(in) : TDigestExecutionHint.HIGH_ACCURACY ); } @@ -248,9 +248,9 @@ public InternalNumericMetricsAggregation.MultiValue createEmptyPercentileRanksAg public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeDouble(compression); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_018)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_018)) { out.writeOptionalWriteable(executionHint); - } else if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_014)) { + } else if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_014)) { (executionHint == null ? TDigestExecutionHint.DEFAULT : executionHint).writeTo(out); } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricAggregationBuilder.java index 0f08ce7e1c872..8386bb8bbdb06 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.script.Script; @@ -299,7 +300,7 @@ public String getType() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/StatsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/StatsAggregationBuilder.java index f13fe41d9b04c..e978ffec42b4a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/StatsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/StatsAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -116,7 +117,7 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/SumAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/SumAggregationBuilder.java index 201c9e87d63a1..da441363020bd 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/SumAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/SumAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -109,6 +110,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/TDigestState.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/TDigestState.java index 2fbe2e679c1ab..c29153035515e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/TDigestState.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/TDigestState.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.tdigest.Centroid; @@ -111,7 +111,7 @@ public final double compression() { public static void write(TDigestState state, StreamOutput out) throws IOException { out.writeDouble(state.compression); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_014)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_014)) { out.writeString(state.type.toString()); out.writeVLong(state.tdigest.size()); } @@ -127,7 +127,7 @@ public static TDigestState read(StreamInput in) throws IOException { double compression = in.readDouble(); TDigestState state; long size = 0; - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_014)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_014)) { state = new TDigestState(Type.valueOf(in.readString()), compression); size = in.readVLong(); } else { diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/TopHitsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/TopHitsAggregationBuilder.java index 3466a2b7ce2b2..4a5df855b5095 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/TopHitsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/TopHitsAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -129,7 +130,7 @@ public TopHitsAggregationBuilder(StreamInput in) throws IOException { trackScores = in.readBoolean(); version = in.readBoolean(); seqNoAndPrimaryTerm = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { if (in.readBoolean()) { fetchFields = in.readCollectionAsList(FieldAndFormat::new); } @@ -162,7 +163,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeBoolean(trackScores); out.writeBoolean(version); out.writeBoolean(seqNoAndPrimaryTerm); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeBoolean(fetchFields != null); if (fetchFields != null) { out.writeCollection(fetchFields); @@ -918,6 +919,6 @@ public String getType() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ValueCountAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ValueCountAggregationBuilder.java index 465fe3880076d..71f745559fc77 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ValueCountAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ValueCountAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -118,6 +119,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/WeightedAvgAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/WeightedAvgAggregationBuilder.java index e0ccf799d18cf..f983dc28bf26c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/WeightedAvgAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/WeightedAvgAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.index.query.QueryBuilder; @@ -130,6 +131,6 @@ public String getType() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/AvgBucketPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/AvgBucketPipelineAggregationBuilder.java index ad34437e8ed38..4118f2b263bf9 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/AvgBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/AvgBucketPipelineAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -63,6 +64,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptPipelineAggregationBuilder.java index 9cdf3af66cee8..4993c8ec25d83 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptPipelineAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.Maps; @@ -224,6 +225,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/CumulativeSumPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/CumulativeSumPipelineAggregationBuilder.java index 639358b023f18..c2816629b653f 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/CumulativeSumPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/CumulativeSumPipelineAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.DocValueFormat; @@ -129,6 +130,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_4_0; + return TransportVersions.V_7_4_0; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregationBuilder.java index 452d28ca8cc61..b781da3f81d58 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -100,6 +101,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MaxBucketPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MaxBucketPipelineAggregationBuilder.java index 7d1a35d051fdb..d3383f5a7b31a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MaxBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MaxBucketPipelineAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -63,6 +64,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MinBucketPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MinBucketPipelineAggregationBuilder.java index 566be88cb0177..2259104fbf0a6 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MinBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MinBucketPipelineAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -63,6 +64,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovAvgPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovAvgPipelineAggregationBuilder.java index 4de5c6099523f..c174dd5458685 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovAvgPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovAvgPipelineAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -76,6 +77,6 @@ public final String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregationBuilder.java index be0d0b6a6e2b8..a47f1255e0fe9 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.ParseField; @@ -119,7 +120,7 @@ protected XContentBuilder doXContentBody(XContentBuilder builder, Params params) @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } public static final PipelineAggregator.Parser PARSER = new BucketMetricsParser() { diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SerialDiffPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SerialDiffPipelineAggregationBuilder.java index 243271fba3612..1143594e98d16 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SerialDiffPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SerialDiffPipelineAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -249,6 +250,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/StatsBucketPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/StatsBucketPipelineAggregationBuilder.java index c46aceaf37333..9c72de0e3a43c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/StatsBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/StatsBucketPipelineAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -63,6 +64,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SumBucketPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SumBucketPipelineAggregationBuilder.java index 3c499b9acf516..94d6bb9af1c95 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SumBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SumBucketPipelineAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -63,6 +64,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceFieldConfig.java b/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceFieldConfig.java index 22d1cbe6864df..9f698528dcefb 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceFieldConfig.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceFieldConfig.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.aggregations.support; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -161,7 +161,7 @@ protected MultiValuesSourceFieldConfig( } public MultiValuesSourceFieldConfig(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { this.fieldName = in.readOptionalString(); } else { this.fieldName = in.readString(); @@ -169,19 +169,19 @@ public MultiValuesSourceFieldConfig(StreamInput in) throws IOException { this.missing = in.readGenericValue(); this.script = in.readOptionalWriteable(Script::new); this.timeZone = in.readOptionalZoneId(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_8_0)) { this.filter = in.readOptionalNamedWriteable(QueryBuilder.class); } else { this.filter = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_12_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_12_0)) { this.userValueTypeHint = in.readOptionalWriteable(ValueType::readFromStream); this.format = in.readOptionalString(); } else { this.userValueTypeHint = null; this.format = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { this.includeExclude = in.readOptionalWriteable(IncludeExclude::new); } else { this.includeExclude = null; @@ -222,7 +222,7 @@ public IncludeExclude getIncludeExclude() { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { out.writeOptionalString(fieldName); } else { out.writeString(fieldName); @@ -230,14 +230,14 @@ public void writeTo(StreamOutput out) throws IOException { out.writeGenericValue(missing); out.writeOptionalWriteable(script); out.writeOptionalZoneId(timeZone); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_8_0)) { out.writeOptionalNamedWriteable(filter); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_12_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_12_0)) { out.writeOptionalWriteable(userValueTypeHint); out.writeOptionalString(format); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeOptionalWriteable(includeExclude); } } diff --git a/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java index 434dae7115812..2a7ae6ac6aff8 100644 --- a/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.builder; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -216,7 +216,7 @@ public SearchSourceBuilder(StreamInput in) throws IOException { indexBoosts = in.readCollectionAsList(IndexBoost::new); minScore = in.readOptionalFloat(); postQueryBuilder = in.readOptionalNamedWriteable(QueryBuilder.class); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_013)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_013)) { subSearchSourceBuilders = in.readCollectionAsList(SubSearchSourceBuilder::new); } else { QueryBuilder queryBuilder = in.readOptionalNamedWriteable(QueryBuilder.class); @@ -253,24 +253,24 @@ public SearchSourceBuilder(StreamInput in) throws IOException { sliceBuilder = in.readOptionalWriteable(SliceBuilder::new); collapse = in.readOptionalWriteable(CollapseBuilder::new); trackTotalHitsUpTo = in.readOptionalInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { if (in.readBoolean()) { fetchFields = in.readCollectionAsList(FieldAndFormat::new); } pointInTimeBuilder = in.readOptionalWriteable(PointInTimeBuilder::new); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { runtimeMappings = in.readMap(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { - if (in.getTransportVersion().before(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_7_0)) { KnnSearchBuilder searchBuilder = in.readOptionalWriteable(KnnSearchBuilder::new); knnSearch = searchBuilder != null ? List.of(searchBuilder) : List.of(); } else { knnSearch = in.readCollectionAsList(KnnSearchBuilder::new); } } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { rankBuilder = in.readOptionalNamedWriteable(RankBuilder.class); } } @@ -290,9 +290,9 @@ public void writeTo(StreamOutput out) throws IOException { out.writeCollection(indexBoosts); out.writeOptionalFloat(minScore); out.writeOptionalNamedWriteable(postQueryBuilder); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_013)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_013)) { out.writeCollection(subSearchSourceBuilders); - } else if (out.getTransportVersion().before(TransportVersion.V_8_4_0) && subSearchSourceBuilders.size() >= 2) { + } else if (out.getTransportVersion().before(TransportVersions.V_8_4_0) && subSearchSourceBuilders.size() >= 2) { throw new IllegalArgumentException("cannot serialize [sub_searches] to version [" + out.getTransportVersion() + "]"); } else { out.writeOptionalNamedWriteable(query()); @@ -330,14 +330,14 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(sliceBuilder); out.writeOptionalWriteable(collapse); out.writeOptionalInt(trackTotalHitsUpTo); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeBoolean(fetchFields != null); if (fetchFields != null) { out.writeCollection(fetchFields); } out.writeOptionalWriteable(pointInTimeBuilder); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { out.writeGenericMap(runtimeMappings); } else { if (false == runtimeMappings.isEmpty()) { @@ -346,8 +346,8 @@ public void writeTo(StreamOutput out) throws IOException { ); } } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { - if (out.getTransportVersion().before(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_7_0)) { if (knnSearch.size() > 1) { throw new IllegalArgumentException( "Versions before 8070099 don't support multiple [knn] search clauses and search was sent to [" @@ -360,7 +360,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeCollection(knnSearch); } } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeOptionalNamedWriteable(rankBuilder); } else if (rankBuilder != null) { throw new IllegalArgumentException("cannot serialize [rank] to version [" + out.getTransportVersion() + "]"); diff --git a/server/src/main/java/org/elasticsearch/search/dfs/DfsSearchResult.java b/server/src/main/java/org/elasticsearch/search/dfs/DfsSearchResult.java index be73c33eba441..1a7b7b616021f 100644 --- a/server/src/main/java/org/elasticsearch/search/dfs/DfsSearchResult.java +++ b/server/src/main/java/org/elasticsearch/search/dfs/DfsSearchResult.java @@ -12,7 +12,7 @@ import org.apache.lucene.search.CollectionStatistics; import org.apache.lucene.search.TermStatistics; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.SearchPhaseResult; @@ -53,18 +53,18 @@ public DfsSearchResult(StreamInput in) throws IOException { fieldStatistics = readFieldStats(in); maxDoc = in.readVInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { setShardSearchRequest(in.readOptionalWriteable(ShardSearchRequest::new)); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { knnResults = in.readOptionalCollectionAsList(DfsKnnResults::new); } else { DfsKnnResults results = in.readOptionalWriteable(DfsKnnResults::new); knnResults = results != null ? List.of(results) : List.of(); } } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { searchProfileDfsPhaseResult = in.readOptionalWriteable(SearchProfileDfsPhaseResult::new); } } @@ -135,11 +135,11 @@ public void writeTo(StreamOutput out) throws IOException { writeTermStats(out, termStatistics); writeFieldStats(out, fieldStatistics); out.writeVInt(maxDoc); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeOptionalWriteable(getShardSearchRequest()); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeOptionalCollection(knnResults); } else { if (knnResults != null && knnResults.size() > 1) { @@ -152,7 +152,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(knnResults == null || knnResults.isEmpty() ? null : knnResults.get(0)); } } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { out.writeOptionalWriteable(searchProfileDfsPhaseResult); } } diff --git a/server/src/main/java/org/elasticsearch/search/fetch/FetchSearchResult.java b/server/src/main/java/org/elasticsearch/search/fetch/FetchSearchResult.java index f5bef5ea5f2a4..c25c3575a8c4b 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/FetchSearchResult.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/FetchSearchResult.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.fetch; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.SearchHit; @@ -39,7 +39,7 @@ public FetchSearchResult(StreamInput in) throws IOException { super(in); contextId = new ShardSearchContextId(in); hits = new SearchHits(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { profileResult = in.readOptionalWriteable(ProfileResult::new); } else { profileResult = null; @@ -50,7 +50,7 @@ public FetchSearchResult(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { contextId.writeTo(out); hits.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { out.writeOptionalWriteable(profileResult); } } diff --git a/server/src/main/java/org/elasticsearch/search/fetch/ShardFetchSearchRequest.java b/server/src/main/java/org/elasticsearch/search/fetch/ShardFetchSearchRequest.java index 1cd6a5d712469..e6fc229e1e648 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/ShardFetchSearchRequest.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/ShardFetchSearchRequest.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.fetch; import org.apache.lucene.search.ScoreDoc; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.action.support.IndicesOptions; @@ -53,7 +53,7 @@ public ShardFetchSearchRequest( public ShardFetchSearchRequest(StreamInput in) throws IOException { super(in); originalIndices = OriginalIndices.readOriginalIndices(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { shardSearchRequest = in.readOptionalWriteable(ShardSearchRequest::new); rescoreDocIds = new RescoreDocIds(in); aggregatedDfs = in.readOptionalWriteable(AggregatedDfs::new); @@ -68,7 +68,7 @@ public ShardFetchSearchRequest(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); OriginalIndices.writeOriginalIndices(originalIndices, out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeOptionalWriteable(shardSearchRequest); rescoreDocIds.writeTo(out); out.writeOptionalWriteable(aggregatedDfs); diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FieldAndFormat.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FieldAndFormat.java index 3fb9d8a1930c1..82b16a9aad03a 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FieldAndFormat.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FieldAndFormat.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.fetch.subphase; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -133,7 +133,7 @@ public FieldAndFormat(String field, @Nullable String format, @Nullable Boolean i public FieldAndFormat(StreamInput in) throws IOException { this.field = in.readString(); format = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { this.includeUnmapped = in.readOptionalBoolean(); } else { this.includeUnmapped = null; @@ -144,7 +144,7 @@ public FieldAndFormat(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { out.writeString(field); out.writeOptionalString(format); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { out.writeOptionalBoolean(this.includeUnmapped); } } diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java index b872197163c65..3ce5290b12100 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java @@ -10,7 +10,7 @@ import org.apache.lucene.search.highlight.SimpleFragmenter; import org.apache.lucene.search.highlight.SimpleSpanFragmenter; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -143,7 +143,7 @@ protected AbstractHighlighterBuilder(StreamInput in) throws IOException { } order(in.readOptionalWriteable(Order::readFromStream)); highlightFilter(in.readOptionalBoolean()); - if (in.getTransportVersion().before(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_8_0)) { in.readOptionalBoolean(); // force_source, now deprecated } boundaryScannerType(in.readOptionalWriteable(BoundaryScannerType::readFromStream)); @@ -160,7 +160,7 @@ protected AbstractHighlighterBuilder(StreamInput in) throws IOException { options(in.readMap()); } requireFieldMatch(in.readOptionalBoolean()); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_12_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_12_0)) { maxAnalyzedOffset(in.readOptionalInt()); } } @@ -183,7 +183,7 @@ public final void writeTo(StreamOutput out) throws IOException { } out.writeOptionalWriteable(order); out.writeOptionalBoolean(highlightFilter); - if (out.getTransportVersion().before(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_8_0)) { out.writeOptionalBoolean(false); } out.writeOptionalWriteable(boundaryScannerType); @@ -206,7 +206,7 @@ public final void writeTo(StreamOutput out) throws IOException { out.writeGenericMap(options); } out.writeOptionalBoolean(requireFieldMatch); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_12_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_12_0)) { out.writeOptionalInt(maxAnalyzedOffset); } doWriteTo(out); diff --git a/server/src/main/java/org/elasticsearch/search/internal/ShardSearchContextId.java b/server/src/main/java/org/elasticsearch/search/internal/ShardSearchContextId.java index 29dccd06605f5..d4888e79acae2 100644 --- a/server/src/main/java/org/elasticsearch/search/internal/ShardSearchContextId.java +++ b/server/src/main/java/org/elasticsearch/search/internal/ShardSearchContextId.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.internal; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -34,12 +34,12 @@ public ShardSearchContextId(String sessionId, long id, String searcherId) { public ShardSearchContextId(StreamInput in) throws IOException { this.id = in.readLong(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { this.sessionId = in.readString(); } else { this.sessionId = ""; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_12_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_12_0)) { this.searcherId = in.readOptionalString(); } else { this.searcherId = null; @@ -49,10 +49,10 @@ public ShardSearchContextId(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { out.writeLong(id); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { out.writeString(sessionId); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_12_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_12_0)) { out.writeOptionalString(searcherId); } } diff --git a/server/src/main/java/org/elasticsearch/search/internal/ShardSearchRequest.java b/server/src/main/java/org/elasticsearch/search/internal/ShardSearchRequest.java index 3c75c1e9ffebb..c8af58cd10857 100644 --- a/server/src/main/java/org/elasticsearch/search/internal/ShardSearchRequest.java +++ b/server/src/main/java/org/elasticsearch/search/internal/ShardSearchRequest.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.internal; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.action.search.SearchRequest; @@ -273,11 +274,11 @@ public ShardSearchRequest(StreamInput in) throws IOException { super(in); shardId = new ShardId(in); searchType = SearchType.fromId(in.readByte()); - shardRequestIndex = in.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0) ? in.readVInt() : -1; + shardRequestIndex = in.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0) ? in.readVInt() : -1; numberOfShards = in.readVInt(); scroll = in.readOptionalWriteable(Scroll::new); source = in.readOptionalWriteable(SearchSourceBuilder::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0) && in.getTransportVersion().before(TransportVersion.V_8_500_013)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0) && in.getTransportVersion().before(TransportVersions.V_8_500_013)) { // to deserialize between the 8.8 and 8.500.013 version we need to translate // the rank queries into sub searches if we are ranking; if there are no rank queries // we deserialize the empty list and do nothing @@ -300,7 +301,7 @@ public ShardSearchRequest(StreamInput in) throws IOException { source.subSearches(subSearchSourceBuilders); } } - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types no longer relevant so ignore String[] types = in.readStringArray(); if (types.length > 0) { @@ -315,11 +316,11 @@ public ShardSearchRequest(StreamInput in) throws IOException { requestCache = in.readOptionalBoolean(); clusterAlias = in.readOptionalString(); allowPartialSearchResults = in.readBoolean(); - if (in.getTransportVersion().before(TransportVersion.V_7_11_0)) { + if (in.getTransportVersion().before(TransportVersions.V_7_11_0)) { in.readStringArray(); in.readOptionalString(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { canReturnNullResponseIfMatchNoDocs = in.readBoolean(); bottomSortValues = in.readOptionalWriteable(SearchSortValuesAndFormats::new); readerId = in.readOptionalWriteable(ShardSearchContextId::new); @@ -332,14 +333,14 @@ public ShardSearchRequest(StreamInput in) throws IOException { } assert keepAlive == null || readerId != null : "readerId: " + readerId + " keepAlive: " + keepAlive; channelVersion = TransportVersion.min(TransportVersion.readVersion(in), in.getTransportVersion()); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { waitForCheckpoint = in.readLong(); waitForCheckpointsTimeout = in.readTimeValue(); } else { waitForCheckpoint = SequenceNumbers.UNASSIGNED_SEQ_NO; waitForCheckpointsTimeout = SearchService.NO_TIMEOUT; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { forceSyntheticSource = in.readBoolean(); } else { /* @@ -363,15 +364,15 @@ protected final void innerWriteTo(StreamOutput out, boolean asKey) throws IOExce shardId.writeTo(out); out.writeByte(searchType.id()); if (asKey == false) { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { out.writeVInt(shardRequestIndex); } out.writeVInt(numberOfShards); } out.writeOptionalWriteable(scroll); out.writeOptionalWriteable(source); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0) - && out.getTransportVersion().before(TransportVersion.V_8_500_013)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0) + && out.getTransportVersion().before(TransportVersions.V_8_500_013)) { // to serialize between the 8.8 and 8.500.013 version we need to translate // the sub searches into rank queries if we are ranking, otherwise, we // ignore this because linear combination will have multiple sub searches in @@ -384,7 +385,7 @@ protected final void innerWriteTo(StreamOutput out, boolean asKey) throws IOExce } out.writeNamedWriteableCollection(rankQueryBuilders); } - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { // types not supported so send an empty array to previous versions out.writeStringArray(Strings.EMPTY_ARRAY); } @@ -396,18 +397,18 @@ protected final void innerWriteTo(StreamOutput out, boolean asKey) throws IOExce out.writeOptionalBoolean(requestCache); out.writeOptionalString(clusterAlias); out.writeBoolean(allowPartialSearchResults); - if (asKey == false && out.getTransportVersion().before(TransportVersion.V_7_11_0)) { + if (asKey == false && out.getTransportVersion().before(TransportVersions.V_7_11_0)) { out.writeStringArray(Strings.EMPTY_ARRAY); out.writeOptionalString(null); } - if (asKey == false && out.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (asKey == false && out.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { out.writeBoolean(canReturnNullResponseIfMatchNoDocs); out.writeOptionalWriteable(bottomSortValues); out.writeOptionalWriteable(readerId); out.writeOptionalTimeValue(keepAlive); } TransportVersion.writeVersion(channelVersion, out); - TransportVersion waitForCheckpointsVersion = TransportVersion.V_7_16_0; + TransportVersion waitForCheckpointsVersion = TransportVersions.V_7_16_0; if (out.getTransportVersion().onOrAfter(waitForCheckpointsVersion)) { out.writeLong(waitForCheckpoint); out.writeTimeValue(waitForCheckpointsTimeout); @@ -421,7 +422,7 @@ protected final void innerWriteTo(StreamOutput out, boolean asKey) throws IOExce + "] or greater." ); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeBoolean(forceSyntheticSource); } else { if (forceSyntheticSource) { diff --git a/server/src/main/java/org/elasticsearch/search/profile/ProfileResult.java b/server/src/main/java/org/elasticsearch/search/profile/ProfileResult.java index 66331d408c90d..d2cd46bda315e 100644 --- a/server/src/main/java/org/elasticsearch/search/profile/ProfileResult.java +++ b/server/src/main/java/org/elasticsearch/search/profile/ProfileResult.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.profile; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -75,7 +75,7 @@ public ProfileResult(StreamInput in) throws IOException { this.description = in.readString(); this.nodeTime = in.readLong(); breakdown = in.readMap(StreamInput::readLong); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_9_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_9_0)) { debug = in.readMap(StreamInput::readGenericValue); } else { debug = Map.of(); @@ -89,7 +89,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(description); out.writeLong(nodeTime); // not Vlong because can be negative out.writeMap(breakdown, StreamOutput::writeLong); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_9_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_9_0)) { out.writeMap(debug, StreamOutput::writeGenericValue); } out.writeCollection(children); diff --git a/server/src/main/java/org/elasticsearch/search/profile/SearchProfileDfsPhaseResult.java b/server/src/main/java/org/elasticsearch/search/profile/SearchProfileDfsPhaseResult.java index 3c7dfa3fbc438..4e301d5a3300d 100644 --- a/server/src/main/java/org/elasticsearch/search/profile/SearchProfileDfsPhaseResult.java +++ b/server/src/main/java/org/elasticsearch/search/profile/SearchProfileDfsPhaseResult.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.profile; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -45,7 +45,7 @@ public SearchProfileDfsPhaseResult( public SearchProfileDfsPhaseResult(StreamInput in) throws IOException { dfsShardResult = in.readOptionalWriteable(ProfileResult::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { queryProfileShardResult = in.readOptionalCollectionAsList(QueryProfileShardResult::new); } else { QueryProfileShardResult singleResult = in.readOptionalWriteable(QueryProfileShardResult::new); @@ -56,7 +56,7 @@ public SearchProfileDfsPhaseResult(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(dfsShardResult); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeOptionalCollection(queryProfileShardResult); } else { out.writeOptionalWriteable(combineQueryProfileShardResults()); diff --git a/server/src/main/java/org/elasticsearch/search/profile/SearchProfileQueryPhaseResult.java b/server/src/main/java/org/elasticsearch/search/profile/SearchProfileQueryPhaseResult.java index 04855716fe30a..6000147abbade 100644 --- a/server/src/main/java/org/elasticsearch/search/profile/SearchProfileQueryPhaseResult.java +++ b/server/src/main/java/org/elasticsearch/search/profile/SearchProfileQueryPhaseResult.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.profile; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -42,7 +42,7 @@ public SearchProfileQueryPhaseResult( } public SearchProfileQueryPhaseResult(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { searchProfileDfsPhaseResult = in.readOptionalWriteable(SearchProfileDfsPhaseResult::new); } int profileSize = in.readVInt(); @@ -57,7 +57,7 @@ public SearchProfileQueryPhaseResult(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { out.writeOptionalWriteable(searchProfileDfsPhaseResult); } out.writeVInt(queryProfileResults.size()); diff --git a/server/src/main/java/org/elasticsearch/search/profile/SearchProfileResults.java b/server/src/main/java/org/elasticsearch/search/profile/SearchProfileResults.java index c1238eb04b5a0..d6975811091e3 100644 --- a/server/src/main/java/org/elasticsearch/search/profile/SearchProfileResults.java +++ b/server/src/main/java/org/elasticsearch/search/profile/SearchProfileResults.java @@ -10,7 +10,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -56,7 +56,7 @@ public SearchProfileResults(Map shardResults) } public SearchProfileResults(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { shardResults = in.readMap(SearchProfileShardResult::new); } else { // Before 8.0.0 we only send the query phase result @@ -66,7 +66,7 @@ public SearchProfileResults(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { out.writeMap(shardResults, StreamOutput::writeWriteable); } else { // Before 8.0.0 we only send the query phase diff --git a/server/src/main/java/org/elasticsearch/search/query/QuerySearchRequest.java b/server/src/main/java/org/elasticsearch/search/query/QuerySearchRequest.java index 36392a92f3b4b..3a1a9fcbb72a5 100644 --- a/server/src/main/java/org/elasticsearch/search/query/QuerySearchRequest.java +++ b/server/src/main/java/org/elasticsearch/search/query/QuerySearchRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.query; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.action.search.SearchShardTask; @@ -51,7 +51,7 @@ public QuerySearchRequest(StreamInput in) throws IOException { contextId = new ShardSearchContextId(in); dfs = new AggregatedDfs(in); originalIndices = OriginalIndices.readOriginalIndices(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { this.shardSearchRequest = in.readOptionalWriteable(ShardSearchRequest::new); } else { this.shardSearchRequest = null; @@ -64,7 +64,7 @@ public void writeTo(StreamOutput out) throws IOException { contextId.writeTo(out); dfs.writeTo(out); OriginalIndices.writeOriginalIndices(originalIndices, out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeOptionalWriteable(shardSearchRequest); } } diff --git a/server/src/main/java/org/elasticsearch/search/query/QuerySearchResult.java b/server/src/main/java/org/elasticsearch/search/query/QuerySearchResult.java index 02bc9c69979f4..edebf602af188 100644 --- a/server/src/main/java/org/elasticsearch/search/query/QuerySearchResult.java +++ b/server/src/main/java/org/elasticsearch/search/query/QuerySearchResult.java @@ -10,7 +10,7 @@ import org.apache.lucene.search.FieldDoc; import org.apache.lucene.search.TotalHits; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.DelayableWriteable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -86,7 +86,7 @@ public QuerySearchResult(StreamInput in) throws IOException { */ public QuerySearchResult(StreamInput in, boolean delayedAggregations) throws IOException { super(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { isNull = in.readBoolean(); } else { isNull = false; @@ -402,11 +402,11 @@ private void readFromWithId(ShardSearchContextId id, StreamInput in, boolean del hasProfileResults = profileShardResults != null; serviceTimeEWMA = in.readZLong(); nodeQueueSize = in.readInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { setShardSearchRequest(in.readOptionalWriteable(ShardSearchRequest::new)); setRescoreDocIds(new RescoreDocIds(in)); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { rankShardResult = in.readOptionalNamedWriteable(RankShardResult.class); } success = true; @@ -424,7 +424,7 @@ public void writeTo(StreamOutput out) throws IOException { if (aggregations != null && aggregations.isSerialized()) { throw new IllegalStateException("cannot send serialized version since it will leak"); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { out.writeBoolean(isNull); } if (isNull == false) { @@ -457,11 +457,11 @@ public void writeToNoId(StreamOutput out) throws IOException { out.writeOptionalWriteable(profileShardResults); out.writeZLong(serviceTimeEWMA); out.writeInt(nodeQueueSize); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeOptionalWriteable(getShardSearchRequest()); getRescoreDocIds().writeTo(out); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeOptionalNamedWriteable(rankShardResult); } else if (rankShardResult != null) { throw new IllegalArgumentException("cannot serialize [rank] to version [" + out.getTransportVersion() + "]"); diff --git a/server/src/main/java/org/elasticsearch/search/rescore/QueryRescorerBuilder.java b/server/src/main/java/org/elasticsearch/search/rescore/QueryRescorerBuilder.java index c292b42097ed9..24ba423315687 100644 --- a/server/src/main/java/org/elasticsearch/search/rescore/QueryRescorerBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/rescore/QueryRescorerBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.rescore; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -94,7 +95,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } /** diff --git a/server/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java b/server/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java index fdd7aeb8f3b32..dc24faad10857 100644 --- a/server/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java @@ -11,7 +11,7 @@ import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -90,7 +90,7 @@ public SliceBuilder(String field, int id, int max) { } public SliceBuilder(StreamInput in) throws IOException { - if (in.getTransportVersion().before(TransportVersion.V_7_15_0)) { + if (in.getTransportVersion().before(TransportVersions.V_7_15_0)) { field = in.readString(); } else { field = in.readOptionalString(); @@ -103,7 +103,7 @@ public SliceBuilder(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { // Before 7.15.0 we always defaulted to _id when the field wasn't provided - if (out.getTransportVersion().before(TransportVersion.V_7_15_0)) { + if (out.getTransportVersion().before(TransportVersions.V_7_15_0)) { String sliceField = field != null ? field : IdFieldMapper.NAME; out.writeString(sliceField); } else { diff --git a/server/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java b/server/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java index 40a2f2ab5d9e3..9a3999e4ce6e7 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java @@ -16,6 +16,7 @@ import org.apache.lucene.search.SortField; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -132,7 +133,7 @@ public FieldSortBuilder(String fieldName) { */ public FieldSortBuilder(StreamInput in) throws IOException { fieldName = in.readString(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { if (in.readOptionalNamedWriteable(QueryBuilder.class) != null || in.readOptionalString() != null) { throw new IOException( "the [sort] options [nested_path] and [nested_filter] are removed in 8.x, " + "please use [nested] instead" @@ -144,10 +145,10 @@ public FieldSortBuilder(StreamInput in) throws IOException { sortMode = in.readOptionalWriteable(SortMode::readFromStream); unmappedType = in.readOptionalString(); nestedSort = in.readOptionalWriteable(NestedSortBuilder::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { numericType = in.readOptionalString(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { format = in.readOptionalString(); } } @@ -155,7 +156,7 @@ public FieldSortBuilder(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(fieldName); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeOptionalNamedWriteable(null); out.writeOptionalString(null); } @@ -164,10 +165,10 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(sortMode); out.writeOptionalString(unmappedType); out.writeOptionalWriteable(nestedSort); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { out.writeOptionalString(numericType); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { out.writeOptionalString(format); } else { if (format != null) { @@ -711,7 +712,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } /** diff --git a/server/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java b/server/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java index 7f82db82a3cc7..2dceca2e9ad65 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java @@ -19,6 +19,7 @@ import org.apache.lucene.util.BitSet; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.geo.GeoDistance; import org.elasticsearch.common.geo.GeoPoint; @@ -158,7 +159,7 @@ public GeoDistanceSortBuilder(StreamInput in) throws IOException { unit = DistanceUnit.readFromStream(in); order = SortOrder.readFromStream(in); sortMode = in.readOptionalWriteable(SortMode::readFromStream); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { if (in.readOptionalNamedWriteable(QueryBuilder.class) != null || in.readOptionalString() != null) { throw new IOException( "the [sort] options [nested_path] and [nested_filter] are removed in 8.x, " + "please use [nested] instead" @@ -179,7 +180,7 @@ public void writeTo(StreamOutput out) throws IOException { unit.writeTo(out); order.writeTo(out); out.writeOptionalWriteable(sortMode); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeOptionalNamedWriteable(null); out.writeOptionalString(null); } @@ -353,7 +354,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/main/java/org/elasticsearch/search/sort/ScoreSortBuilder.java b/server/src/main/java/org/elasticsearch/search/sort/ScoreSortBuilder.java index 77c5ac3516e1c..ea072c1bc43ca 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/ScoreSortBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/sort/ScoreSortBuilder.java @@ -12,6 +12,7 @@ import org.apache.lucene.search.Scorable; import org.apache.lucene.search.SortField; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.BigArrays; @@ -160,7 +161,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java b/server/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java index 0dfbd8bae5190..e6d1eec98ff94 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java @@ -15,6 +15,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -109,7 +110,7 @@ public ScriptSortBuilder(StreamInput in) throws IOException { type = ScriptSortType.readFromStream(in); order = SortOrder.readFromStream(in); sortMode = in.readOptionalWriteable(SortMode::readFromStream); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { if (in.readOptionalNamedWriteable(QueryBuilder.class) != null || in.readOptionalString() != null) { throw new IOException( "the [sort] options [nested_path] and [nested_filter] are removed in 8.x, " + "please use [nested] instead" @@ -125,7 +126,7 @@ public void writeTo(StreamOutput out) throws IOException { type.writeTo(out); order.writeTo(out); out.writeOptionalWriteable(sortMode); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeOptionalString(null); out.writeOptionalNamedWriteable(null); } @@ -451,7 +452,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } public enum ScriptSortType implements Writeable { diff --git a/server/src/main/java/org/elasticsearch/search/sort/SortValue.java b/server/src/main/java/org/elasticsearch/search/sort/SortValue.java index 6c3ac59da6d45..067439931a85b 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/SortValue.java +++ b/server/src/main/java/org/elasticsearch/search/sort/SortValue.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.sort; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamInput; @@ -299,7 +299,7 @@ private BytesSortValue(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().before(TransportVersion.V_7_11_0)) { + if (out.getTransportVersion().before(TransportVersions.V_7_11_0)) { throw new IllegalArgumentException( "transport versions before [7110099] can't handle non-numeric sort values, attempted to send to [" + out.getTransportVersion() diff --git a/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java b/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java index 6d22de25279cf..86e18b3e5a406 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java @@ -9,6 +9,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -328,7 +329,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/main/java/org/elasticsearch/search/suggest/phrase/Laplace.java b/server/src/main/java/org/elasticsearch/search/suggest/phrase/Laplace.java index 61f81f77add06..fe85dd70b7337 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/phrase/Laplace.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/phrase/Laplace.java @@ -12,6 +12,7 @@ import org.apache.lucene.index.Terms; import org.apache.lucene.util.BytesRef; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.suggest.phrase.WordScorer.WordScorerFactory; @@ -121,6 +122,6 @@ public WordScorerFactory buildWordScorerFactory() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/suggest/phrase/LinearInterpolation.java b/server/src/main/java/org/elasticsearch/search/suggest/phrase/LinearInterpolation.java index 27f111fb6d827..9dff9561b9934 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/phrase/LinearInterpolation.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/phrase/LinearInterpolation.java @@ -12,6 +12,7 @@ import org.apache.lucene.index.Terms; import org.apache.lucene.util.BytesRef; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -178,6 +179,6 @@ public WordScorerFactory buildWordScorerFactory() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestionBuilder.java b/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestionBuilder.java index d336b5ae95895..23c6d9db0ce2f 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestionBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestionBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.analysis.Analyzer; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -699,7 +700,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/main/java/org/elasticsearch/search/suggest/phrase/StupidBackoff.java b/server/src/main/java/org/elasticsearch/search/suggest/phrase/StupidBackoff.java index 0c18cc67f759e..fe2c2b660eb72 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/phrase/StupidBackoff.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/phrase/StupidBackoff.java @@ -12,6 +12,7 @@ import org.apache.lucene.index.Terms; import org.apache.lucene.util.BytesRef; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.suggest.phrase.WordScorer.WordScorerFactory; @@ -124,6 +125,6 @@ public WordScorerFactory buildWordScorerFactory() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/main/java/org/elasticsearch/search/suggest/term/TermSuggestionBuilder.java b/server/src/main/java/org/elasticsearch/search/suggest/term/TermSuggestionBuilder.java index e5c0915531646..8e28c65b8ca64 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/term/TermSuggestionBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/term/TermSuggestionBuilder.java @@ -16,6 +16,7 @@ import org.apache.lucene.search.spell.StringDistance; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -459,7 +460,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/main/java/org/elasticsearch/search/vectors/KnnScoreDocQueryBuilder.java b/server/src/main/java/org/elasticsearch/search/vectors/KnnScoreDocQueryBuilder.java index 3825302fbc71e..4ecb33a907f1e 100644 --- a/server/src/main/java/org/elasticsearch/search/vectors/KnnScoreDocQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/vectors/KnnScoreDocQueryBuilder.java @@ -12,6 +12,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreDoc; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.Lucene; @@ -148,6 +149,6 @@ protected int doHashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_4_0; + return TransportVersions.V_8_4_0; } } diff --git a/server/src/main/java/org/elasticsearch/search/vectors/KnnSearchBuilder.java b/server/src/main/java/org/elasticsearch/search/vectors/KnnSearchBuilder.java index 940bbcf646b5d..5ebea733f0e5e 100644 --- a/server/src/main/java/org/elasticsearch/search/vectors/KnnSearchBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/vectors/KnnSearchBuilder.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.vectors; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -208,13 +208,13 @@ public KnnSearchBuilder(StreamInput in) throws IOException { this.queryVector = in.readFloatArray(); this.filterQueries = in.readNamedWriteableCollectionAsList(QueryBuilder.class); this.boost = in.readFloat(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { this.queryVectorBuilder = in.readOptionalNamedWriteable(QueryVectorBuilder.class); } else { this.queryVectorBuilder = null; } this.querySupplier = null; - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { this.similarity = in.readOptionalFloat(); } else { this.similarity = null; @@ -377,7 +377,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeFloatArray(queryVector); out.writeNamedWriteableCollection(filterQueries); out.writeFloat(boost); - if (out.getTransportVersion().before(TransportVersion.V_8_7_0) && queryVectorBuilder != null) { + if (out.getTransportVersion().before(TransportVersions.V_8_7_0) && queryVectorBuilder != null) { throw new IllegalArgumentException( format( "cannot serialize [%s] to older node of version [%s]", @@ -386,10 +386,10 @@ public void writeTo(StreamOutput out) throws IOException { ) ); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeOptionalNamedWriteable(queryVectorBuilder); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeOptionalFloat(similarity); } } diff --git a/server/src/main/java/org/elasticsearch/search/vectors/KnnVectorQueryBuilder.java b/server/src/main/java/org/elasticsearch/search/vectors/KnnVectorQueryBuilder.java index 33cc679757bcc..c4b1f3046e89d 100644 --- a/server/src/main/java/org/elasticsearch/search/vectors/KnnVectorQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/vectors/KnnVectorQueryBuilder.java @@ -12,6 +12,7 @@ import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -80,19 +81,19 @@ public KnnVectorQueryBuilder(StreamInput in) throws IOException { super(in); this.fieldName = in.readString(); this.numCands = in.readVInt(); - if (in.getTransportVersion().before(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_7_0)) { this.queryVector = in.readFloatArray(); this.byteQueryVector = null; } else { this.queryVector = in.readBoolean() ? in.readFloatArray() : null; this.byteQueryVector = in.readBoolean() ? in.readByteArray() : null; } - if (in.getTransportVersion().before(TransportVersion.V_8_2_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_2_0)) { this.filterQueries = new ArrayList<>(); } else { this.filterQueries = readQueries(in); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { this.vectorSimilarity = in.readOptionalFloat(); } else { this.vectorSimilarity = null; @@ -142,7 +143,7 @@ public KnnVectorQueryBuilder addFilterQueries(List filterQueries) protected void doWriteTo(StreamOutput out) throws IOException { out.writeString(fieldName); out.writeVInt(numCands); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { boolean queryVectorNotNull = queryVector != null; out.writeBoolean(queryVectorNotNull); if (queryVectorNotNull) { @@ -165,10 +166,10 @@ protected void doWriteTo(StreamOutput out) throws IOException { } out.writeFloatArray(f); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { writeQueries(out, filterQueries); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeOptionalFloat(vectorSimilarity); } } @@ -270,6 +271,6 @@ protected boolean doEquals(KnnVectorQueryBuilder other) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } } diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java index e4dd9e6310c88..f119462e9428d 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java @@ -13,6 +13,7 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionResponse; @@ -134,7 +135,7 @@ public class SnapshotsService extends AbstractLifecycleComponent implements Clus public static final IndexVersion INDEX_GEN_IN_REPO_DATA_VERSION = IndexVersion.V_7_9_0; public static final IndexVersion UUIDS_IN_REPO_DATA_VERSION = IndexVersion.V_7_12_0; - public static final TransportVersion UUIDS_IN_REPO_DATA_TRANSPORT_VERSION = TransportVersion.V_7_12_0; + public static final TransportVersion UUIDS_IN_REPO_DATA_TRANSPORT_VERSION = TransportVersions.V_7_12_0; public static final IndexVersion FILE_INFO_WRITER_UUIDS_IN_SHARD_DATA_VERSION = IndexVersion.V_7_16_0; diff --git a/server/src/main/java/org/elasticsearch/tasks/TaskCancellationService.java b/server/src/main/java/org/elasticsearch/tasks/TaskCancellationService.java index 3872a2f017a88..39a76f3508daa 100644 --- a/server/src/main/java/org/elasticsearch/tasks/TaskCancellationService.java +++ b/server/src/main/java/org/elasticsearch/tasks/TaskCancellationService.java @@ -13,6 +13,7 @@ import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ResultDeduplicator; import org.elasticsearch.action.support.ChannelActionListener; @@ -47,7 +48,7 @@ public class TaskCancellationService { public static final String BAN_PARENT_ACTION_NAME = "internal:admin/tasks/ban"; public static final String CANCEL_CHILD_ACTION_NAME = "internal:admin/tasks/cancel_child"; - public static final TransportVersion VERSION_SUPPORTING_CANCEL_CHILD_ACTION = TransportVersion.V_8_8_0; + public static final TransportVersion VERSION_SUPPORTING_CANCEL_CHILD_ACTION = TransportVersions.V_8_8_0; private static final Logger logger = LogManager.getLogger(TaskCancellationService.class); private final TransportService transportService; private final TaskManager taskManager; @@ -317,7 +318,7 @@ private BanParentTaskRequest(StreamInput in) throws IOException { parentTaskId = TaskId.readFromStream(in); ban = in.readBoolean(); reason = ban ? in.readString() : null; - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_8_0)) { waitForCompletion = in.readBoolean(); } else { waitForCompletion = false; @@ -332,7 +333,7 @@ public void writeTo(StreamOutput out) throws IOException { if (ban) { out.writeString(reason); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_8_0)) { out.writeBoolean(waitForCompletion); } } diff --git a/server/src/main/java/org/elasticsearch/tasks/TaskInfo.java b/server/src/main/java/org/elasticsearch/tasks/TaskInfo.java index 9d76b12065a20..e0ef4feb0ae35 100644 --- a/server/src/main/java/org/elasticsearch/tasks/TaskInfo.java +++ b/server/src/main/java/org/elasticsearch/tasks/TaskInfo.java @@ -8,7 +8,7 @@ package org.elasticsearch.tasks; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; @@ -67,7 +67,7 @@ public static TaskInfo from(StreamInput in) throws IOException { return new TaskInfo( taskId, in.readString(), - in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_055) ? in.readString() : taskId.getNodeId(), + in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_055) ? in.readString() : taskId.getNodeId(), in.readString(), in.readOptionalString(), in.readOptionalNamedWriteable(Task.Status.class), @@ -84,7 +84,7 @@ public static TaskInfo from(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { taskId.writeTo(out); out.writeString(type); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_055)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_055)) { out.writeString(node); } out.writeString(action); diff --git a/server/src/main/java/org/elasticsearch/transport/ActionTransportException.java b/server/src/main/java/org/elasticsearch/transport/ActionTransportException.java index f04089ade2d92..bba4a2a6b86b7 100644 --- a/server/src/main/java/org/elasticsearch/transport/ActionTransportException.java +++ b/server/src/main/java/org/elasticsearch/transport/ActionTransportException.java @@ -8,7 +8,7 @@ package org.elasticsearch.transport; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.network.NetworkAddress; @@ -24,7 +24,7 @@ public class ActionTransportException extends TransportException { public ActionTransportException(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().before(TransportVersion.V_8_1_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_1_0)) { in.readOptionalWriteable(TransportAddress::new); in.readOptionalString(); } @@ -45,7 +45,7 @@ public ActionTransportException(String name, InetSocketAddress address, String a @Override protected void writeTo(StreamOutput out, Writer nestedExceptionsWriter) throws IOException { super.writeTo(out, nestedExceptionsWriter); - if (out.getTransportVersion().before(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_1_0)) { out.writeMissingWriteable(TransportAddress.class); out.writeMissingString(); // action } diff --git a/server/src/main/java/org/elasticsearch/transport/Compression.java b/server/src/main/java/org/elasticsearch/transport/Compression.java index a0290a8c92af6..6dc6115a3565e 100644 --- a/server/src/main/java/org/elasticsearch/transport/Compression.java +++ b/server/src/main/java/org/elasticsearch/transport/Compression.java @@ -13,6 +13,7 @@ import net.jpountz.lz4.LZ4FastDecompressor; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Booleans; import org.elasticsearch.lz4.ESLZ4Compressor; @@ -27,7 +28,7 @@ public enum Scheme { LZ4, DEFLATE; - static final TransportVersion LZ4_VERSION = TransportVersion.V_7_14_0; + static final TransportVersion LZ4_VERSION = TransportVersions.V_7_14_0; static final int HEADER_LENGTH = 4; private static final byte[] DEFLATE_HEADER = new byte[] { 'D', 'F', 'L', '\0' }; private static final byte[] LZ4_HEADER = new byte[] { 'L', 'Z', '4', '\0' }; diff --git a/server/src/main/java/org/elasticsearch/transport/ConnectTransportException.java b/server/src/main/java/org/elasticsearch/transport/ConnectTransportException.java index 1fa5fc61f07a4..ec7ef64e56ed2 100644 --- a/server/src/main/java/org/elasticsearch/transport/ConnectTransportException.java +++ b/server/src/main/java/org/elasticsearch/transport/ConnectTransportException.java @@ -8,7 +8,7 @@ package org.elasticsearch.transport; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -35,7 +35,7 @@ public ConnectTransportException(DiscoveryNode node, String msg, String action, public ConnectTransportException(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().before(TransportVersion.V_8_1_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_1_0)) { in.readOptionalWriteable(DiscoveryNode::new); } } @@ -43,7 +43,7 @@ public ConnectTransportException(StreamInput in) throws IOException { @Override protected void writeTo(StreamOutput out, Writer nestedExceptionsWriter) throws IOException { super.writeTo(out, nestedExceptionsWriter); - if (out.getTransportVersion().before(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_1_0)) { out.writeMissingWriteable(DiscoveryNode.class); } } diff --git a/server/src/main/java/org/elasticsearch/transport/Header.java b/server/src/main/java/org/elasticsearch/transport/Header.java index 5daec4ff29722..050d18e153bd8 100644 --- a/server/src/main/java/org/elasticsearch/transport/Header.java +++ b/server/src/main/java/org/elasticsearch/transport/Header.java @@ -9,6 +9,7 @@ package org.elasticsearch.transport; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.core.Tuple; @@ -94,7 +95,7 @@ void finishParsingHeader(StreamInput input) throws IOException { this.headers = ThreadContext.readHeadersFromStream(input); if (isRequest()) { - if (version.before(TransportVersion.V_8_0_0)) { + if (version.before(TransportVersions.V_8_0_0)) { // discard features input.readStringArray(); } diff --git a/server/src/main/java/org/elasticsearch/transport/InboundDecoder.java b/server/src/main/java/org/elasticsearch/transport/InboundDecoder.java index 9643a41a42301..056af07b13912 100644 --- a/server/src/main/java/org/elasticsearch/transport/InboundDecoder.java +++ b/server/src/main/java/org/elasticsearch/transport/InboundDecoder.java @@ -10,6 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.ReleasableBytesReference; import org.elasticsearch.common.io.stream.StreamInput; @@ -247,7 +248,7 @@ static void checkVersionCompatibility(TransportVersion remoteVersion) { "Received message from unsupported version: [" + remoteVersion + "] minimal compatible version is: [" - + TransportVersion.MINIMUM_COMPATIBLE + + TransportVersions.MINIMUM_COMPATIBLE + "]" ); } diff --git a/server/src/main/java/org/elasticsearch/transport/OutboundMessage.java b/server/src/main/java/org/elasticsearch/transport/OutboundMessage.java index 492aa82a8eab2..07fd2a1197c15 100644 --- a/server/src/main/java/org/elasticsearch/transport/OutboundMessage.java +++ b/server/src/main/java/org/elasticsearch/transport/OutboundMessage.java @@ -8,6 +8,7 @@ package org.elasticsearch.transport; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; @@ -128,7 +129,7 @@ static class Request extends OutboundMessage { @Override protected void writeVariableHeader(StreamOutput stream) throws IOException { super.writeVariableHeader(stream); - if (version.before(TransportVersion.V_8_0_0)) { + if (version.before(TransportVersions.V_8_0_0)) { // empty features array stream.writeStringArray(Strings.EMPTY_ARRAY); } diff --git a/server/src/main/java/org/elasticsearch/transport/ProxyConnectionStrategy.java b/server/src/main/java/org/elasticsearch/transport/ProxyConnectionStrategy.java index b1758715998d0..83a0860ba6324 100644 --- a/server/src/main/java/org/elasticsearch/transport/ProxyConnectionStrategy.java +++ b/server/src/main/java/org/elasticsearch/transport/ProxyConnectionStrategy.java @@ -8,7 +8,7 @@ package org.elasticsearch.transport; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.cluster.ClusterName; @@ -359,7 +359,7 @@ public ProxyModeInfo(String address, String serverName, int maxSocketConnections private ProxyModeInfo(StreamInput input) throws IOException { address = input.readString(); - if (input.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (input.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { serverName = input.readString(); } else { serverName = null; @@ -380,7 +380,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(address); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { out.writeString(serverName); } out.writeVInt(maxSocketConnections); diff --git a/server/src/main/java/org/elasticsearch/transport/RemoteClusterPortSettings.java b/server/src/main/java/org/elasticsearch/transport/RemoteClusterPortSettings.java index 3c69312f4da06..814b17bac95ef 100644 --- a/server/src/main/java/org/elasticsearch/transport/RemoteClusterPortSettings.java +++ b/server/src/main/java/org/elasticsearch/transport/RemoteClusterPortSettings.java @@ -9,6 +9,7 @@ package org.elasticsearch.transport; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; @@ -38,7 +39,7 @@ */ public class RemoteClusterPortSettings { - public static final TransportVersion TRANSPORT_VERSION_ADVANCED_REMOTE_CLUSTER_SECURITY = TransportVersion.V_8_500_059; + public static final TransportVersion TRANSPORT_VERSION_ADVANCED_REMOTE_CLUSTER_SECURITY = TransportVersions.V_8_500_059; public static final String REMOTE_CLUSTER_PROFILE = "_remote_cluster"; public static final String REMOTE_CLUSTER_PREFIX = "remote_cluster."; diff --git a/server/src/main/java/org/elasticsearch/transport/RemoteConnectionInfo.java b/server/src/main/java/org/elasticsearch/transport/RemoteConnectionInfo.java index 442dc52aeb322..8e0b17b50fbaf 100644 --- a/server/src/main/java/org/elasticsearch/transport/RemoteConnectionInfo.java +++ b/server/src/main/java/org/elasticsearch/transport/RemoteConnectionInfo.java @@ -8,7 +8,7 @@ package org.elasticsearch.transport; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -48,13 +48,13 @@ public RemoteConnectionInfo( } public RemoteConnectionInfo(StreamInput input) throws IOException { - if (input.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (input.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { RemoteConnectionStrategy.ConnectionStrategy mode = input.readEnum(RemoteConnectionStrategy.ConnectionStrategy.class); modeInfo = mode.getReader().read(input); initialConnectionTimeout = input.readTimeValue(); clusterAlias = input.readString(); skipUnavailable = input.readBoolean(); - if (input.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (input.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { hasClusterCredentials = input.readBoolean(); } else { hasClusterCredentials = false; @@ -89,7 +89,7 @@ public boolean hasClusterCredentials() { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { out.writeEnum(modeInfo.modeType()); modeInfo.writeTo(out); out.writeTimeValue(initialConnectionTimeout); @@ -109,7 +109,7 @@ public void writeTo(StreamOutput out) throws IOException { } out.writeString(clusterAlias); out.writeBoolean(skipUnavailable); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeBoolean(hasClusterCredentials); } } diff --git a/server/src/main/java/org/elasticsearch/transport/TcpHeader.java b/server/src/main/java/org/elasticsearch/transport/TcpHeader.java index b5020be7a9924..f50a6518a8001 100644 --- a/server/src/main/java/org/elasticsearch/transport/TcpHeader.java +++ b/server/src/main/java/org/elasticsearch/transport/TcpHeader.java @@ -9,13 +9,14 @@ package org.elasticsearch.transport; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamOutput; import java.io.IOException; public class TcpHeader { - public static final TransportVersion VERSION_WITH_HEADER_SIZE = TransportVersion.V_7_6_0; + public static final TransportVersion VERSION_WITH_HEADER_SIZE = TransportVersions.V_7_6_0; public static final int MARKER_BYTES_SIZE = 2; diff --git a/server/src/main/java/org/elasticsearch/transport/TransportHandshaker.java b/server/src/main/java/org/elasticsearch/transport/TransportHandshaker.java index 363c6535ec7a8..61b052c957ac1 100644 --- a/server/src/main/java/org/elasticsearch/transport/TransportHandshaker.java +++ b/server/src/main/java/org/elasticsearch/transport/TransportHandshaker.java @@ -9,6 +9,7 @@ package org.elasticsearch.transport; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.bytes.BytesReference; @@ -115,7 +116,7 @@ final class TransportHandshaker { */ static final TransportVersion EARLIEST_HANDSHAKE_VERSION = TransportVersion.fromId(6080099); - static final TransportVersion REQUEST_HANDSHAKE_VERSION = TransportVersion.MINIMUM_COMPATIBLE; + static final TransportVersion REQUEST_HANDSHAKE_VERSION = TransportVersions.MINIMUM_COMPATIBLE; static final Set ALLOWED_HANDSHAKE_VERSIONS = Set.of(EARLIEST_HANDSHAKE_VERSION, REQUEST_HANDSHAKE_VERSION); static final String HANDSHAKE_ACTION_NAME = "internal:tcp/handshake"; @@ -240,7 +241,7 @@ public void handleResponse(HandshakeResponse response) { "Received message from unsupported version: [" + responseVersion + "] minimal compatible version is: [" - + TransportVersion.MINIMUM_COMPATIBLE + + TransportVersions.MINIMUM_COMPATIBLE + "]" ) ); diff --git a/server/src/main/java/org/elasticsearch/transport/TransportLogger.java b/server/src/main/java/org/elasticsearch/transport/TransportLogger.java index 2d06d53b4dba0..be9e0070d05ba 100644 --- a/server/src/main/java/org/elasticsearch/transport/TransportLogger.java +++ b/server/src/main/java/org/elasticsearch/transport/TransportLogger.java @@ -10,6 +10,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressorFactory; import org.elasticsearch.common.io.stream.InputStreamStreamInput; @@ -95,7 +96,7 @@ private static String format(TcpChannel channel, BytesReference message, String ThreadContext.readHeadersFromStream(streamInput); if (isRequest) { - if (version.before(TransportVersion.V_8_0_0)) { + if (version.before(TransportVersions.V_8_0_0)) { // discard features streamInput.readStringArray(); } diff --git a/server/src/main/java/org/elasticsearch/transport/TransportStats.java b/server/src/main/java/org/elasticsearch/transport/TransportStats.java index 4ab884a57d38a..96c5a89256008 100644 --- a/server/src/main/java/org/elasticsearch/transport/TransportStats.java +++ b/server/src/main/java/org/elasticsearch/transport/TransportStats.java @@ -8,7 +8,7 @@ package org.elasticsearch.transport; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.common.collect.Iterators; import org.elasticsearch.common.io.stream.StreamInput; @@ -69,7 +69,7 @@ public TransportStats(StreamInput in) throws IOException { rxSize = in.readVLong(); txCount = in.readVLong(); txSize = in.readVLong(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0) && in.readBoolean()) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0) && in.readBoolean()) { inboundHandlingTimeBucketFrequencies = new long[HandlingTimeTracker.BUCKET_COUNT]; for (int i = 0; i < inboundHandlingTimeBucketFrequencies.length; i++) { inboundHandlingTimeBucketFrequencies[i] = in.readVLong(); @@ -82,7 +82,7 @@ public TransportStats(StreamInput in) throws IOException { inboundHandlingTimeBucketFrequencies = new long[0]; outboundHandlingTimeBucketFrequencies = new long[0]; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { transportActionStats = Collections.unmodifiableMap(in.readOrderedMap(StreamInput::readString, TransportActionStats::new)); } else { transportActionStats = Map.of(); @@ -98,7 +98,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(rxSize); out.writeVLong(txCount); out.writeVLong(txSize); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { assert (inboundHandlingTimeBucketFrequencies.length > 0) == (outboundHandlingTimeBucketFrequencies.length > 0); out.writeBoolean(inboundHandlingTimeBucketFrequencies.length > 0); for (long handlingTimeBucketFrequency : inboundHandlingTimeBucketFrequencies) { @@ -108,7 +108,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(handlingTimeBucketFrequency); } } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeMap(transportActionStats, StreamOutput::writeWriteable); } // else just drop these stats } diff --git a/server/src/main/java/org/elasticsearch/upgrades/FeatureMigrationResults.java b/server/src/main/java/org/elasticsearch/upgrades/FeatureMigrationResults.java index b0b2dc0f053a1..75ab5db982235 100644 --- a/server/src/main/java/org/elasticsearch/upgrades/FeatureMigrationResults.java +++ b/server/src/main/java/org/elasticsearch/upgrades/FeatureMigrationResults.java @@ -9,6 +9,7 @@ package org.elasticsearch.upgrades; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; @@ -40,7 +41,7 @@ */ public class FeatureMigrationResults implements Metadata.Custom { public static final String TYPE = "system_index_migration"; - public static final TransportVersion MIGRATION_ADDED_VERSION = TransportVersion.V_8_0_0; + public static final TransportVersion MIGRATION_ADDED_VERSION = TransportVersions.V_8_0_0; private static final ParseField RESULTS_FIELD = new ParseField("results"); diff --git a/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java b/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java index c4560b1fe4bb1..3c313ab5cd29f 100644 --- a/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java @@ -355,7 +355,7 @@ public void testSearchContextMissingException() throws IOException { TransportVersion version = TransportVersionUtils.randomVersion(random()); SearchContextMissingException ex = serialize(new SearchContextMissingException(contextId), version); assertThat(ex.contextId().getId(), equalTo(contextId.getId())); - if (version.onOrAfter(TransportVersion.V_7_7_0)) { + if (version.onOrAfter(TransportVersions.V_7_7_0)) { assertThat(ex.contextId().getSessionId(), equalTo(contextId.getSessionId())); } else { assertThat(ex.contextId().getSessionId(), equalTo("")); @@ -365,7 +365,7 @@ public void testSearchContextMissingException() throws IOException { public void testCircuitBreakingException() throws IOException { CircuitBreakingException ex = serialize( new CircuitBreakingException("Too large", 0, 100, CircuitBreaker.Durability.TRANSIENT), - TransportVersion.V_7_0_0 + TransportVersions.V_7_0_0 ); assertEquals("Too large", ex.getMessage()); assertEquals(100, ex.getByteLimit()); diff --git a/server/src/test/java/org/elasticsearch/TransportVersionTests.java b/server/src/test/java/org/elasticsearch/TransportVersionTests.java index 32265e8549e0c..b8b8380ee4a96 100644 --- a/server/src/test/java/org/elasticsearch/TransportVersionTests.java +++ b/server/src/test/java/org/elasticsearch/TransportVersionTests.java @@ -28,8 +28,8 @@ public class TransportVersionTests extends ESTestCase { public void testVersionComparison() { - TransportVersion V_7_2_0 = TransportVersion.V_7_2_0; - TransportVersion V_8_0_0 = TransportVersion.V_8_0_0; + TransportVersion V_7_2_0 = TransportVersions.V_7_2_0; + TransportVersion V_8_0_0 = TransportVersions.V_8_0_0; assertThat(V_7_2_0.before(V_8_0_0), is(true)); assertThat(V_7_2_0.before(V_7_2_0), is(false)); assertThat(V_8_0_0.before(V_7_2_0), is(false)); @@ -66,7 +66,7 @@ public static class DuplicatedIdFakeVersion { public void testStaticTransportVersionChecks() { assertThat( - TransportVersion.getAllVersionIds(CorrectFakeVersion.class), + TransportVersions.getAllVersionIds(CorrectFakeVersion.class), equalTo( Map.of( 199, @@ -80,7 +80,7 @@ public void testStaticTransportVersionChecks() { ) ) ); - AssertionError e = expectThrows(AssertionError.class, () -> TransportVersion.getAllVersionIds(DuplicatedIdFakeVersion.class)); + AssertionError e = expectThrows(AssertionError.class, () -> TransportVersions.getAllVersionIds(DuplicatedIdFakeVersion.class)); assertThat(e.getMessage(), containsString("have the same version number")); } @@ -160,7 +160,7 @@ public void testMax() { } public void testVersionConstantPresent() { - Set ignore = Set.of(TransportVersion.ZERO, TransportVersion.current(), TransportVersion.MINIMUM_COMPATIBLE); + Set ignore = Set.of(TransportVersions.ZERO, TransportVersion.current(), TransportVersions.MINIMUM_COMPATIBLE); assertThat(TransportVersion.current(), sameInstance(TransportVersion.fromId(TransportVersion.current().id()))); final int iters = scaledRandomIntBetween(20, 100); for (int i = 0; i < iters; i++) { @@ -171,7 +171,7 @@ public void testVersionConstantPresent() { } public void testCURRENTIsLatest() { - assertThat(Collections.max(TransportVersion.getAllVersions()), is(TransportVersion.current())); + assertThat(Collections.max(TransportVersions.getAllVersions()), is(TransportVersion.current())); } public void testToString() { diff --git a/server/src/test/java/org/elasticsearch/action/OriginalIndicesTests.java b/server/src/test/java/org/elasticsearch/action/OriginalIndicesTests.java index b181bc4f0e8b2..32bb70f32b64d 100644 --- a/server/src/test/java/org/elasticsearch/action/OriginalIndicesTests.java +++ b/server/src/test/java/org/elasticsearch/action/OriginalIndicesTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; @@ -45,7 +45,7 @@ public void testOriginalIndicesSerialization() throws IOException { // indices options are not equivalent when sent to an older version and re-read due // to the addition of hidden indices as expand to hidden indices is always true when // read from a prior version - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0) || originalIndices.indicesOptions().expandWildcardsHidden()) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0) || originalIndices.indicesOptions().expandWildcardsHidden()) { assertThat(originalIndices2.indicesOptions(), equalTo(originalIndices.indicesOptions())); } else if (originalIndices.indicesOptions().expandWildcardsHidden()) { assertThat(originalIndices2.indicesOptions(), equalTo(originalIndices.indicesOptions())); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java index e21b4adfe3928..5dd7cc4a3e5e0 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.cluster.reroute; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterState; @@ -320,7 +320,7 @@ private static ClusterState createClusterState() { var node0 = DiscoveryNodeUtils.create("node0", new TransportAddress(TransportAddress.META_ADDRESS, 9000)); return ClusterState.builder(new ClusterName("test")) .nodes(new DiscoveryNodes.Builder().add(node0).masterNodeId(node0.getId()).build()) - .putTransportVersion(node0.getId(), TransportVersion.V_8_0_0) + .putTransportVersion(node0.getId(), TransportVersions.V_8_0_0) .metadata( Metadata.builder() .put( diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequestTests.java index e4a9cb17f4d9a..76abc4733d3ff 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequestTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.cluster.shards; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; @@ -55,7 +56,7 @@ public void testSerialization() throws Exception { // indices options are not equivalent when sent to an older version and re-read due // to the addition of hidden indices as expand to hidden indices is always true when // read from a prior version - if (version.onOrAfter(TransportVersion.V_7_7_0) || request.indicesOptions().expandWildcardsHidden()) { + if (version.onOrAfter(TransportVersions.V_7_7_0) || request.indicesOptions().expandWildcardsHidden()) { assertEquals(request.indicesOptions(), deserialized.indicesOptions()); } assertEquals(request.routing(), deserialized.routing()); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequestTests.java index 7fb9d6f19e35c..17d4642ea45be 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequestTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.cluster.state; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; @@ -37,11 +38,11 @@ public void testSerialization() throws Exception { TransportVersion testVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, TransportVersion.current() ); // TODO: change version to V_6_6_0 after backporting: - if (testVersion.onOrAfter(TransportVersion.V_7_0_0)) { + if (testVersion.onOrAfter(TransportVersions.V_7_0_0)) { if (randomBoolean()) { clusterStateRequest.waitForMetadataVersion(randomLongBetween(1, Long.MAX_VALUE)); } diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequestTests.java index 914e8db1caa1b..13904764656b9 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequestTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.indices.close; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.common.io.stream.BytesStreamOutput; @@ -55,10 +56,10 @@ public void testBwcSerialization() throws Exception { // to the addition of hidden indices as expand to hidden indices is always true when // read from a prior version // TODO update version on backport! - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0) || request.indicesOptions().expandWildcardsHidden()) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0) || request.indicesOptions().expandWildcardsHidden()) { assertEquals(request.indicesOptions(), indicesOptions); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { assertEquals(request.waitForActiveShards(), ActiveShardCount.readFrom(in)); } else { assertEquals(0, in.available()); @@ -76,7 +77,7 @@ public void testBwcSerialization() throws Exception { out.writeTimeValue(sample.timeout()); out.writeStringArray(sample.indices()); sample.indicesOptions().writeIndicesOptions(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { sample.waitForActiveShards().writeTo(out); } @@ -93,10 +94,10 @@ public void testBwcSerialization() throws Exception { // to the addition of hidden indices as expand to hidden indices is always true when // read from a prior version // TODO change version on backport - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0) || sample.indicesOptions().expandWildcardsHidden()) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0) || sample.indicesOptions().expandWildcardsHidden()) { assertEquals(sample.indicesOptions(), deserializedRequest.indicesOptions()); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { assertEquals(sample.waitForActiveShards(), deserializedRequest.waitForActiveShards()); } else { assertEquals(ActiveShardCount.NONE, deserializedRequest.waitForActiveShards()); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/TransportResolveIndexActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/TransportResolveIndexActionTests.java index 32554a65d11d3..4c86faecd7aa6 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/TransportResolveIndexActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/TransportResolveIndexActionTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.admin.indices.resolve; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilter; import org.elasticsearch.action.support.ActionFilters; @@ -49,7 +50,7 @@ public void testCCSCompatibilityCheck() throws Exception { .build(); ActionFilters actionFilters = mock(ActionFilters.class); when(actionFilters.filters()).thenReturn(new ActionFilter[0]); - TransportVersion transportVersion = TransportVersionUtils.getNextVersion(TransportVersion.MINIMUM_CCS_VERSION, true); + TransportVersion transportVersion = TransportVersionUtils.getNextVersion(TransportVersions.MINIMUM_CCS_VERSION, true); try { TransportService transportService = MockTransportService.createNewService( Settings.EMPTY, diff --git a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesNodeResponseTests.java b/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesNodeResponseTests.java index 64919cecbdcfc..a95340e2fffd1 100644 --- a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesNodeResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesNodeResponseTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.fieldcaps; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.common.Randomness; import org.elasticsearch.common.UUIDs; @@ -99,7 +100,7 @@ public void testSerializeNodeResponseBetweenNewNodes() throws Exception { FieldCapabilitiesNodeResponse inNode = randomNodeResponse(indexResponses); final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_8_2_0, + TransportVersions.V_8_2_0, TransportVersion.current() ); final FieldCapabilitiesNodeResponse outNode = copyInstance(inNode, version); @@ -129,8 +130,8 @@ public void testSerializeNodeResponseBetweenNewNodes() throws Exception { } public void testSerializeNodeResponseBetweenOldNodes() throws IOException { - final TransportVersion minCompactVersion = TransportVersion.MINIMUM_COMPATIBLE; - assertTrue("Remove this test once minCompactVersion >= 8.2.0", minCompactVersion.before(TransportVersion.V_8_2_0)); + final TransportVersion minCompactVersion = TransportVersions.MINIMUM_COMPATIBLE; + assertTrue("Remove this test once minCompactVersion >= 8.2.0", minCompactVersion.before(TransportVersions.V_8_2_0)); List indexResponses = CollectionUtils.concatLists( randomIndexResponsesWithMappingHash(randomMappingHashToIndices()), randomIndexResponsesWithoutMappingHash() @@ -140,7 +141,7 @@ public void testSerializeNodeResponseBetweenOldNodes() throws IOException { TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), minCompactVersion, - TransportVersionUtils.getPreviousVersion(TransportVersion.V_8_2_0) + TransportVersionUtils.getPreviousVersion(TransportVersions.V_8_2_0) ); final FieldCapabilitiesNodeResponse outResponse = copyInstance(inResponse, version); assertThat(outResponse.getFailures().keySet(), equalTo(inResponse.getFailures().keySet())); @@ -154,7 +155,7 @@ public void testSerializeNodeResponseBetweenOldNodes() throws IOException { assertThat(outList.get(i).canMatch(), equalTo(inList.get(i).canMatch())); Map outCap = outList.get(i).get(); Map inCap = inList.get(i).get(); - if (version.onOrAfter(TransportVersion.V_8_0_0)) { + if (version.onOrAfter(TransportVersions.V_8_0_0)) { assertThat(outCap, equalTo(inCap)); } else { // Exclude metric types which was introduced in 8.0 @@ -177,7 +178,7 @@ public void testReadNodeResponseFromPre82() throws Exception { + "RleF8wMgAACGluZGV4XzAzAgdfc2VxX25vB19zZXFfbm8EbG9uZwEBAQAAAAx5ZWxsb3dfZmllbGQMeWVsbG93X2ZpZWxkB2tleXdvcmQAAQEAAAABAAEI" + "aW5kZXhfMTAGdXVpZF9hAQ=="; StreamInput in = StreamInput.wrap(Base64.getDecoder().decode(base64)); - in.setTransportVersion(TransportVersion.V_8_1_0); + in.setTransportVersion(TransportVersions.V_8_1_0); FieldCapabilitiesNodeResponse nodeResp = new FieldCapabilitiesNodeResponse(in); assertThat(nodeResp.getUnmatchedShardIds(), equalTo(Set.of(new ShardId("index_10", "uuid_a", 1)))); assertThat(nodeResp.getFailures(), anEmptyMap()); diff --git a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponseTests.java b/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponseTests.java index 3735bd8242ee2..cc7c76553ef99 100644 --- a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponseTests.java @@ -10,6 +10,7 @@ import org.elasticsearch.ElasticsearchExceptionTests; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.common.Randomness; import org.elasticsearch.common.bytes.BytesReference; @@ -169,7 +170,7 @@ public void testSerializeCCSResponseBetweenNewClusters() throws Exception { FieldCapabilitiesResponse inResponse = randomCCSResponse(indexResponses); final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_8_2_0, + TransportVersions.V_8_2_0, TransportVersion.current() ); final FieldCapabilitiesResponse outResponse = copyInstance(inResponse, version); @@ -201,8 +202,8 @@ public void testSerializeCCSResponseBetweenNewClusters() throws Exception { } public void testSerializeCCSResponseBetweenOldClusters() throws IOException { - TransportVersion minCompactVersion = TransportVersion.MINIMUM_COMPATIBLE; - assertTrue("Remove this test once minCompactVersion >= 8.2.0", minCompactVersion.before(TransportVersion.V_8_2_0)); + TransportVersion minCompactVersion = TransportVersions.MINIMUM_COMPATIBLE; + assertTrue("Remove this test once minCompactVersion >= 8.2.0", minCompactVersion.before(TransportVersions.V_8_2_0)); List indexResponses = CollectionUtils.concatLists( randomIndexResponsesWithMappingHash(randomMappingHashToIndices()), randomIndexResponsesWithoutMappingHash() @@ -212,7 +213,7 @@ public void testSerializeCCSResponseBetweenOldClusters() throws IOException { TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), minCompactVersion, - TransportVersionUtils.getPreviousVersion(TransportVersion.V_8_2_0) + TransportVersionUtils.getPreviousVersion(TransportVersions.V_8_2_0) ); final FieldCapabilitiesResponse outResponse = copyInstance(inResponse, version); assertThat( @@ -228,7 +229,7 @@ public void testSerializeCCSResponseBetweenOldClusters() throws IOException { assertThat(outList.get(i).canMatch(), equalTo(inList.get(i).canMatch())); Map outCap = outList.get(i).get(); Map inCap = inList.get(i).get(); - if (version.onOrAfter(TransportVersion.V_8_0_0)) { + if (version.onOrAfter(TransportVersions.V_8_0_0)) { assertThat(outCap, equalTo(inCap)); } else { // Exclude metric types which was introduced in 8.0 @@ -251,7 +252,7 @@ public void testReadCCSResponseFromPre82() throws Exception { + "GluZGV4XzAyAAAIaW5kZXhfMDMCDHllbGxvd19maWVsZAx5ZWxsb3dfZmllbGQHa2V5d29yZAABAQAAAAdfc2VxX25vB19zZXFfbm8EbG9uZwEBAQAAAA" + "EAAAAAAAAAAAA="; StreamInput in = StreamInput.wrap(Base64.getDecoder().decode(base64)); - in.setTransportVersion(TransportVersion.V_8_1_0); + in.setTransportVersion(TransportVersions.V_8_1_0); FieldCapabilitiesResponse nodeResp = new FieldCapabilitiesResponse(in); assertThat(nodeResp.getFailures(), empty()); assertThat( diff --git a/server/src/test/java/org/elasticsearch/action/fieldcaps/ResponseRewriterTests.java b/server/src/test/java/org/elasticsearch/action/fieldcaps/ResponseRewriterTests.java index 9264db0c5aefc..678f278d452b1 100644 --- a/server/src/test/java/org/elasticsearch/action/fieldcaps/ResponseRewriterTests.java +++ b/server/src/test/java/org/elasticsearch/action/fieldcaps/ResponseRewriterTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.fieldcaps; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.test.ESTestCase; @@ -26,7 +26,7 @@ public void testExcludeMetadata() { ); Map rewritten = ResponseRewriter.rewriteOldResponses( - TransportVersion.V_8_0_0, + TransportVersions.V_8_0_0, oldResponse, new String[] { "-metadata" }, Strings.EMPTY_ARRAY @@ -45,7 +45,7 @@ public void testIncludeOnlyMetadata() { ); Map rewritten = ResponseRewriter.rewriteOldResponses( - TransportVersion.V_8_0_0, + TransportVersions.V_8_0_0, oldResponse, new String[] { "+metadata" }, Strings.EMPTY_ARRAY @@ -66,7 +66,7 @@ public void testExcludeNested() { ); Map rewritten = ResponseRewriter.rewriteOldResponses( - TransportVersion.V_8_0_0, + TransportVersions.V_8_0_0, oldResponse, new String[] { "-nested" }, Strings.EMPTY_ARRAY @@ -90,7 +90,7 @@ public void testExcludeMultifield() { ); Map rewritten = ResponseRewriter.rewriteOldResponses( - TransportVersion.V_8_0_0, + TransportVersions.V_8_0_0, oldResponse, new String[] { "-multifield" }, Strings.EMPTY_ARRAY @@ -112,7 +112,7 @@ public void testExcludeParents() { ); Map rewritten = ResponseRewriter.rewriteOldResponses( - TransportVersion.V_8_0_0, + TransportVersions.V_8_0_0, oldResponse, new String[] { "-parent" }, Strings.EMPTY_ARRAY @@ -134,7 +134,7 @@ public void testAllowedTypes() { ); Map rewritten = ResponseRewriter.rewriteOldResponses( - TransportVersion.V_8_0_0, + TransportVersions.V_8_0_0, oldResponse, Strings.EMPTY_ARRAY, new String[] { "text", "keyword" } diff --git a/server/src/test/java/org/elasticsearch/action/fieldcaps/TransportFieldCapabilitiesActionTests.java b/server/src/test/java/org/elasticsearch/action/fieldcaps/TransportFieldCapabilitiesActionTests.java index bfae7d7c3bf4f..6b0fea6271f5e 100644 --- a/server/src/test/java/org/elasticsearch/action/fieldcaps/TransportFieldCapabilitiesActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/fieldcaps/TransportFieldCapabilitiesActionTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.fieldcaps; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.support.ActionFilter; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.PlainActionFuture; @@ -51,7 +52,7 @@ public void testCCSCompatibilityCheck() throws Exception { .build(); ActionFilters actionFilters = mock(ActionFilters.class); when(actionFilters.filters()).thenReturn(new ActionFilter[0]); - TransportVersion transportVersion = TransportVersionUtils.getNextVersion(TransportVersion.MINIMUM_CCS_VERSION, true); + TransportVersion transportVersion = TransportVersionUtils.getNextVersion(TransportVersions.MINIMUM_CCS_VERSION, true); try { TransportService transportService = MockTransportService.createNewService( Settings.EMPTY, diff --git a/server/src/test/java/org/elasticsearch/action/get/GetRequestTests.java b/server/src/test/java/org/elasticsearch/action/get/GetRequestTests.java index 4f62566b4a0a6..ee11674fb2794 100644 --- a/server/src/test/java/org/elasticsearch/action/get/GetRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/get/GetRequestTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.action.get; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -41,7 +41,7 @@ public void testForceSyntheticUnsupported() { GetRequest request = new GetRequest("index", "id"); request.setForceSyntheticSource(true); StreamOutput out = new BytesStreamOutput(); - out.setTransportVersion(TransportVersion.V_8_3_0); + out.setTransportVersion(TransportVersions.V_8_3_0); Exception e = expectThrows(IllegalArgumentException.class, () -> request.writeTo(out)); assertEquals(e.getMessage(), "force_synthetic_source is not supported before 8.4.0"); } diff --git a/server/src/test/java/org/elasticsearch/action/get/MultiGetRequestTests.java b/server/src/test/java/org/elasticsearch/action/get/MultiGetRequestTests.java index 15e3c95591d6e..eb9cfa4a6939c 100644 --- a/server/src/test/java/org/elasticsearch/action/get/MultiGetRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/get/MultiGetRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.get; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; @@ -124,7 +124,7 @@ public void testForceSyntheticUnsupported() { MultiGetRequest request = createTestInstance(); request.setForceSyntheticSource(true); StreamOutput out = new BytesStreamOutput(); - out.setTransportVersion(TransportVersion.V_8_3_0); + out.setTransportVersion(TransportVersions.V_8_3_0); Exception e = expectThrows(IllegalArgumentException.class, () -> request.writeTo(out)); assertEquals(e.getMessage(), "force_synthetic_source is not supported before 8.4.0"); } diff --git a/server/src/test/java/org/elasticsearch/action/get/MultiGetShardRequestTests.java b/server/src/test/java/org/elasticsearch/action/get/MultiGetShardRequestTests.java index 2f76127b88e26..e2b58ca2d2f1b 100644 --- a/server/src/test/java/org/elasticsearch/action/get/MultiGetShardRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/get/MultiGetShardRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.get; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -102,7 +102,7 @@ protected MultiGetShardRequest mutateInstance(MultiGetShardRequest instance) thr public void testForceSyntheticUnsupported() { MultiGetShardRequest request = createTestInstance(true); StreamOutput out = new BytesStreamOutput(); - out.setTransportVersion(TransportVersion.V_8_3_0); + out.setTransportVersion(TransportVersions.V_8_3_0); Exception e = expectThrows(IllegalArgumentException.class, () -> request.writeTo(out)); assertEquals(e.getMessage(), "force_synthetic_source is not supported before 8.4.0"); } diff --git a/server/src/test/java/org/elasticsearch/action/index/IndexRequestTests.java b/server/src/test/java/org/elasticsearch/action/index/IndexRequestTests.java index 8800b7739c936..203f2b74c5c4f 100644 --- a/server/src/test/java/org/elasticsearch/action/index/IndexRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/index/IndexRequestTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.action.index; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.DocWriteRequest; @@ -224,8 +225,8 @@ public void testSerializeDynamicTemplates() throws Exception { indexRequest.setDynamicTemplates(dynamicTemplates); TransportVersion ver = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_0_0, - TransportVersionUtils.getPreviousVersion(TransportVersion.V_7_13_0) + TransportVersions.V_7_0_0, + TransportVersionUtils.getPreviousVersion(TransportVersions.V_7_13_0) ); BytesStreamOutput out = new BytesStreamOutput(); out.setTransportVersion(ver); @@ -243,7 +244,7 @@ public void testSerializeDynamicTemplates() throws Exception { indexRequest.setDynamicTemplates(dynamicTemplates); TransportVersion ver = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_13_0, + TransportVersions.V_7_13_0, TransportVersion.current() ); BytesStreamOutput out = new BytesStreamOutput(); diff --git a/server/src/test/java/org/elasticsearch/action/search/OpenPointInTimeRequestTests.java b/server/src/test/java/org/elasticsearch/action/search/OpenPointInTimeRequestTests.java index 6b7b1ab63653d..78be6de1bd38e 100644 --- a/server/src/test/java/org/elasticsearch/action/search/OpenPointInTimeRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/OpenPointInTimeRequestTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.search; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; @@ -95,9 +96,9 @@ protected OpenPointInTimeRequest mutateInstance(OpenPointInTimeRequest in) throw } public void testUseDefaultConcurrentForOldVersion() throws Exception { - TransportVersion previousVersion = TransportVersionUtils.getPreviousVersion(TransportVersion.V_8_500_017); + TransportVersion previousVersion = TransportVersionUtils.getPreviousVersion(TransportVersions.V_8_500_017); try (BytesStreamOutput output = new BytesStreamOutput()) { - TransportVersion version = TransportVersionUtils.randomVersionBetween(random(), TransportVersion.V_8_0_0, previousVersion); + TransportVersion version = TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_8_0_0, previousVersion); output.setTransportVersion(version); OpenPointInTimeRequest original = createTestInstance(); original.writeTo(output); diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchRequestTests.java b/server/src/test/java/org/elasticsearch/action/search/SearchRequestTests.java index aa0c7ad6d499a..e27cda7aec3b7 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/SearchRequestTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.action.search; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.common.Strings; @@ -117,7 +118,7 @@ public void testSerializationMultiKNN() throws Exception { searchRequest, namedWriteableRegistry, SearchRequest::new, - TransportVersionUtils.randomVersionBetween(random(), TransportVersion.V_8_4_0, TransportVersion.V_8_6_0) + TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_8_4_0, TransportVersions.V_8_6_0) ) ); @@ -130,30 +131,30 @@ public void testSerializationMultiKNN() throws Exception { searchRequest, namedWriteableRegistry, SearchRequest::new, - TransportVersionUtils.randomVersionBetween(random(), TransportVersion.V_8_4_0, TransportVersion.V_8_6_0) + TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_8_4_0, TransportVersions.V_8_6_0) ); } public void testRandomVersionSerialization() throws IOException { SearchRequest searchRequest = createSearchRequest(); TransportVersion version = TransportVersionUtils.randomVersion(random()); - if (version.before(TransportVersion.V_7_11_0) && searchRequest.source() != null) { + if (version.before(TransportVersions.V_7_11_0) && searchRequest.source() != null) { // Versions before 7.11.0 don't support runtime mappings searchRequest.source().runtimeMappings(emptyMap()); } - if (version.before(TransportVersion.V_8_4_0)) { + if (version.before(TransportVersions.V_8_4_0)) { // Versions before 8.4.0 don't support force_synthetic_source searchRequest.setForceSyntheticSource(false); } - if (version.before(TransportVersion.V_8_7_0) && searchRequest.hasKnnSearch() && searchRequest.source().knnSearch().size() > 1) { + if (version.before(TransportVersions.V_8_7_0) && searchRequest.hasKnnSearch() && searchRequest.source().knnSearch().size() > 1) { // Versions before 8.7.0 don't support more than one KNN clause searchRequest.source().knnSearch(List.of(searchRequest.source().knnSearch().get(0))); } - if (version.before(TransportVersion.V_8_8_0) && searchRequest.source() != null) { + if (version.before(TransportVersions.V_8_8_0) && searchRequest.source() != null) { // Versions before 8.8 don't support rank searchRequest.source().rankBuilder(null); } - if (version.before(TransportVersion.V_8_500_013) && searchRequest.source() != null) { + if (version.before(TransportVersions.V_8_500_013) && searchRequest.source() != null) { // Versions before 8_500_999 don't support queries searchRequest.source().subSearches(new ArrayList<>()); } @@ -534,7 +535,7 @@ public void testForceSyntheticUnsupported() { SearchRequest request = new SearchRequest(); request.setForceSyntheticSource(true); StreamOutput out = new BytesStreamOutput(); - out.setTransportVersion(TransportVersion.V_8_3_0); + out.setTransportVersion(TransportVersions.V_8_3_0); Exception e = expectThrows(IllegalArgumentException.class, () -> request.writeTo(out)); assertEquals(e.getMessage(), "force_synthetic_source is not supported before 8.4.0"); } diff --git a/server/src/test/java/org/elasticsearch/action/search/TransportSearchActionTests.java b/server/src/test/java/org/elasticsearch/action/search/TransportSearchActionTests.java index 77e9c5d1d3f07..2eb206ed61cc0 100644 --- a/server/src/test/java/org/elasticsearch/action/search/TransportSearchActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/TransportSearchActionTests.java @@ -13,6 +13,7 @@ import org.apache.lucene.search.TotalHits; import org.apache.lucene.util.SetOnce; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.LatchedActionListener; import org.elasticsearch.action.OriginalIndices; @@ -1494,7 +1495,7 @@ public void testCCSCompatibilityCheck() throws Exception { .build(); ActionFilters actionFilters = mock(ActionFilters.class); when(actionFilters.filters()).thenReturn(new ActionFilter[0]); - TransportVersion transportVersion = TransportVersionUtils.getNextVersion(TransportVersion.MINIMUM_CCS_VERSION, true); + TransportVersion transportVersion = TransportVersionUtils.getNextVersion(TransportVersions.MINIMUM_CCS_VERSION, true); ThreadPool threadPool = new ThreadPool(settings); try { TransportService transportService = MockTransportService.createNewService( diff --git a/server/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java b/server/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java index a8f748d0c3129..0df492b080254 100644 --- a/server/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java +++ b/server/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java @@ -25,7 +25,7 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.termvectors.TermVectorsRequest.Flag; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; @@ -261,7 +261,7 @@ public void testStreamRequestLegacyVersion() throws IOException { // write using older version which contains types ByteArrayOutputStream outBuffer = new ByteArrayOutputStream(); OutputStreamStreamOutput out = new OutputStreamStreamOutput(outBuffer); - out.setTransportVersion(TransportVersion.V_7_2_0); + out.setTransportVersion(TransportVersions.V_7_2_0); request.writeTo(out); // First check the type on the stream was written as "_doc" by manually parsing the stream until the type @@ -277,7 +277,7 @@ public void testStreamRequestLegacyVersion() throws IOException { // now read the stream as normal to check it is parsed correct if received from an older node esInBuffer = new ByteArrayInputStream(outBuffer.toByteArray()); esBuffer = new InputStreamStreamInput(esInBuffer); - esBuffer.setTransportVersion(TransportVersion.V_7_2_0); + esBuffer.setTransportVersion(TransportVersions.V_7_2_0); TermVectorsRequest req2 = new TermVectorsRequest(esBuffer); assertThat(request.offsets(), equalTo(req2.offsets())); diff --git a/server/src/test/java/org/elasticsearch/cluster/ClusterStateTests.java b/server/src/test/java/org/elasticsearch/cluster/ClusterStateTests.java index aa7cb95c196ab..d0d1b1e36ffeb 100644 --- a/server/src/test/java/org/elasticsearch/cluster/ClusterStateTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/ClusterStateTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.cluster; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.admin.indices.rollover.RolloverInfo; import org.elasticsearch.cluster.block.ClusterBlock; @@ -1125,7 +1126,7 @@ private static void writeChunks(ClusterState clusterState, XContentBuilder build } public void testGetMinTransportVersion() throws IOException { - assertEquals(TransportVersion.MINIMUM_COMPATIBLE, ClusterState.EMPTY_STATE.getMinTransportVersion()); + assertEquals(TransportVersions.MINIMUM_COMPATIBLE, ClusterState.EMPTY_STATE.getMinTransportVersion()); var builder = ClusterState.builder(buildClusterState()); int numNodes = randomIntBetween(2, 20); @@ -1141,7 +1142,7 @@ public void testGetMinTransportVersion() throws IOException { assertThat(newState.getMinTransportVersion(), equalTo(minVersion)); assertEquals( - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, ClusterState.builder(newState) .blocks(ClusterBlocks.builder().addGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK)) .build() diff --git a/server/src/test/java/org/elasticsearch/cluster/coordination/CoordinatorTests.java b/server/src/test/java/org/elasticsearch/cluster/coordination/CoordinatorTests.java index 3bae8dc1f8589..3fc62981b75ba 100644 --- a/server/src/test/java/org/elasticsearch/cluster/coordination/CoordinatorTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/coordination/CoordinatorTests.java @@ -11,6 +11,7 @@ import org.apache.logging.log4j.core.LogEvent; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.AbstractNamedDiffable; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.SimpleDiffable; @@ -1553,7 +1554,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/test/java/org/elasticsearch/cluster/coordination/PublicationTransportHandlerTests.java b/server/src/test/java/org/elasticsearch/cluster/coordination/PublicationTransportHandlerTests.java index 7e11d33a2a396..d266988f0123d 100644 --- a/server/src/test/java/org/elasticsearch/cluster/coordination/PublicationTransportHandlerTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/coordination/PublicationTransportHandlerTests.java @@ -10,6 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.cluster.ClusterState; @@ -235,7 +236,7 @@ public RecyclerBytesStreamOutput newNetworkBytesStream() { allNodes.add(node); nodeTransports.put( node, - TransportVersionUtils.randomVersionBetween(random(), TransportVersion.MINIMUM_COMPATIBLE, TransportVersion.current()) + TransportVersionUtils.randomVersionBetween(random(), TransportVersions.MINIMUM_COMPATIBLE, TransportVersion.current()) ); } diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/AutoExpandReplicasTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/AutoExpandReplicasTests.java index 17bfabf509848..8b9317fe6caea 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/AutoExpandReplicasTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/AutoExpandReplicasTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.admin.cluster.reroute.ClusterRerouteRequest; import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; @@ -237,7 +238,7 @@ public void testOnlyAutoExpandAllocationFilteringAfterAllNodesUpgraded() { localNode, localNode, allNodes.toArray(new DiscoveryNode[0]), - TransportVersion.V_7_0_0 + TransportVersions.V_7_0_0 ); CreateIndexRequest request = new CreateIndexRequest( @@ -259,7 +260,7 @@ public void testOnlyAutoExpandAllocationFilteringAfterAllNodesUpgraded() { // is the // master - state = cluster.addNode(state, newNode, TransportVersion.V_7_6_0); + state = cluster.addNode(state, newNode, TransportVersions.V_7_6_0); // use allocation filtering state = cluster.updateSettings( diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadataTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadataTests.java index 7198fcccab922..ab92ab7917f3b 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadataTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadataTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.cluster.metadata; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.Diff; @@ -115,10 +115,10 @@ public void testSigtermIsRemoveInOlderVersions() throws IOException { .setGracePeriod(new TimeValue(1_000)) .build(); BytesStreamOutput out = new BytesStreamOutput(); - out.setTransportVersion(TransportVersion.V_8_7_1); + out.setTransportVersion(TransportVersions.V_8_7_1); metadata.writeTo(out); StreamInput in = out.bytes().streamInput(); - in.setTransportVersion(TransportVersion.V_8_7_1); + in.setTransportVersion(TransportVersions.V_8_7_1); assertThat(new SingleNodeShutdownMetadata(in).getType(), equalTo(SingleNodeShutdownMetadata.Type.REMOVE)); out = new BytesStreamOutput(); diff --git a/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodeTests.java b/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodeTests.java index 7ae05025ce069..ab2e52c9b921c 100644 --- a/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodeTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodeTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.node; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.BytesStreamOutput; @@ -113,11 +114,11 @@ public void testDiscoveryNodeRoleWithOldVersion() throws Exception { { BytesStreamOutput streamOutput = new BytesStreamOutput(); - streamOutput.setTransportVersion(TransportVersion.V_7_11_0); + streamOutput.setTransportVersion(TransportVersions.V_7_11_0); node.writeTo(streamOutput); StreamInput in = StreamInput.wrap(streamOutput.bytes().toBytesRef().bytes); - in.setTransportVersion(TransportVersion.V_7_11_0); + in.setTransportVersion(TransportVersions.V_7_11_0); DiscoveryNode serialized = new DiscoveryNode(in); final Set roles = serialized.getRoles(); assertThat(roles, hasSize(1)); diff --git a/server/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java b/server/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java index da3ddec7a025f..0f375246c3337 100644 --- a/server/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.serialization; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.cluster.AbstractNamedDiffable; import org.elasticsearch.cluster.ClusterModule; @@ -163,7 +164,7 @@ public void testSnapshotDeletionsInProgressSerialization() throws Exception { BytesStreamOutput outStream = new BytesStreamOutput(); TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, TransportVersion.current() ); outStream.setTransportVersion(version); @@ -360,7 +361,7 @@ public static NamedDiff readDiffFrom(StreamInput in) throws IOException @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } } @@ -399,7 +400,7 @@ public void testCustomSerialization() throws Exception { // serialize with minimum compatibile version outStream = new BytesStreamOutput(); - version = TransportVersion.MINIMUM_COMPATIBLE; + version = TransportVersions.MINIMUM_COMPATIBLE; outStream.setTransportVersion(version); diffs.writeTo(outStream); inStream = outStream.bytes().streamInput(); diff --git a/server/src/test/java/org/elasticsearch/cluster/service/TransportVersionsFixupListenerTests.java b/server/src/test/java/org/elasticsearch/cluster/service/TransportVersionsFixupListenerTests.java index 43efc7da0df4c..51d108bb8a4f1 100644 --- a/server/src/test/java/org/elasticsearch/cluster/service/TransportVersionsFixupListenerTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/service/TransportVersionsFixupListenerTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.service; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; @@ -107,7 +108,7 @@ public void testNothingFixedWhenNothingToInfer() { ClusterState testState = ClusterState.builder(ClusterState.EMPTY_STATE) .nodes(node(Version.V_8_8_0)) - .transportVersions(versions(TransportVersion.V_8_8_0)) + .transportVersions(versions(TransportVersions.V_8_8_0)) .build(); TransportVersionsFixupListener listeners = new TransportVersionsFixupListener(taskQueue, client, null); @@ -137,7 +138,7 @@ public void testNothingFixedWhenOnPreviousVersion() { ClusterState testState = ClusterState.builder(ClusterState.EMPTY_STATE) .nodes(node(Version.V_8_7_0, Version.V_8_8_0)) - .transportVersions(versions(TransportVersion.V_8_7_0, TransportVersion.V_8_8_0)) + .transportVersions(versions(TransportVersions.V_8_7_0, TransportVersions.V_8_8_0)) .build(); TransportVersionsFixupListener listeners = new TransportVersionsFixupListener(taskQueue, client, null); @@ -153,7 +154,7 @@ public void testVersionsAreFixed() { ClusterState testState = ClusterState.builder(ClusterState.EMPTY_STATE) .nodes(node(NEXT_VERSION, NEXT_VERSION, NEXT_VERSION)) - .transportVersions(versions(NEXT_TRANSPORT_VERSION, TransportVersion.V_8_8_0, TransportVersion.V_8_8_0)) + .transportVersions(versions(NEXT_TRANSPORT_VERSION, TransportVersions.V_8_8_0, TransportVersions.V_8_8_0)) .build(); ArgumentCaptor> action = ArgumentCaptor.forClass(ActionListener.class); @@ -177,7 +178,7 @@ public void testConcurrentChangesDoNotOverlap() { ClusterState testState1 = ClusterState.builder(ClusterState.EMPTY_STATE) .nodes(node(NEXT_VERSION, NEXT_VERSION, NEXT_VERSION)) - .transportVersions(versions(NEXT_TRANSPORT_VERSION, TransportVersion.V_8_8_0, TransportVersion.V_8_8_0)) + .transportVersions(versions(NEXT_TRANSPORT_VERSION, TransportVersions.V_8_8_0, TransportVersions.V_8_8_0)) .build(); TransportVersionsFixupListener listeners = new TransportVersionsFixupListener(taskQueue, client, null); @@ -187,7 +188,7 @@ public void testConcurrentChangesDoNotOverlap() { ClusterState testState2 = ClusterState.builder(ClusterState.EMPTY_STATE) .nodes(node(NEXT_VERSION, NEXT_VERSION, NEXT_VERSION)) - .transportVersions(versions(NEXT_TRANSPORT_VERSION, NEXT_TRANSPORT_VERSION, TransportVersion.V_8_8_0)) + .transportVersions(versions(NEXT_TRANSPORT_VERSION, NEXT_TRANSPORT_VERSION, TransportVersions.V_8_8_0)) .build(); // should not send any requests listeners.clusterChanged(new ClusterChangedEvent("test", testState2, testState1)); @@ -202,7 +203,7 @@ public void testFailedRequestsAreRetried() { ClusterState testState1 = ClusterState.builder(ClusterState.EMPTY_STATE) .nodes(node(NEXT_VERSION, NEXT_VERSION, NEXT_VERSION)) - .transportVersions(versions(NEXT_TRANSPORT_VERSION, TransportVersion.V_8_8_0, TransportVersion.V_8_8_0)) + .transportVersions(versions(NEXT_TRANSPORT_VERSION, TransportVersions.V_8_8_0, TransportVersions.V_8_8_0)) .build(); ArgumentCaptor> action = ArgumentCaptor.forClass(ActionListener.class); diff --git a/server/src/test/java/org/elasticsearch/common/io/stream/DelayableWriteableTests.java b/server/src/test/java/org/elasticsearch/common/io/stream/DelayableWriteableTests.java index 0acd5dcc9f2fd..7e42653952a94 100644 --- a/server/src/test/java/org/elasticsearch/common/io/stream/DelayableWriteableTests.java +++ b/server/src/test/java/org/elasticsearch/common/io/stream/DelayableWriteableTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.common.io.stream; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.TransportVersionUtils; @@ -195,7 +196,7 @@ protected NamedWriteableRegistry writableRegistry() { private static TransportVersion randomOldVersion() { return TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, TransportVersionUtils.getPreviousVersion(TransportVersion.current()) ); } diff --git a/server/src/test/java/org/elasticsearch/common/io/stream/VersionCheckingStreamOutputTests.java b/server/src/test/java/org/elasticsearch/common/io/stream/VersionCheckingStreamOutputTests.java index e26442284df00..bee63e72a3a0a 100644 --- a/server/src/test/java/org/elasticsearch/common/io/stream/VersionCheckingStreamOutputTests.java +++ b/server/src/test/java/org/elasticsearch/common/io/stream/VersionCheckingStreamOutputTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.common.io.stream; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.TransportVersionUtils; @@ -36,7 +37,7 @@ public TransportVersion getMinimalSupportedVersion() { public void testCheckVersionCompatibility() throws IOException { TransportVersion streamVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, TransportVersionUtils.getPreviousVersion(TransportVersion.current()) ); try (VersionCheckingStreamOutput out = new VersionCheckingStreamOutput(streamVersion)) { diff --git a/server/src/test/java/org/elasticsearch/common/settings/SettingsTests.java b/server/src/test/java/org/elasticsearch/common/settings/SettingsTests.java index 6acc7aa32bf48..965f305c3c23f 100644 --- a/server/src/test/java/org/elasticsearch/common/settings/SettingsTests.java +++ b/server/src/test/java/org/elasticsearch/common/settings/SettingsTests.java @@ -10,6 +10,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.Diff; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; @@ -622,7 +623,7 @@ public void testMissingValue() throws Exception { public void testReadWriteArray() throws IOException { BytesStreamOutput output = new BytesStreamOutput(); - output.setTransportVersion(randomFrom(TransportVersion.current(), TransportVersion.V_7_0_0)); + output.setTransportVersion(randomFrom(TransportVersion.current(), TransportVersions.V_7_0_0)); Settings settings = Settings.builder().putList("foo.bar", "0", "1", "2", "3").put("foo.bar.baz", "baz").build(); settings.writeTo(output); StreamInput in = StreamInput.wrap(BytesReference.toBytes(output.bytes())); diff --git a/server/src/test/java/org/elasticsearch/index/mapper/MappingParserTests.java b/server/src/test/java/org/elasticsearch/index/mapper/MappingParserTests.java index 4e1c34d68e603..ddb81727fd399 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/MappingParserTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/MappingParserTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; @@ -319,8 +320,8 @@ public void testBlankFieldNameBefore8_6_0() throws Exception { IndexVersion version = IndexVersionUtils.randomVersionBetween(random(), IndexVersion.MINIMUM_COMPATIBLE, IndexVersion.V_8_5_0); TransportVersion transportVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, - TransportVersion.V_8_5_0 + TransportVersions.MINIMUM_COMPATIBLE, + TransportVersions.V_8_5_0 ); { XContentBuilder builder = mapping(b -> b.startObject(" ").field("type", randomFieldType()).endObject()); diff --git a/server/src/test/java/org/elasticsearch/index/mapper/ParametrizedMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/ParametrizedMapperTests.java index 9b381abf8e47b..248d94cb67a63 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/ParametrizedMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/ParametrizedMapperTests.java @@ -10,6 +10,7 @@ import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.lucene.Lucene; @@ -533,8 +534,8 @@ public void testBWCunknownParametersfromDynamicTemplates() { IndexVersionUtils.randomPreviousCompatibleVersion(random(), IndexVersion.V_8_0_0), TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_0_0, - TransportVersionUtils.getPreviousVersion(TransportVersion.V_8_0_0) + TransportVersions.V_7_0_0, + TransportVersionUtils.getPreviousVersion(TransportVersions.V_8_0_0) ), true ); @@ -548,7 +549,7 @@ public void testBWCunknownParametersfromDynamicTemplates() { MapperParsingException ex = expectThrows( MapperParsingException.class, - () -> fromMapping(mapping, IndexVersion.V_8_0_0, TransportVersion.V_8_0_0, true) + () -> fromMapping(mapping, IndexVersion.V_8_0_0, TransportVersions.V_8_0_0, true) ); assertEquals("unknown parameter [some_unknown_parameter] on mapper [field] of type [test_mapper]", ex.getMessage()); } @@ -585,7 +586,7 @@ public void testDeprecatedParameters() { // 'index' is declared explicitly, 'store' is not, but is one of the previously always-accepted params String mapping = """ {"type":"test_mapper","index":false,"store":true,"required":"value"}"""; - TestMapper mapper = fromMapping(mapping, IndexVersion.V_7_8_0, TransportVersion.V_7_8_0); + TestMapper mapper = fromMapping(mapping, IndexVersion.V_7_8_0, TransportVersions.V_7_8_0); assertWarnings("Parameter [store] has no effect on type [test_mapper] and will be removed in future"); assertFalse(mapper.index); assertEquals(""" @@ -593,7 +594,7 @@ public void testDeprecatedParameters() { MapperParsingException e = expectThrows( MapperParsingException.class, - () -> fromMapping(mapping, IndexVersion.V_8_0_0, TransportVersion.V_8_0_0) + () -> fromMapping(mapping, IndexVersion.V_8_0_0, TransportVersions.V_8_0_0) ); assertEquals("unknown parameter [store] on mapper [field] of type [test_mapper]", e.getMessage()); } diff --git a/server/src/test/java/org/elasticsearch/index/mapper/TypeParsersTests.java b/server/src/test/java/org/elasticsearch/index/mapper/TypeParsersTests.java index 31d39cc167b94..5eab2951d9e2d 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/TypeParsersTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/TypeParsersTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; @@ -90,7 +91,7 @@ public void testMultiFieldWithinMultiField() throws IOException { type -> typeParser, type -> null, olderVersion, - () -> TransportVersion.MINIMUM_COMPATIBLE, + () -> TransportVersions.MINIMUM_COMPATIBLE, null, ScriptCompiler.NONE, mapperService.getIndexAnalyzers(), @@ -113,7 +114,7 @@ public void testMultiFieldWithinMultiField() throws IOException { IndexVersion version = IndexVersionUtils.randomVersionBetween(random(), IndexVersion.V_8_0_0, IndexVersion.current()); TransportVersion transportVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_8_0_0, + TransportVersions.V_8_0_0, TransportVersion.current() ); MappingParserContext context = new MappingParserContext( diff --git a/server/src/test/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilderTests.java index 0e5f924ca8753..1257fa43f3216 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilderTests.java @@ -28,6 +28,7 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.tests.index.RandomIndexWriter; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.io.stream.StreamOutput; @@ -167,7 +168,7 @@ public String fieldName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/test/java/org/elasticsearch/index/translog/TranslogTests.java b/server/src/test/java/org/elasticsearch/index/translog/TranslogTests.java index 028eb089b951a..627ff0f63d2c7 100644 --- a/server/src/test/java/org/elasticsearch/index/translog/TranslogTests.java +++ b/server/src/test/java/org/elasticsearch/index/translog/TranslogTests.java @@ -26,6 +26,7 @@ import org.apache.lucene.tests.util.LineFileDocs; import org.apache.lucene.tests.util.LuceneTestCase; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Randomness; import org.elasticsearch.common.Strings; @@ -3402,7 +3403,7 @@ public void testTranslogOpSerialization() throws Exception { TransportVersion wireVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, TransportVersion.current() ); BytesStreamOutput out = new BytesStreamOutput(); diff --git a/server/src/test/java/org/elasticsearch/script/ScriptStatsTests.java b/server/src/test/java/org/elasticsearch/script/ScriptStatsTests.java index 83823bfb1e1df..f4af7aa381d5e 100644 --- a/server/src/test/java/org/elasticsearch/script/ScriptStatsTests.java +++ b/server/src/test/java/org/elasticsearch/script/ScriptStatsTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.script; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; @@ -139,7 +140,7 @@ public void testTimeSeriesIsEmpty() { public void testTimeSeriesSerialization() throws IOException { ScriptContextStats stats = randomStats(); - ScriptContextStats deserStats = serDeser(TransportVersion.V_8_0_0, TransportVersion.V_7_16_0, stats); + ScriptContextStats deserStats = serDeser(TransportVersions.V_8_0_0, TransportVersions.V_7_16_0, stats); // Due to how the versions are handled by TimeSeries serialization, we cannot just simply assert that both object are // equals but not the same assertEquals(stats.getCompilations(), deserStats.getCompilations()); @@ -150,11 +151,11 @@ public void testTimeSeriesSerialization() throws IOException { assertTrue(deserStats.getCacheEvictionsHistory().areTimingsEmpty()); assertEquals(stats.getCacheEvictions(), deserStats.getCacheEvictionsHistory().total); - deserStats = serDeser(TransportVersion.V_8_0_0, TransportVersion.V_8_0_0, stats); + deserStats = serDeser(TransportVersions.V_8_0_0, TransportVersions.V_8_0_0, stats); assertNotSame(stats, deserStats); assertEquals(stats, deserStats); - deserStats = serDeser(TransportVersion.V_8_1_0, TransportVersion.V_7_16_0, stats); + deserStats = serDeser(TransportVersions.V_8_1_0, TransportVersions.V_7_16_0, stats); // Due to how the versions are handled by TimeSeries serialization, we cannot just simply assert that both object are // equals but not the same assertEquals(stats.getCompilations(), deserStats.getCompilations()); @@ -163,7 +164,7 @@ public void testTimeSeriesSerialization() throws IOException { assertEquals(new TimeSeries(stats.getCompilationsHistory().total), deserStats.getCompilationsHistory()); assertEquals(new TimeSeries(stats.getCacheEvictionsHistory().total), deserStats.getCacheEvictionsHistory()); - deserStats = serDeser(TransportVersion.V_8_1_0, TransportVersion.V_8_1_0, stats); + deserStats = serDeser(TransportVersions.V_8_1_0, TransportVersions.V_8_1_0, stats); assertNotSame(stats, deserStats); assertEquals(stats, deserStats); } diff --git a/server/src/test/java/org/elasticsearch/search/SearchModuleTests.java b/server/src/test/java/org/elasticsearch/search/SearchModuleTests.java index 46c186e656b6b..6bf8fab620f46 100644 --- a/server/src/test/java/org/elasticsearch/search/SearchModuleTests.java +++ b/server/src/test/java/org/elasticsearch/search/SearchModuleTests.java @@ -10,6 +10,7 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.util.CharsRefBuilder; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.CheckedBiConsumer; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -545,7 +546,7 @@ private static TestAggregationBuilder fromXContent(String name, XContentParser p @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } @@ -602,7 +603,7 @@ protected void validate(ValidationContext context) {} @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } @@ -652,7 +653,7 @@ public RescoreContext innerBuildContext(int windowSize, SearchExecutionContext c @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } @@ -720,7 +721,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java b/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java index 0810254173d84..868832f61ef9c 100644 --- a/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java +++ b/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java @@ -19,6 +19,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchTimeoutException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse; @@ -2287,7 +2288,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesTests.java index 665f66fcca316..bf0b087f67a5a 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesTests.java @@ -9,6 +9,7 @@ import org.apache.lucene.util.SetOnce; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; @@ -397,7 +398,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridTests.java index 3797fb8f79d03..7244e711544ac 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.geo.GeoBoundingBox; import org.elasticsearch.common.geo.GeoBoundingBoxTests; import org.elasticsearch.common.geo.GeoPoint; @@ -51,12 +52,12 @@ protected GeoHashGridAggregationBuilder createTestAggregatorBuilder() { public void testSerializationPreBounds() throws Exception { TransportVersion noBoundsSupportVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_0_0, - TransportVersion.V_7_5_0 + TransportVersions.V_7_0_0, + TransportVersions.V_7_5_0 ); GeoHashGridAggregationBuilder builder = createTestAggregatorBuilder(); try (BytesStreamOutput output = new BytesStreamOutput()) { - output.setTransportVersion(TransportVersion.V_7_6_0); + output.setTransportVersion(TransportVersions.V_7_6_0); builder.writeTo(output); try ( StreamInput in = new NamedWriteableAwareStreamInput( diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoTileGridTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoTileGridTests.java index 334ddca4a2d63..5e4e4870b1ef7 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoTileGridTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoTileGridTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.aggregations.bucket; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.geo.GeoBoundingBox; import org.elasticsearch.common.geo.GeoBoundingBoxTests; import org.elasticsearch.common.geo.GeoPoint; @@ -51,12 +52,12 @@ protected GeoTileGridAggregationBuilder createTestAggregatorBuilder() { public void testSerializationPreBounds() throws Exception { TransportVersion noBoundsSupportVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_0_0, - TransportVersion.V_7_5_0 + TransportVersions.V_7_0_0, + TransportVersions.V_7_5_0 ); GeoTileGridAggregationBuilder builder = createTestAggregatorBuilder(); try (BytesStreamOutput output = new BytesStreamOutput()) { - output.setTransportVersion(TransportVersion.V_7_6_0); + output.setTransportVersion(TransportVersions.V_7_6_0); builder.writeTo(output); try ( StreamInput in = new NamedWriteableAwareStreamInput( diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetricTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetricTests.java index 34f0d40985358..4c4ac418c949b 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetricTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetricTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.Maps; @@ -283,8 +283,8 @@ public void testOldSerialization() throws IOException { InternalAggregation.class, TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_0_0, - TransportVersionUtils.getPreviousVersion(TransportVersion.V_7_8_0) + TransportVersions.V_7_0_0, + TransportVersionUtils.getPreviousVersion(TransportVersions.V_7_8_0) ) ); assertThat(roundTripped, equalTo(original)); @@ -299,8 +299,8 @@ public void testOldSerialization() throws IOException { InternalAggregation.class, TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_0_0, - TransportVersionUtils.getPreviousVersion(TransportVersion.V_7_8_0) + TransportVersions.V_7_0_0, + TransportVersionUtils.getPreviousVersion(TransportVersions.V_7_8_0) ) ) ); diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/TDigestStateTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/TDigestStateTests.java index a70e7a241fe7a..7b849499f0859 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/TDigestStateTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/TDigestStateTests.java @@ -10,6 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; @@ -193,10 +194,10 @@ public void testSerialization() throws IOException { backwardsCompatible.add(i); } - TDigestState serialized = writeToAndReadFrom(state, TransportVersion.V_8_500_014); + TDigestState serialized = writeToAndReadFrom(state, TransportVersions.V_8_500_014); assertEquals(serialized, state); - TDigestState serializedBackwardsCompatible = writeToAndReadFrom(state, TransportVersion.V_8_500_010); + TDigestState serializedBackwardsCompatible = writeToAndReadFrom(state, TransportVersions.V_8_500_010); assertNotEquals(serializedBackwardsCompatible, state); assertEquals(serializedBackwardsCompatible, backwardsCompatible); } diff --git a/server/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java b/server/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java index dce0782fc17a9..83a3497e44259 100644 --- a/server/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.builder; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.admin.cluster.stats.SearchUsageStats; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; @@ -128,8 +129,8 @@ public void testSerializingWithRuntimeFieldsBeforeSupportedThrows() { SearchSourceBuilder original = new SearchSourceBuilder().runtimeMappings(randomRuntimeMappings()); TransportVersion v = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_0_0, - TransportVersionUtils.getPreviousVersion(TransportVersion.V_7_11_0) + TransportVersions.V_7_0_0, + TransportVersionUtils.getPreviousVersion(TransportVersions.V_7_11_0) ); Exception e = expectThrows(IllegalArgumentException.class, () -> copyBuilder(original, v)); assertThat(e.getMessage(), equalTo("Versions before 7110099 don't support [runtime_mappings] and search was sent to [" + v + "]")); diff --git a/server/src/test/java/org/elasticsearch/search/internal/ShardSearchRequestTests.java b/server/src/test/java/org/elasticsearch/search/internal/ShardSearchRequestTests.java index 65b7eb1c844c4..3d22abc53af41 100644 --- a/server/src/test/java/org/elasticsearch/search/internal/ShardSearchRequestTests.java +++ b/server/src/test/java/org/elasticsearch/search/internal/ShardSearchRequestTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.internal; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.cluster.metadata.AliasMetadata; @@ -227,16 +228,16 @@ public void testChannelVersion() throws Exception { for (int i = 0; i < iterations; i++) { TransportVersion version = TransportVersionUtils.randomCompatibleVersion(random()); if (request.isForceSyntheticSource()) { - version = TransportVersionUtils.randomVersionBetween(random(), TransportVersion.V_8_4_0, TransportVersion.current()); + version = TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_8_4_0, TransportVersion.current()); } if (Optional.ofNullable(request.source()).map(SearchSourceBuilder::knnSearch).map(List::size).orElse(0) > 1) { - version = TransportVersionUtils.randomVersionBetween(random(), TransportVersion.V_8_7_0, TransportVersion.current()); + version = TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_8_7_0, TransportVersion.current()); } if (request.source() != null && request.source().rankBuilder() != null) { - version = TransportVersionUtils.randomVersionBetween(random(), TransportVersion.V_8_8_0, TransportVersion.current()); + version = TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_8_8_0, TransportVersion.current()); } if (request.source() != null && request.source().subSearches().size() >= 2) { - version = TransportVersionUtils.randomVersionBetween(random(), TransportVersion.V_8_500_013, TransportVersion.current()); + version = TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_8_500_013, TransportVersion.current()); } request = copyWriteable(request, namedWriteableRegistry, ShardSearchRequest::new, version); channelVersion = TransportVersion.min(channelVersion, version); @@ -269,7 +270,7 @@ public void testForceSyntheticUnsupported() throws IOException { request.setForceSyntheticSource(true); ShardSearchRequest shardRequest = createShardSearchReqest(request); StreamOutput out = new BytesStreamOutput(); - out.setTransportVersion(TransportVersion.V_8_3_0); + out.setTransportVersion(TransportVersions.V_8_3_0); Exception e = expectThrows(IllegalArgumentException.class, () -> shardRequest.writeTo(out)); assertEquals(e.getMessage(), "force_synthetic_source is not supported before 8.4.0"); } diff --git a/server/src/test/java/org/elasticsearch/search/query/SlowRunningQueryBuilder.java b/server/src/test/java/org/elasticsearch/search/query/SlowRunningQueryBuilder.java index b4f4c6e8cc851..fdee3da477bb7 100644 --- a/server/src/test/java/org/elasticsearch/search/query/SlowRunningQueryBuilder.java +++ b/server/src/test/java/org/elasticsearch/search/query/SlowRunningQueryBuilder.java @@ -14,6 +14,7 @@ import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.Weight; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; @@ -70,7 +71,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } @Override diff --git a/server/src/test/java/org/elasticsearch/search/query/ThrowingQueryBuilder.java b/server/src/test/java/org/elasticsearch/search/query/ThrowingQueryBuilder.java index 38b7cb91bec87..cd3d195030c55 100644 --- a/server/src/test/java/org/elasticsearch/search/query/ThrowingQueryBuilder.java +++ b/server/src/test/java/org/elasticsearch/search/query/ThrowingQueryBuilder.java @@ -13,6 +13,7 @@ import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.Weight; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; @@ -66,7 +67,7 @@ public ThrowingQueryBuilder(StreamInput in) throws IOException { this.randomUID = in.readLong(); this.failure = in.readException(); this.shardId = in.readVInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_040)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) { this.index = in.readOptionalString(); } else { this.index = null; @@ -78,7 +79,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeLong(randomUID); out.writeException(failure); out.writeVInt(shardId); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_040)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_040)) { out.writeOptionalString(index); } } @@ -140,6 +141,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/server/src/test/java/org/elasticsearch/search/sort/SortValueTests.java b/server/src/test/java/org/elasticsearch/search/sort/SortValueTests.java index cb23859620cb4..3539cfdc9709c 100644 --- a/server/src/test/java/org/elasticsearch/search/sort/SortValueTests.java +++ b/server/src/test/java/org/elasticsearch/search/sort/SortValueTests.java @@ -11,6 +11,7 @@ import org.apache.lucene.document.InetAddressPoint; import org.apache.lucene.util.BytesRef; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.network.InetAddresses; @@ -225,8 +226,8 @@ public void testSerializeBytesToOldVersion() { SortValue value = SortValue.from(new BytesRef("can't send me!")); TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_0_0, - TransportVersion.V_7_10_1 + TransportVersions.V_7_0_0, + TransportVersions.V_7_10_1 ); Exception e = expectThrows(IllegalArgumentException.class, () -> copyInstance(value, version)); assertThat( diff --git a/server/src/test/java/org/elasticsearch/search/suggest/SuggestTests.java b/server/src/test/java/org/elasticsearch/search/suggest/SuggestTests.java index 784bbdb2bc8e5..b6fa1e236a843 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/SuggestTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/SuggestTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.suggest; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; @@ -242,7 +243,7 @@ public void testMergingSuggestionOptions() { public void testSerialization() throws IOException { TransportVersion bwcVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, TransportVersion.current() ); diff --git a/server/src/test/java/org/elasticsearch/search/vectors/AbstractKnnVectorQueryBuilderTestCase.java b/server/src/test/java/org/elasticsearch/search/vectors/AbstractKnnVectorQueryBuilderTestCase.java index 47360c23013ab..f52f8ecc1aff8 100644 --- a/server/src/test/java/org/elasticsearch/search/vectors/AbstractKnnVectorQueryBuilderTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/vectors/AbstractKnnVectorQueryBuilderTestCase.java @@ -14,6 +14,7 @@ import org.apache.lucene.search.KnnFloatVectorQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.io.stream.BytesStreamOutput; @@ -210,8 +211,8 @@ public void testBWCVersionSerializationFilters() throws IOException { TransportVersion beforeFilterVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_8_0_0, - TransportVersion.V_8_1_0 + TransportVersions.V_8_0_0, + TransportVersions.V_8_1_0 ); assertBWCSerialization(query, queryNoFilters, beforeFilterVersion); @@ -226,7 +227,7 @@ public void testBWCVersionSerializationSimilarity() throws IOException { query.numCands(), null ).queryName(query.queryName()).boost(query.boost()).addFilterQueries(query.filterQueries()); - assertBWCSerialization(query, queryNoSimilarity, TransportVersion.V_8_7_0); + assertBWCSerialization(query, queryNoSimilarity, TransportVersions.V_8_7_0); } public void testBWCVersionSerializationByteQuery() throws IOException { @@ -246,8 +247,8 @@ public void testBWCVersionSerializationByteQuery() throws IOException { TransportVersion beforeByteQueryVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_8_2_0, - TransportVersion.V_8_6_0 + TransportVersions.V_8_2_0, + TransportVersions.V_8_6_0 ); assertBWCSerialization(query, queryNoByteQuery, beforeByteQueryVersion); } diff --git a/server/src/test/java/org/elasticsearch/transport/InboundDecoderTests.java b/server/src/test/java/org/elasticsearch/transport/InboundDecoderTests.java index 879d7555d6cfe..f243a894a8f17 100644 --- a/server/src/test/java/org/elasticsearch/transport/InboundDecoderTests.java +++ b/server/src/test/java/org/elasticsearch/transport/InboundDecoderTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.transport; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.ReleasableBytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; @@ -433,7 +434,7 @@ public void testCompressedDecodeHandshakeCompatibility() throws IOException { public void testVersionIncompatibilityDecodeException() throws IOException { String action = "test-request"; long requestId = randomNonNegativeLong(); - TransportVersion incompatibleVersion = TransportVersionUtils.getPreviousVersion(TransportVersion.MINIMUM_COMPATIBLE); + TransportVersion incompatibleVersion = TransportVersionUtils.getPreviousVersion(TransportVersions.MINIMUM_COMPATIBLE); OutboundMessage message = new OutboundMessage.Request( threadContext, new TestRequest(randomAlphaOfLength(100)), @@ -462,13 +463,13 @@ public void testVersionIncompatibilityDecodeException() throws IOException { public void testCheckVersionCompatibility() { try { InboundDecoder.checkVersionCompatibility( - TransportVersionUtils.randomVersionBetween(random(), TransportVersion.MINIMUM_COMPATIBLE, TransportVersion.current()) + TransportVersionUtils.randomVersionBetween(random(), TransportVersions.MINIMUM_COMPATIBLE, TransportVersion.current()) ); } catch (IllegalStateException e) { throw new AssertionError(e); } - TransportVersion invalid = TransportVersionUtils.getPreviousVersion(TransportVersion.MINIMUM_COMPATIBLE); + TransportVersion invalid = TransportVersionUtils.getPreviousVersion(TransportVersions.MINIMUM_COMPATIBLE); try { InboundDecoder.checkVersionCompatibility(invalid); fail(); @@ -477,7 +478,7 @@ public void testCheckVersionCompatibility() { "Received message from unsupported version: [" + invalid + "] minimal compatible version is: [" - + TransportVersion.MINIMUM_COMPATIBLE + + TransportVersions.MINIMUM_COMPATIBLE + "]", expected.getMessage() ); diff --git a/server/src/test/java/org/elasticsearch/transport/InboundHandlerTests.java b/server/src/test/java/org/elasticsearch/transport/InboundHandlerTests.java index 411de7c2a0f51..bd4be3f3bf49c 100644 --- a/server/src/test/java/org/elasticsearch/transport/InboundHandlerTests.java +++ b/server/src/test/java/org/elasticsearch/transport/InboundHandlerTests.java @@ -13,6 +13,7 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; @@ -252,7 +253,7 @@ public void testClosesChannelOnErrorInHandshake() throws Exception { final TransportVersion remoteVersion = TransportVersionUtils.randomVersionBetween( random(), TransportVersionUtils.getFirstVersion(), - TransportVersionUtils.getPreviousVersion(TransportVersion.MINIMUM_COMPATIBLE) + TransportVersionUtils.getPreviousVersion(TransportVersions.MINIMUM_COMPATIBLE) ); final long requestId = randomNonNegativeLong(); final Header requestHeader = new Header( diff --git a/server/src/test/java/org/elasticsearch/transport/InboundPipelineTests.java b/server/src/test/java/org/elasticsearch/transport/InboundPipelineTests.java index b0ed33da16766..19f1c4d90c20a 100644 --- a/server/src/test/java/org/elasticsearch/transport/InboundPipelineTests.java +++ b/server/src/test/java/org/elasticsearch/transport/InboundPipelineTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.transport; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.breaker.CircuitBreaker; import org.elasticsearch.common.breaker.CircuitBreakingException; import org.elasticsearch.common.breaker.NoopCircuitBreaker; @@ -98,7 +99,7 @@ public void testPipelineHandling() throws IOException { toRelease.clear(); try (RecyclerBytesStreamOutput streamOutput = new RecyclerBytesStreamOutput(recycler)) { while (streamOutput.size() < BYTE_THRESHOLD) { - final TransportVersion version = randomFrom(TransportVersion.current(), TransportVersion.MINIMUM_COMPATIBLE); + final TransportVersion version = randomFrom(TransportVersion.current(), TransportVersions.MINIMUM_COMPATIBLE); final String value = randomRealisticUnicodeOfCodepointLength(randomIntBetween(200, 400)); final boolean isRequest = randomBoolean(); Compression.Scheme compressionScheme = getCompressionScheme(version); @@ -215,7 +216,7 @@ public void testDecodeExceptionIsPropagated() throws IOException { try (RecyclerBytesStreamOutput streamOutput = new RecyclerBytesStreamOutput(recycler)) { String actionName = "actionName"; - final TransportVersion invalidVersion = TransportVersionUtils.getPreviousVersion(TransportVersion.MINIMUM_COMPATIBLE); + final TransportVersion invalidVersion = TransportVersionUtils.getPreviousVersion(TransportVersions.MINIMUM_COMPATIBLE); final String value = randomAlphaOfLength(1000); final boolean isRequest = randomBoolean(); final long requestId = randomNonNegativeLong(); diff --git a/server/src/test/java/org/elasticsearch/transport/ProxyConnectionStrategyTests.java b/server/src/test/java/org/elasticsearch/transport/ProxyConnectionStrategyTests.java index 8cab2c2a0e2eb..d2941bab3f91a 100644 --- a/server/src/test/java/org/elasticsearch/transport/ProxyConnectionStrategyTests.java +++ b/server/src/test/java/org/elasticsearch/transport/ProxyConnectionStrategyTests.java @@ -10,6 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.cluster.ClusterName; @@ -237,7 +238,7 @@ public void testConnectFailsWithIncompatibleNodes() { IndexVersion.MINIMUM_COMPATIBLE, IndexVersion.current() ); - TransportVersion incompatibleTransportVersion = TransportVersionUtils.getPreviousVersion(TransportVersion.MINIMUM_COMPATIBLE); + TransportVersion incompatibleTransportVersion = TransportVersionUtils.getPreviousVersion(TransportVersions.MINIMUM_COMPATIBLE); try (MockTransportService transport1 = startTransport("incompatible-node", incompatibleVersion, incompatibleTransportVersion)) { TransportAddress address1 = transport1.boundAddress().publishAddress(); diff --git a/server/src/test/java/org/elasticsearch/transport/SniffConnectionStrategyTests.java b/server/src/test/java/org/elasticsearch/transport/SniffConnectionStrategyTests.java index ac3161af4f650..577f5d2c7dc18 100644 --- a/server/src/test/java/org/elasticsearch/transport/SniffConnectionStrategyTests.java +++ b/server/src/test/java/org/elasticsearch/transport/SniffConnectionStrategyTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.transport; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.admin.cluster.remote.RemoteClusterNodesAction; import org.elasticsearch.action.admin.cluster.state.ClusterStateAction; @@ -375,7 +376,7 @@ public void testDiscoverWithSingleIncompatibleSeedNode() { IndexVersion.MINIMUM_COMPATIBLE, IndexVersion.current() ); - TransportVersion incompatibleTransportVersion = TransportVersionUtils.getPreviousVersion(TransportVersion.MINIMUM_COMPATIBLE); + TransportVersion incompatibleTransportVersion = TransportVersionUtils.getPreviousVersion(TransportVersions.MINIMUM_COMPATIBLE); try ( MockTransportService seedTransport = startTransport( "seed_node", @@ -454,7 +455,7 @@ public void testConnectFailsWithIncompatibleNodes() { IndexVersion.MINIMUM_COMPATIBLE, IndexVersion.current() ); - TransportVersion incompatibleTransportVersion = TransportVersionUtils.getPreviousVersion(TransportVersion.MINIMUM_COMPATIBLE); + TransportVersion incompatibleTransportVersion = TransportVersionUtils.getPreviousVersion(TransportVersions.MINIMUM_COMPATIBLE); try ( MockTransportService incompatibleSeedTransport = startTransport( "seed_node", diff --git a/server/src/test/java/org/elasticsearch/transport/TransportActionProxyTests.java b/server/src/test/java/org/elasticsearch/transport/TransportActionProxyTests.java index 89665ba6dba2e..704de4fb2276a 100644 --- a/server/src/test/java/org/elasticsearch/transport/TransportActionProxyTests.java +++ b/server/src/test/java/org/elasticsearch/transport/TransportActionProxyTests.java @@ -10,6 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.VersionInformation; @@ -54,7 +55,7 @@ public class TransportActionProxyTests extends ESTestCase { IndexVersion.MINIMUM_COMPATIBLE, IndexVersion.current() ); - protected static final TransportVersion transportVersion0 = TransportVersion.MINIMUM_COMPATIBLE; + protected static final TransportVersion transportVersion0 = TransportVersions.MINIMUM_COMPATIBLE; protected DiscoveryNode nodeA; protected MockTransportService serviceA; diff --git a/server/src/test/java/org/elasticsearch/transport/TransportServiceHandshakeTests.java b/server/src/test/java/org/elasticsearch/transport/TransportServiceHandshakeTests.java index 71061f827f95c..ad6e33afa2559 100644 --- a/server/src/test/java/org/elasticsearch/transport/TransportServiceHandshakeTests.java +++ b/server/src/test/java/org/elasticsearch/transport/TransportServiceHandshakeTests.java @@ -11,6 +11,7 @@ import org.elasticsearch.Build; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.cluster.node.DiscoveryNode; @@ -208,7 +209,7 @@ public void testIncompatibleNodeVersions() { TransportService transportServiceB = startServices( "TS_B", settings, - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, new VersionInformation( VersionUtils.getPreviousVersion(Version.CURRENT.minimumCompatibilityVersion()), IndexVersion.MINIMUM_COMPATIBLE, @@ -259,7 +260,7 @@ public void testIncompatibleTransportVersions() { TransportService transportServiceB = startServices( "TS_B", settings, - TransportVersionUtils.getPreviousVersion(TransportVersion.MINIMUM_COMPATIBLE), + TransportVersionUtils.getPreviousVersion(TransportVersions.MINIMUM_COMPATIBLE), new VersionInformation(Version.CURRENT.minimumCompatibilityVersion(), IndexVersion.MINIMUM_COMPATIBLE, IndexVersion.current()), TransportService.NOOP_TRANSPORT_INTERCEPTOR ); @@ -408,7 +409,7 @@ public void testAcceptsMismatchedBuildHashFromDifferentVersion() { final TransportService transportServiceB = startServices( "TS_B", Settings.builder().put("cluster.name", "a").build(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, new VersionInformation(Version.CURRENT.minimumCompatibilityVersion(), IndexVersion.MINIMUM_COMPATIBLE, IndexVersion.current()), transportInterceptorB ); diff --git a/test/external-modules/delayed-aggs/src/main/java/org/elasticsearch/test/delayedshard/DelayedShardAggregationBuilder.java b/test/external-modules/delayed-aggs/src/main/java/org/elasticsearch/test/delayedshard/DelayedShardAggregationBuilder.java index 0549d1b3053b2..06985c659ecbd 100644 --- a/test/external-modules/delayed-aggs/src/main/java/org/elasticsearch/test/delayedshard/DelayedShardAggregationBuilder.java +++ b/test/external-modules/delayed-aggs/src/main/java/org/elasticsearch/test/delayedshard/DelayedShardAggregationBuilder.java @@ -9,6 +9,7 @@ package org.elasticsearch.test.delayedshard; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; @@ -134,6 +135,6 @@ public int hashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_10_0; + return TransportVersions.V_7_10_0; } } diff --git a/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/ErrorQueryBuilder.java b/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/ErrorQueryBuilder.java index 9153d17fb35a2..1a424c54821e8 100644 --- a/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/ErrorQueryBuilder.java +++ b/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/ErrorQueryBuilder.java @@ -15,6 +15,7 @@ import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.Weight; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.logging.HeaderWarning; @@ -164,7 +165,7 @@ protected int doHashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } static void sleep(long millis) { diff --git a/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/IndexError.java b/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/IndexError.java index 8f7dc633e122d..19284152efab6 100644 --- a/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/IndexError.java +++ b/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/IndexError.java @@ -8,7 +8,7 @@ package org.elasticsearch.test.errorquery; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -53,7 +53,7 @@ public IndexError(StreamInput in) throws IOException { this.shardIds = in.readBoolean() ? in.readIntArray() : null; this.errorType = in.readEnum(ERROR_TYPE.class); this.message = in.readString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_051)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_051)) { this.stallTimeSeconds = in.readVInt(); } else { this.stallTimeSeconds = 0; @@ -69,7 +69,7 @@ public void writeTo(StreamOutput out) throws IOException { } out.writeEnum(errorType); out.writeString(message); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_051)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_051)) { out.writeVInt(stallTimeSeconds); } } diff --git a/test/framework/src/main/java/org/elasticsearch/KnownTransportVersions.java b/test/framework/src/main/java/org/elasticsearch/KnownTransportVersions.java index fb1342397b0d6..eecf9f7c6e851 100644 --- a/test/framework/src/main/java/org/elasticsearch/KnownTransportVersions.java +++ b/test/framework/src/main/java/org/elasticsearch/KnownTransportVersions.java @@ -17,5 +17,5 @@ public class KnownTransportVersions { /** * A sorted list of all known transport versions */ - public static final List ALL_VERSIONS = List.copyOf(TransportVersion.getAllVersions()); + public static final List ALL_VERSIONS = List.copyOf(TransportVersions.getAllVersions()); } diff --git a/test/framework/src/main/java/org/elasticsearch/search/DummyQueryBuilder.java b/test/framework/src/main/java/org/elasticsearch/search/DummyQueryBuilder.java index b936feebd4901..bda5fe825b001 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/DummyQueryBuilder.java +++ b/test/framework/src/main/java/org/elasticsearch/search/DummyQueryBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.index.query.AbstractQueryBuilder; @@ -67,6 +68,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java index babc394cdfef8..9eb9a76d1e1ed 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java @@ -43,6 +43,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.NumericUtils; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.CheckedBiConsumer; import org.elasticsearch.common.TriConsumer; @@ -1415,7 +1416,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/test/framework/src/main/java/org/elasticsearch/search/rank/TestRankBuilder.java b/test/framework/src/main/java/org/elasticsearch/search/rank/TestRankBuilder.java index 411a226d08951..71a943413ba2d 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/rank/TestRankBuilder.java +++ b/test/framework/src/main/java/org/elasticsearch/search/rank/TestRankBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.ConstructingObjectParser; @@ -58,7 +59,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_8_0; + return TransportVersions.V_8_8_0; } @Override diff --git a/test/framework/src/main/java/org/elasticsearch/search/rank/TestRankShardResult.java b/test/framework/src/main/java/org/elasticsearch/search/rank/TestRankShardResult.java index c43a16cd218e3..ab66d021497d5 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/rank/TestRankShardResult.java +++ b/test/framework/src/main/java/org/elasticsearch/search/rank/TestRankShardResult.java @@ -9,6 +9,7 @@ package org.elasticsearch.search.rank; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -33,7 +34,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_8_0; + return TransportVersions.V_8_8_0; } @Override diff --git a/test/framework/src/main/java/org/elasticsearch/test/InternalAggregationTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/InternalAggregationTestCase.java index 8b579666fd767..008f8511ee127 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/InternalAggregationTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/InternalAggregationTestCase.java @@ -11,6 +11,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.SetOnce; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.breaker.CircuitBreaker; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; @@ -731,7 +732,7 @@ public BucketCardinality bucketCardinality() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } } diff --git a/test/framework/src/main/java/org/elasticsearch/test/TransportVersionUtils.java b/test/framework/src/main/java/org/elasticsearch/test/TransportVersionUtils.java index 93e43f2266a0e..689229e354d96 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/TransportVersionUtils.java +++ b/test/framework/src/main/java/org/elasticsearch/test/TransportVersionUtils.java @@ -9,6 +9,7 @@ package org.elasticsearch.test; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.core.Nullable; import java.util.Collections; @@ -120,6 +121,6 @@ public static TransportVersion getNextVersion(TransportVersion version, boolean /** Returns a random {@code TransportVersion} that is compatible with {@link TransportVersion#current()} */ public static TransportVersion randomCompatibleVersion(Random random) { - return randomVersionBetween(random, TransportVersion.MINIMUM_COMPATIBLE, TransportVersion.current()); + return randomVersionBetween(random, TransportVersions.MINIMUM_COMPATIBLE, TransportVersion.current()); } } diff --git a/test/framework/src/main/java/org/elasticsearch/transport/AbstractSimpleTransportTestCase.java b/test/framework/src/main/java/org/elasticsearch/transport/AbstractSimpleTransportTestCase.java index 144eb35d3f526..4a683c3f7dd57 100644 --- a/test/framework/src/main/java/org/elasticsearch/transport/AbstractSimpleTransportTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/transport/AbstractSimpleTransportTestCase.java @@ -15,6 +15,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListenerResponseHandler; @@ -2260,7 +2261,7 @@ public void testRegisterHandlerTwice() { public void testHandshakeWithIncompatVersion() { assumeTrue("only tcp transport has a handshake method", serviceA.getOriginalTransport() instanceof TcpTransport); - TransportVersion transportVersion = TransportVersion.fromId(TransportVersion.MINIMUM_COMPATIBLE.id() - 1); + TransportVersion transportVersion = TransportVersion.fromId(TransportVersions.MINIMUM_COMPATIBLE.id() - 1); try ( MockTransportService service = buildService( "TS_C", @@ -2292,7 +2293,7 @@ public void testHandshakeUpdatesVersion() throws IOException { assumeTrue("only tcp transport has a handshake method", serviceA.getOriginalTransport() instanceof TcpTransport); TransportVersion transportVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, TransportVersion.current() ); try ( diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilder.java index 3cebd756408fb..49eb18c2df9ef 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.analytics.boxplot; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -82,9 +83,9 @@ protected AggregationBuilder shallowCopy(AggregatorFactories.Builder factoriesBu public BoxplotAggregationBuilder(StreamInput in) throws IOException { super(in); compression = in.readDouble(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_018)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_018)) { executionHint = in.readOptionalWriteable(TDigestExecutionHint::readFrom); - } else if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_014)) { + } else if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_014)) { executionHint = TDigestExecutionHint.readFrom(in); } else { executionHint = TDigestExecutionHint.HIGH_ACCURACY; @@ -99,9 +100,9 @@ public Set metricNames() { @Override protected void innerWriteTo(StreamOutput out) throws IOException { out.writeDouble(compression); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_018)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_018)) { out.writeOptionalWriteable(executionHint); - } else if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_014)) { + } else if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_014)) { (executionHint == null ? TDigestExecutionHint.DEFAULT : executionHint).writeTo(out); } } @@ -202,6 +203,6 @@ public Optional> getOutputFieldNames() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_7_0; + return TransportVersions.V_7_7_0; } } diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/cumulativecardinality/CumulativeCardinalityPipelineAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/cumulativecardinality/CumulativeCardinalityPipelineAggregationBuilder.java index 6061e2b30297f..5845da9f6e6c5 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/cumulativecardinality/CumulativeCardinalityPipelineAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/cumulativecardinality/CumulativeCardinalityPipelineAggregationBuilder.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.analytics.cumulativecardinality; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.DocValueFormat; @@ -130,6 +131,6 @@ protected boolean overrideBucketsPath() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_4_0; + return TransportVersions.V_7_4_0; } } diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/movingPercentiles/MovingPercentilesPipelineAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/movingPercentiles/MovingPercentilesPipelineAggregationBuilder.java index 2cc9e1c7e4b1d..72688dafe3721 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/movingPercentiles/MovingPercentilesPipelineAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/movingPercentiles/MovingPercentilesPipelineAggregationBuilder.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.analytics.movingPercentiles; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder; @@ -131,6 +132,6 @@ protected boolean overrideBucketsPath() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_9_0; + return TransportVersions.V_7_9_0; } } diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/multiterms/MultiTermsAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/multiterms/MultiTermsAggregationBuilder.java index 2547af8c244c2..315a72ca1d645 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/multiterms/MultiTermsAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/multiterms/MultiTermsAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.analytics.multiterms; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; @@ -438,6 +439,6 @@ public boolean equals(Object obj) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_12_0; + return TransportVersions.V_7_12_0; } } diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/normalize/NormalizePipelineAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/normalize/NormalizePipelineAggregationBuilder.java index 3975e04de0c76..e61f01abcbedc 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/normalize/NormalizePipelineAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/normalize/NormalizePipelineAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.analytics.normalize; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.DocValueFormat; @@ -156,6 +157,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_9_0; + return TransportVersions.V_7_9_0; } } diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/InternalResetTrackingRate.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/InternalResetTrackingRate.java index b47ef33b4e68f..15d15b8120900 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/InternalResetTrackingRate.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/InternalResetTrackingRate.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.analytics.rate; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Rounding; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -63,7 +63,7 @@ public InternalResetTrackingRate(StreamInput in) throws IOException { this.startTime = in.readLong(); this.endTime = in.readLong(); this.resetCompensation = in.readDouble(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_015)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_015)) { this.rateUnit = Rounding.DateTimeUnit.resolve(in.readByte()); } else { this.rateUnit = Rounding.DateTimeUnit.SECOND_OF_MINUTE; @@ -82,7 +82,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeLong(startTime); out.writeLong(endTime); out.writeDouble(resetCompensation); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_015) && rateUnit != null) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_015) && rateUnit != null) { out.writeByte(rateUnit.getId()); } else { out.writeByte(Rounding.DateTimeUnit.SECOND_OF_MINUTE.getId()); diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilder.java index c0b9650144fc6..37332fa49bfbf 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilder.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.analytics.rate; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Rounding; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -87,7 +88,7 @@ public RateAggregationBuilder(StreamInput in) throws IOException { } else { rateUnit = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { if (in.readBoolean()) { rateMode = in.readEnum(RateMode.class); } @@ -106,7 +107,7 @@ protected void innerWriteTo(StreamOutput out) throws IOException { } else { out.writeByte((byte) 0); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { if (rateMode != null) { out.writeBoolean(true); out.writeEnum(rateMode); @@ -215,6 +216,6 @@ public int hashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_10_0; + return TransportVersions.V_7_10_0; } } diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/stringstats/StringStatsAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/stringstats/StringStatsAggregationBuilder.java index da02f9bcb7a5d..0be2ac9f24e62 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/stringstats/StringStatsAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/stringstats/StringStatsAggregationBuilder.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.analytics.stringstats; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -158,6 +159,6 @@ public boolean equals(Object obj) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_6_0; + return TransportVersions.V_7_6_0; } } diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/topmetrics/TopMetricsAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/topmetrics/TopMetricsAggregationBuilder.java index 19de52dc1d26f..15838a77a96ad 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/topmetrics/TopMetricsAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/topmetrics/TopMetricsAggregationBuilder.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.analytics.topmetrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; @@ -237,6 +238,6 @@ public Optional> getOutputFieldNames() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_7_0; + return TransportVersions.V_7_7_0; } } diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/ttest/TTestAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/ttest/TTestAggregationBuilder.java index af367759d5ac6..7137302459c0b 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/ttest/TTestAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/ttest/TTestAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.analytics.ttest; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.index.query.QueryBuilder; @@ -181,6 +182,6 @@ public String getType() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_8_0; + return TransportVersions.V_7_8_0; } } diff --git a/x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java b/x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java index ef9ca6a7763ca..4250a64f8d407 100644 --- a/x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java +++ b/x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -77,6 +78,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/AsyncSearchActionIT.java b/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/AsyncSearchActionIT.java index b988e1ce5e980..7e161c3154fa9 100644 --- a/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/AsyncSearchActionIT.java +++ b/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/AsyncSearchActionIT.java @@ -11,6 +11,7 @@ import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; @@ -532,7 +533,7 @@ public void testCCSCheckCompatibility() throws Exception { SubmitAsyncSearchRequest request = new SubmitAsyncSearchRequest(new SearchSourceBuilder().query(new DummyQueryBuilder() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersionUtils.getNextVersion(TransportVersion.MINIMUM_CCS_VERSION, true); + return TransportVersionUtils.getNextVersion(TransportVersions.MINIMUM_CCS_VERSION, true); } }), indexName); diff --git a/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/BlockingQueryBuilder.java b/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/BlockingQueryBuilder.java index 3b0d849b2ddfc..e69e19e4566ea 100644 --- a/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/BlockingQueryBuilder.java +++ b/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/BlockingQueryBuilder.java @@ -12,6 +12,7 @@ import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.Weight; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; @@ -130,7 +131,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } /** diff --git a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/CancellingAggregationBuilder.java b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/CancellingAggregationBuilder.java index 773c70c3b64ec..90358014e1ee4 100644 --- a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/CancellingAggregationBuilder.java +++ b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/CancellingAggregationBuilder.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.search; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.index.query.QueryBuilders; @@ -106,6 +107,6 @@ public BucketCardinality bucketCardinality() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_7_0; + return TransportVersions.V_7_7_0; } } diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/AutoscalingMetadata.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/AutoscalingMetadata.java index 33d9763acc2ba..5c885ad718d8c 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/AutoscalingMetadata.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/AutoscalingMetadata.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.autoscaling; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; @@ -113,7 +114,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_8_0; + return TransportVersions.V_7_8_0; } @Override @@ -172,7 +173,7 @@ static Diff readFrom(final StreamInput in) throws IOE @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_8_0; + return TransportVersions.V_7_8_0; } } } diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingCapacity.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingCapacity.java index 5037cd44f7670..f5197d4efe346 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingCapacity.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingCapacity.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.autoscaling.capacity; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -46,7 +46,7 @@ public AutoscalingResources(ByteSizeValue storage, ByteSizeValue memory, Process public AutoscalingResources(StreamInput in) throws IOException { this.storage = in.readOptionalWriteable(ByteSizeValue::readFrom); this.memory = in.readOptionalWriteable(ByteSizeValue::readFrom); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { this.processors = in.readOptionalWriteable(Processors::readFrom); } else { this.processors = null; @@ -88,7 +88,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(storage); out.writeOptionalWriteable(memory); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeOptionalWriteable(processors); } } diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/FixedAutoscalingDeciderService.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/FixedAutoscalingDeciderService.java index 81d2122d71411..9c563eef9065e 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/FixedAutoscalingDeciderService.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/FixedAutoscalingDeciderService.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.autoscaling.capacity; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.node.DiscoveryNodeRole; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.io.stream.StreamInput; @@ -119,7 +119,7 @@ public FixedReason(StreamInput in) throws IOException { this.storage = in.readOptionalWriteable(ByteSizeValue::readFrom); this.memory = in.readOptionalWriteable(ByteSizeValue::readFrom); this.nodes = in.readInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { this.processors = in.readOptionalWriteable(Processors::readFrom); } else { this.processors = null; @@ -149,7 +149,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(storage); out.writeOptionalWriteable(memory); out.writeInt(nodes); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeOptionalWriteable(processors); } } diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java index 80fb948754403..6166aec8b590f 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.autoscaling.storage; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterInfo; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.DiskUsage; @@ -970,8 +971,8 @@ public Iterator toXContentChunked(ToXContent.Params params public static class ReactiveReason implements AutoscalingDeciderResult.Reason { static final int MAX_AMOUNT_OF_SHARDS = 512; - private static final TransportVersion SHARD_IDS_OUTPUT_VERSION = TransportVersion.V_8_4_0; - private static final TransportVersion UNASSIGNED_NODE_DECISIONS_OUTPUT_VERSION = TransportVersion.V_8_500_010; + private static final TransportVersion SHARD_IDS_OUTPUT_VERSION = TransportVersions.V_8_4_0; + private static final TransportVersion UNASSIGNED_NODE_DECISIONS_OUTPUT_VERSION = TransportVersions.V_8_500_010; private final String reason; private final long unassigned; diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CCRInfoTransportAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CCRInfoTransportAction.java index 68974c5ed3ecd..84586d6b2fa06 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CCRInfoTransportAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CCRInfoTransportAction.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.ccr; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.io.stream.StreamInput; @@ -89,7 +90,7 @@ public Usage(StreamInput in) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_0_0; + return TransportVersions.V_7_0_0; } public int getNumberOfFollowerIndices() { diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java index 752aab933fb81..2fef64be077c8 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java @@ -8,6 +8,7 @@ import org.apache.lucene.util.SetOnce; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.RequestValidators; @@ -143,7 +144,7 @@ public class Ccr extends Plugin implements ActionPlugin, PersistentTaskPlugin, E public static final String CCR_CUSTOM_METADATA_REMOTE_CLUSTER_NAME_KEY = "remote_cluster_name"; public static final String REQUESTED_OPS_MISSING_METADATA_KEY = "es.requested_operations_missing"; - public static final TransportVersion TRANSPORT_VERSION_ACTION_WITH_SHARD_ID = TransportVersion.V_8_500_010; + public static final TransportVersion TRANSPORT_VERSION_ACTION_WITH_SHARD_ID = TransportVersions.V_8_500_010; private final boolean enabled; private final Settings settings; diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/ShardChangesAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/ShardChangesAction.java index ccc97caceb365..d31a6f681cd9e 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/ShardChangesAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/ShardChangesAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ccr.action; import org.elasticsearch.ResourceNotFoundException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; @@ -266,7 +266,7 @@ public long getTookInMillis() { super(in); mappingVersion = in.readVLong(); settingsVersion = in.readVLong(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_3_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_3_0)) { aliasesVersion = in.readVLong(); } else { aliasesVersion = 0; @@ -302,7 +302,7 @@ public long getTookInMillis() { public void writeTo(final StreamOutput out) throws IOException { out.writeVLong(mappingVersion); out.writeVLong(settingsVersion); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_3_0)) { out.writeVLong(aliasesVersion); } out.writeZLong(globalCheckpoint); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetFeatureUsageResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetFeatureUsageResponse.java index df85a6dd94070..858681faa205d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetFeatureUsageResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetFeatureUsageResponse.java @@ -7,7 +7,7 @@ package org.elasticsearch.license; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -48,14 +48,14 @@ public FeatureUsageInfo( } public FeatureUsageInfo(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { this.family = in.readOptionalString(); } else { this.family = null; } this.name = in.readString(); this.lastUsedTime = ZonedDateTime.ofInstant(Instant.ofEpochSecond(in.readLong()), ZoneOffset.UTC); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_15_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_15_0)) { this.context = in.readOptionalString(); } else { this.context = null; @@ -65,12 +65,12 @@ public FeatureUsageInfo(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { out.writeOptionalString(this.family); } out.writeString(name); out.writeLong(lastUsedTime.toEpochSecond()); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_15_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_15_0)) { out.writeOptionalString(this.context); } out.writeString(licenseLevel); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicensesMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicensesMetadata.java index a13188b76c5f2..08c30a1670f61 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicensesMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicensesMetadata.java @@ -7,6 +7,7 @@ package org.elasticsearch.license; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.cluster.AbstractNamedDiffable; import org.elasticsearch.cluster.NamedDiff; @@ -107,7 +108,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackInfoRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackInfoRequest.java index 0cf1091ef28b2..2ac0139ac0309 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackInfoRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackInfoRequest.java @@ -7,6 +7,7 @@ package org.elasticsearch.protocol.xpack; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.StreamInput; @@ -97,6 +98,6 @@ public void writeTo(StreamOutput out) throws IOException { } private static boolean hasLicenseVersionField(TransportVersion streamVersion) { - return streamVersion.between(TransportVersion.V_7_8_1, TransportVersion.V_8_0_0); + return streamVersion.between(TransportVersions.V_7_8_1, TransportVersions.V_8_0_0); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackInfoResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackInfoResponse.java index 8f872dcb056a1..59fd1db1e72f2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackInfoResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackInfoResponse.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.protocol.xpack; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -361,7 +361,7 @@ public FeatureSet(String name, boolean available, boolean enabled) { public FeatureSet(StreamInput in) throws IOException { this(in.readString(), readAvailable(in), in.readBoolean()); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { in.readMap(); // backcompat reading native code info, but no longer used here } } @@ -369,7 +369,7 @@ public FeatureSet(StreamInput in) throws IOException { // this is separated out so that the removed description can be read from the stream on construction // TODO: remove this for 8.0 private static boolean readAvailable(StreamInput in) throws IOException { - if (in.getTransportVersion().before(TransportVersion.V_7_3_0)) { + if (in.getTransportVersion().before(TransportVersions.V_7_3_0)) { in.readOptionalString(); } return in.readBoolean(); @@ -378,12 +378,12 @@ private static boolean readAvailable(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(name); - if (out.getTransportVersion().before(TransportVersion.V_7_3_0)) { + if (out.getTransportVersion().before(TransportVersions.V_7_3_0)) { out.writeOptionalString(null); } out.writeBoolean(available); out.writeBoolean(enabled); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeGenericMap(Collections.emptyMap()); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/GraphExploreRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/GraphExploreRequest.java index 94604dbd8227c..2603002a2348b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/GraphExploreRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/GraphExploreRequest.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.protocol.xpack.graph; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.IndicesRequest; @@ -111,7 +111,7 @@ public GraphExploreRequest(StreamInput in) throws IOException { indices = in.readStringArray(); indicesOptions = IndicesOptions.readIndicesOptions(in); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { String[] types = in.readStringArray(); assert types.length == 0; } @@ -180,7 +180,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeStringArray(indices); indicesOptions.writeIndicesOptions(out); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { out.writeStringArray(Strings.EMPTY_ARRAY); } out.writeOptionalString(routing); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/action/MigrateToDataTiersResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/action/MigrateToDataTiersResponse.java index 4c4140ce9e33f..b9a5115a9fa1a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/action/MigrateToDataTiersResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/action/MigrateToDataTiersResponse.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.cluster.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -63,7 +63,7 @@ public MigrateToDataTiersResponse(StreamInput in) throws IOException { migratedPolicies = in.readStringCollectionAsList(); migratedIndices = in.readStringCollectionAsList(); dryRun = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_17_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0)) { migratedLegacyTemplates = in.readStringCollectionAsList(); migratedComposableTemplates = in.readStringCollectionAsList(); migratedComponentTemplates = in.readStringCollectionAsList(); @@ -154,7 +154,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeStringCollection(migratedPolicies); out.writeStringCollection(migratedIndices); out.writeBoolean(dryRun); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_17_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_17_0)) { out.writeStringCollection(migratedLegacyTemplates); out.writeStringCollection(migratedComposableTemplates); out.writeStringCollection(migratedComponentTemplates); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersFeatureSetUsage.java index ebc8bcf652865..0bf21f66b4888 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersFeatureSetUsage.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -42,7 +43,7 @@ public DataTiersFeatureSetUsage(Map tierStats) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_10_0; + return TransportVersions.V_7_10_0; } public Map getTierStats() { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/HealthApiFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/HealthApiFeatureSetUsage.java index 740ae58beef38..789a927dd6bf4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/HealthApiFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/HealthApiFeatureSetUsage.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.metrics.Counters; @@ -121,7 +122,7 @@ static void enrichUsageStatsWithValues(Map usageStats) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_7_0; + return TransportVersions.V_8_7_0; } public Map stats() { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/aggregatemetric/AggregateMetricFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/aggregatemetric/AggregateMetricFeatureSetUsage.java index 441e62326640b..56a2fad47cf2f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/aggregatemetric/AggregateMetricFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/aggregatemetric/AggregateMetricFeatureSetUsage.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.aggregatemetric; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; @@ -27,7 +28,7 @@ public AggregateMetricFeatureSetUsage(boolean available, boolean enabled) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_11_0; + return TransportVersions.V_7_11_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/AnalyticsFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/AnalyticsFeatureSetUsage.java index 4c5b198a7565b..89bd749f2ea1d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/AnalyticsFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/AnalyticsFeatureSetUsage.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.analytics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -47,7 +48,7 @@ protected void innerXContent(XContentBuilder builder, Params params) throws IOEx @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_4_0; + return TransportVersions.V_7_4_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/action/AnalyticsStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/action/AnalyticsStatsAction.java index d29b087acc6b8..ad4c54b0d0465 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/action/AnalyticsStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/action/AnalyticsStatsAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.analytics.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.FailedNodeException; import org.elasticsearch.action.support.nodes.BaseNodeResponse; @@ -144,15 +144,15 @@ public NodeResponse(DiscoveryNode node, EnumCounters counters) { public NodeResponse(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_8_0)) { counters = new EnumCounters<>(in, Item.class); } else { counters = new EnumCounters<>(Item.class); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { counters.inc(Item.BOXPLOT, in.readVLong()); } counters.inc(Item.CUMULATIVE_CARDINALITY, in.readZLong()); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { counters.inc(Item.STRING_STATS, in.readVLong()); counters.inc(Item.TOP_METRICS, in.readVLong()); } @@ -162,14 +162,14 @@ public NodeResponse(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_8_0)) { counters.writeTo(out); } else { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { out.writeVLong(counters.get(Item.BOXPLOT)); } out.writeZLong(counters.get(Item.CUMULATIVE_CARDINALITY)); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { out.writeVLong(counters.get(Item.STRING_STATS)); out.writeVLong(counters.get(Item.TOP_METRICS)); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/application/EnterpriseSearchFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/application/EnterpriseSearchFeatureSetUsage.java index 0d49c9e2a8c84..505d85c764b17 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/application/EnterpriseSearchFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/application/EnterpriseSearchFeatureSetUsage.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.application; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -21,8 +22,8 @@ public class EnterpriseSearchFeatureSetUsage extends XPackFeatureSet.Usage { - static final TransportVersion BEHAVIORAL_ANALYTICS_TRANSPORT_VERSION = TransportVersion.V_8_8_1; - static final TransportVersion QUERY_RULES_TRANSPORT_VERSION = TransportVersion.V_8_500_046; + static final TransportVersion BEHAVIORAL_ANALYTICS_TRANSPORT_VERSION = TransportVersions.V_8_8_1; + static final TransportVersion QUERY_RULES_TRANSPORT_VERSION = TransportVersions.V_8_500_046; public static final String SEARCH_APPLICATIONS = "search_applications"; public static final String ANALYTICS_COLLECTIONS = "analytics_collections"; @@ -80,7 +81,7 @@ public void writeTo(StreamOutput out) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_8_0; + return TransportVersions.V_8_8_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/archive/ArchiveFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/archive/ArchiveFeatureSetUsage.java index 79a386ce2147a..4201a30034786 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/archive/ArchiveFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/archive/ArchiveFeatureSetUsage.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.archive; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.ToXContent; @@ -29,7 +30,7 @@ public ArchiveFeatureSetUsage(StreamInput input) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_3_0; + return TransportVersions.V_8_3_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/AsyncTaskIndexService.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/AsyncTaskIndexService.java index be6c1a29bcc6f..e1fa08f3c9bea 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/AsyncTaskIndexService.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/AsyncTaskIndexService.java @@ -12,6 +12,7 @@ import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.delete.DeleteRequest; @@ -569,7 +570,7 @@ private void writeResponse(R response, OutputStream os) throws IOException { os = Streams.noCloseStream(os); TransportVersion minNodeVersion = clusterService.state().getMinTransportVersion(); TransportVersion.writeVersion(minNodeVersion, new OutputStreamStreamOutput(os)); - if (minNodeVersion.onOrAfter(TransportVersion.V_7_15_0)) { + if (minNodeVersion.onOrAfter(TransportVersions.V_7_15_0)) { os = CompressorFactory.COMPRESSOR.threadLocalOutputStream(os); } try (OutputStreamStreamOutput out = new OutputStreamStreamOutput(os)) { @@ -594,7 +595,7 @@ public int read() { }); TransportVersion version = TransportVersion.readVersion(new InputStreamStreamInput(encodedIn)); assert version.onOrBefore(TransportVersion.current()) : version + " >= " + TransportVersion.current(); - if (version.onOrAfter(TransportVersion.V_7_15_0)) { + if (version.onOrAfter(TransportVersions.V_7_15_0)) { encodedIn = CompressorFactory.COMPRESSOR.threadLocalInputStream(encodedIn); } try (StreamInput in = new NamedWriteableAwareStreamInput(new InputStreamStreamInput(encodedIn), registry)) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/AutoFollowMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/AutoFollowMetadata.java index c5e0e6f340ddc..f5620b557bf26 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/AutoFollowMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/AutoFollowMetadata.java @@ -8,6 +8,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.AbstractNamedDiffable; import org.elasticsearch.cluster.metadata.DataStream; import org.elasticsearch.cluster.metadata.IndexAbstraction; @@ -137,7 +138,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } @Override @@ -263,7 +264,7 @@ public static AutoFollowPattern readFrom(StreamInput in) throws IOException { final List leaderIndexPatterns = in.readStringCollectionAsList(); final String followIndexPattern = in.readOptionalString(); final Settings settings; - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_9_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_9_0)) { settings = Settings.readSettingsFromStream(in); } else { settings = Settings.EMPTY; @@ -283,12 +284,12 @@ private AutoFollowPattern( this.leaderIndexPatterns = leaderIndexPatterns; this.followIndexPattern = followIndexPattern; this.settings = Objects.requireNonNull(settings); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_5_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_5_0)) { this.active = in.readBoolean(); } else { this.active = true; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_14_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_14_0)) { this.leaderIndexExclusionPatterns = in.readStringCollectionAsList(); } else { this.leaderIndexExclusionPatterns = Collections.emptyList(); @@ -348,14 +349,14 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(remoteCluster); out.writeStringCollection(leaderIndexPatterns); out.writeOptionalString(followIndexPattern); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_9_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_9_0)) { settings.writeTo(out); } super.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_5_0)) { out.writeBoolean(active); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_14_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_14_0)) { out.writeStringCollection(leaderIndexExclusionPatterns); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/ShardFollowNodeTaskStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/ShardFollowNodeTaskStatus.java index 4be42f37a9cdc..e984b4363b4df 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/ShardFollowNodeTaskStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/ShardFollowNodeTaskStatus.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ccr; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -413,7 +413,7 @@ public ShardFollowNodeTaskStatus(final StreamInput in) throws IOException { this.writeBufferSizeInBytes = in.readVLong(); this.followerMappingVersion = in.readVLong(); this.followerSettingsVersion = in.readVLong(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_3_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_3_0)) { this.followerAliasesVersion = in.readVLong(); } else { this.followerAliasesVersion = 0L; @@ -457,7 +457,7 @@ public void writeTo(final StreamOutput out) throws IOException { out.writeVLong(writeBufferSizeInBytes); out.writeVLong(followerMappingVersion); out.writeVLong(followerSettingsVersion); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_3_0)) { out.writeVLong(followerAliasesVersion); } out.writeVLong(totalReadTimeMillis); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutAutoFollowPatternAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutAutoFollowPatternAction.java index 7d5bc0ff3f16e..8154067e72b18 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutAutoFollowPatternAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutAutoFollowPatternAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ccr.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; @@ -185,11 +185,11 @@ public Request(StreamInput in) throws IOException { remoteCluster = in.readString(); leaderIndexPatterns = in.readStringCollectionAsList(); followIndexNamePattern = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_9_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_9_0)) { settings = Settings.readSettingsFromStream(in); } parameters = new FollowParameters(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_14_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_14_0)) { leaderIndexExclusionPatterns = in.readStringCollectionAsList(); } } @@ -201,11 +201,11 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(remoteCluster); out.writeStringCollection(leaderIndexPatterns); out.writeOptionalString(followIndexNamePattern); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_9_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_9_0)) { settings.writeTo(out); } parameters.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_14_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_14_0)) { out.writeStringCollection(leaderIndexExclusionPatterns); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutFollowAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutFollowAction.java index 710d37b9c6c6f..0d8c120303cb5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutFollowAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutFollowAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ccr.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; @@ -193,12 +193,12 @@ public Request(StreamInput in) throws IOException { this.remoteCluster = in.readString(); this.leaderIndex = in.readString(); this.followerIndex = in.readString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_9_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_9_0)) { this.settings = Settings.readSettingsFromStream(in); } this.parameters = new FollowParameters(in); waitForActiveShards(ActiveShardCount.readFrom(in)); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { this.dataStreamName = in.readOptionalString(); } } @@ -209,12 +209,12 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(remoteCluster); out.writeString(leaderIndex); out.writeString(followerIndex); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_9_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_9_0)) { settings.writeTo(out); } parameters.writeTo(out); waitForActiveShards.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeOptionalString(this.dataStreamName); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ShardFollowTask.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ShardFollowTask.java index 7675f9c054ff6..4b2b840d6dfdc 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ShardFollowTask.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ShardFollowTask.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ccr.action; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -197,6 +198,6 @@ public String toString() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamFeatureSetUsage.java index 9fd73b660dd48..d411512275fc1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamFeatureSetUsage.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.datastreams; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -40,7 +41,7 @@ public void writeTo(StreamOutput out) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_9_0; + return TransportVersions.V_7_9_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamLifecycleFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamLifecycleFeatureSetUsage.java index e077334b20be6..3da65b93f802d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamLifecycleFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamLifecycleFeatureSetUsage.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.datastreams; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -47,7 +48,7 @@ public void writeTo(StreamOutput out) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_500_010; + return TransportVersions.V_8_500_010; } @Override @@ -111,7 +112,7 @@ public LifecycleStats( } public static LifecycleStats read(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { return new LifecycleStats(in.readVLong(), in.readVLong(), in.readVLong(), in.readDouble(), in.readBoolean()); } else { return INITIAL; @@ -120,7 +121,7 @@ public static LifecycleStats read(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeVLong(dataStreamsWithLifecyclesCount); out.writeVLong(minRetentionMillis); out.writeVLong(maxRetentionMillis); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/downsample/DownsampleIndexerAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/downsample/DownsampleIndexerAction.java index 5a7baa444b8c9..2949ddfdaf5f6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/downsample/DownsampleIndexerAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/downsample/DownsampleIndexerAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.downsample; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.downsample.DownsampleAction; @@ -69,7 +69,7 @@ public Request() {} public Request(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_030) && in.readBoolean()) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_030) && in.readBoolean()) { this.indexStartTimeMillis = in.readVLong(); this.indexEndTimeMillis = in.readVLong(); } else { @@ -132,7 +132,7 @@ public Task createTask(long id, String type, String action, TaskId parentTaskId, @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_030)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_030)) { out.writeBoolean(true); out.writeVLong(indexStartTimeMillis); out.writeVLong(indexEndTimeMillis); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/downsample/DownsampleShardStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/downsample/DownsampleShardStatus.java index b19afa5ee8c74..3190fb095cbca 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/downsample/DownsampleShardStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/downsample/DownsampleShardStatus.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.downsample; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -144,7 +144,7 @@ public DownsampleShardStatus(StreamInput in) throws IOException { numSent = in.readLong(); numIndexed = in.readLong(); numFailed = in.readLong(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_030) && in.readBoolean()) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_030) && in.readBoolean()) { totalShardDocCount = in.readVLong(); lastSourceTimestamp = in.readVLong(); lastTargetTimestamp = in.readVLong(); @@ -254,7 +254,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeLong(numSent); out.writeLong(numIndexed); out.writeLong(numFailed); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_030)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_030)) { out.writeBoolean(true); out.writeVLong(totalShardDocCount); out.writeVLong(lastSourceTimestamp); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichFeatureSetUsage.java index 8b5d85ec604be..ab058909761d7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichFeatureSetUsage.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.enrich; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; @@ -26,6 +27,6 @@ public EnrichFeatureSetUsage(StreamInput input) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_5_0; + return TransportVersions.V_7_5_0; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichMetadata.java index 76b26f947606f..0cd5d617752f4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichMetadata.java @@ -8,6 +8,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.AbstractNamedDiffable; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.io.stream.StreamInput; @@ -83,7 +84,7 @@ public EnumSet context() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_5_0; + return TransportVersions.V_7_5_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/EnrichStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/EnrichStatsAction.java index 33003e795db4c..c3b6253cf4def 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/EnrichStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/EnrichStatsAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.enrich.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; @@ -62,7 +62,7 @@ public Response(StreamInput in) throws IOException { super(in); executingPolicies = in.readCollectionAsList(ExecutingPolicy::new); coordinatorStats = in.readCollectionAsList(CoordinatorStats::new); - cacheStats = in.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0) ? in.readCollectionAsList(CacheStats::new) : null; + cacheStats = in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0) ? in.readCollectionAsList(CacheStats::new) : null; } public List getExecutingPolicies() { @@ -81,7 +81,7 @@ public List getCacheStats() { public void writeTo(StreamOutput out) throws IOException { out.writeCollection(executingPolicies); out.writeCollection(coordinatorStats); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { out.writeCollection(cacheStats); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyStatus.java index 89f9819409ca3..9b1eae2434d56 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyStatus.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.enrich.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.tasks.Task; @@ -46,7 +46,7 @@ public ExecuteEnrichPolicyStatus(ExecuteEnrichPolicyStatus status, String step) public ExecuteEnrichPolicyStatus(StreamInput in) throws IOException { this.phase = in.readString(); - this.step = in.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0) ? in.readOptionalString() : null; + this.step = in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0) ? in.readOptionalString() : null; } public String getPhase() { @@ -69,7 +69,7 @@ public String getWriteableName() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(phase); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { out.writeOptionalString(step); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/eql/EqlFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/eql/EqlFeatureSetUsage.java index 77ebc85f9a1e4..0f384ef2a66fa 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/eql/EqlFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/eql/EqlFeatureSetUsage.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.eql; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -53,7 +54,7 @@ public void writeTo(StreamOutput out) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_9_0; + return TransportVersions.V_7_9_0; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/esql/EsqlFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/esql/EsqlFeatureSetUsage.java index 6d191cc4cab3c..4f68ff1db6033 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/esql/EsqlFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/esql/EsqlFeatureSetUsage.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.esql; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -62,7 +63,7 @@ public void writeTo(StreamOutput out) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_500_062; + return TransportVersions.V_8_500_062; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/frozen/FrozenIndicesFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/frozen/FrozenIndicesFeatureSetUsage.java index a5976c14d67c8..a8702560e4804 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/frozen/FrozenIndicesFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/frozen/FrozenIndicesFeatureSetUsage.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.frozen; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -27,7 +28,7 @@ public FrozenIndicesFeatureSetUsage(StreamInput input) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_4_0; + return TransportVersions.V_7_4_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/graph/GraphFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/graph/GraphFeatureSetUsage.java index 9576be5c6ddbb..2ac1c11ce9147 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/graph/GraphFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/graph/GraphFeatureSetUsage.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.graph; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; @@ -25,7 +26,7 @@ public GraphFeatureSetUsage(boolean available, boolean enabled) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_0_0; + return TransportVersions.V_7_0_0; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AllocateAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AllocateAction.java index 6f0e41e89ca9f..04a04b5ef4f41 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AllocateAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AllocateAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ilm; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.client.internal.Client; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.routing.allocation.decider.ShardsLimitAllocationDecider; @@ -123,7 +123,7 @@ public AllocateAction( public AllocateAction(StreamInput in) throws IOException { this( in.readOptionalVInt(), - in.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0) ? in.readOptionalInt() : null, + in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0) ? in.readOptionalInt() : null, (Map) in.readGenericValue(), (Map) in.readGenericValue(), (Map) in.readGenericValue() @@ -153,7 +153,7 @@ public Map getRequire() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeOptionalVInt(numberOfReplicas); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { out.writeOptionalInt(totalShardsPerNode); } out.writeGenericValue(include); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DownsampleAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DownsampleAction.java index f3bcf95ad35d4..ca47453cbf563 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DownsampleAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DownsampleAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ilm; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.downsample.DownsampleConfig; import org.elasticsearch.client.internal.Client; import org.elasticsearch.cluster.health.ClusterHealthStatus; @@ -85,7 +85,7 @@ public DownsampleAction(final DateHistogramInterval fixedInterval, final TimeVal public DownsampleAction(StreamInput in) throws IOException { this( new DateHistogramInterval(in), - in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_054) + in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_054) ? TimeValue.parseTimeValue(in.readString(), WAIT_TIMEOUT_FIELD.getPreferredName()) : DEFAULT_WAIT_TIMEOUT ); @@ -94,7 +94,7 @@ public DownsampleAction(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { fixedInterval.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_054)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_054)) { out.writeString(waitTimeout.getStringRep()); } else { out.writeString(DEFAULT_WAIT_TIMEOUT.getStringRep()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponse.java index 879db231a99e3..890045101c35c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponse.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ilm; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; @@ -305,7 +305,7 @@ public IndexLifecycleExplainResponse(StreamInput in) throws IOException { repositoryName = in.readOptionalString(); snapshotName = in.readOptionalString(); shrinkIndexName = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { indexCreationDate = in.readOptionalLong(); } else { indexCreationDate = null; @@ -352,7 +352,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(repositoryName); out.writeOptionalString(snapshotName); out.writeOptionalString(shrinkIndexName); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { out.writeOptionalLong(indexCreationDate); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java index af82124667d96..cc2e54e5be247 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.admin.indices.rollover.RolloverConditions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -39,7 +40,7 @@ public IndexLifecycleFeatureSetUsage(StreamInput input) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_0_0; + return TransportVersions.V_7_0_0; } @Override @@ -426,12 +427,12 @@ public ActionConfigStats(StreamInput in) throws IOException { this.setPriorityPriority = in.readOptionalVInt(); this.shrinkMaxPrimaryShardSize = in.readOptionalWriteable(ByteSizeValue::readFrom); this.shrinkNumberOfShards = in.readOptionalVInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { this.rolloverMaxPrimaryShardDocs = in.readOptionalVLong(); } else { this.rolloverMaxPrimaryShardDocs = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { this.rolloverMinAge = in.readOptionalTimeValue(); this.rolloverMinDocs = in.readOptionalVLong(); this.rolloverMinPrimaryShardSize = in.readOptionalWriteable(ByteSizeValue::readFrom); @@ -457,10 +458,10 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalVInt(setPriorityPriority); out.writeOptionalWriteable(shrinkMaxPrimaryShardSize); out.writeOptionalVInt(shrinkNumberOfShards); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { out.writeOptionalVLong(rolloverMaxPrimaryShardDocs); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeOptionalTimeValue(rolloverMinAge); out.writeOptionalVLong(rolloverMinDocs); out.writeOptionalWriteable(rolloverMinPrimaryShardSize); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleMetadata.java index f7062f2383816..d4f2ecb36e95d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleMetadata.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; @@ -113,7 +114,7 @@ public Iterator toXContentChunked(ToXContent.Params ignore @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } @Override @@ -189,7 +190,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } static Diff readLifecyclePolicyDiffFrom(StreamInput in) throws IOException { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecycleOperationMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecycleOperationMetadata.java index a468058e82f5d..529eb16b668c3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecycleOperationMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecycleOperationMetadata.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.NamedDiff; @@ -126,7 +127,7 @@ public Iterator toXContentChunked(ToXContent.Params params @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_7_0; + return TransportVersions.V_8_7_0; } @Override @@ -196,7 +197,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_7_0; + return TransportVersions.V_8_7_0; } } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverAction.java index 961b06a943739..515941bce841a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ilm; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.admin.indices.rollover.RolloverConditions; import org.elasticsearch.client.internal.Client; import org.elasticsearch.common.Strings; @@ -88,10 +88,10 @@ public static RolloverAction read(StreamInput in) throws IOException { builder.addMaxPrimaryShardSizeCondition(in.readOptionalWriteable(ByteSizeValue::readFrom)); builder.addMaxIndexAgeCondition(in.readOptionalTimeValue()); builder.addMaxIndexDocsCondition(in.readOptionalVLong()); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { builder.addMaxPrimaryShardDocsCondition(in.readOptionalVLong()); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { builder.addMinIndexSizeCondition(in.readOptionalWriteable(ByteSizeValue::readFrom)); builder.addMinPrimaryShardSizeCondition(in.readOptionalWriteable(ByteSizeValue::readFrom)); builder.addMinIndexAgeCondition(in.readOptionalTimeValue()); @@ -106,7 +106,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(conditions.getMaxSize()); out.writeOptionalWriteable(conditions.getMaxPrimaryShardSize()); out.writeOptionalTimeValue(conditions.getMaxAge()); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { out.writeOptionalVLong(conditions.getMaxDocs()); out.writeOptionalVLong(conditions.getMaxPrimaryShardDocs()); } else { @@ -117,7 +117,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalVLong(conditions.getMaxDocs()); } } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeOptionalWriteable(conditions.getMinSize()); out.writeOptionalWriteable(conditions.getMinPrimaryShardSize()); out.writeOptionalTimeValue(conditions.getMinAge()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/IndexerJobStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/IndexerJobStats.java index 1bdc35962f7fe..a13cdf1966811 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/IndexerJobStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/IndexerJobStats.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.indexing; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -84,7 +84,7 @@ public IndexerJobStats(StreamInput in) throws IOException { this.indexFailures = in.readVLong(); this.searchFailures = in.readVLong(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { this.processingTime = in.readVLong(); this.processingTotal = in.readVLong(); } @@ -205,7 +205,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(searchTotal); out.writeVLong(indexFailures); out.writeVLong(searchFailures); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_7_0)) { out.writeVLong(processingTime); out.writeVLong(processingTotal); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/logstash/LogstashFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/logstash/LogstashFeatureSetUsage.java index 3152a780730f8..a83b8439aa612 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/logstash/LogstashFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/logstash/LogstashFeatureSetUsage.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.logstash; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; @@ -25,7 +26,7 @@ public LogstashFeatureSetUsage(boolean available) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_0_0; + return TransportVersions.V_7_0_0; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MachineLearningFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MachineLearningFeatureSetUsage.java index 515def6fb56e8..ef2e5324678a4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MachineLearningFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MachineLearningFeatureSetUsage.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ml; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -65,7 +66,7 @@ public MachineLearningFeatureSetUsage(StreamInput in) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_0_0; + return TransportVersions.V_7_0_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MlMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MlMetadata.java index db0509801acf3..e791f5f474f5c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MlMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MlMetadata.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ml; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; @@ -66,7 +67,7 @@ public boolean isResetMode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } @Override @@ -85,7 +86,7 @@ public Diff diff(Metadata.Custom previousState) { } public MlMetadata(StreamInput in) throws IOException { - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { int size = in.readVInt(); for (int i = 0; i < size; i++) { in.readString(); @@ -103,7 +104,7 @@ public MlMetadata(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { writeMap(Collections.emptySortedMap(), out); writeMap(Collections.emptySortedMap(), out); } @@ -138,7 +139,7 @@ public static class MlMetadataDiff implements NamedDiff { } public MlMetadataDiff(StreamInput in) throws IOException { - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { DiffableUtils.readJdkMapDiff(in, DiffableUtils.getStringKeySerializer(), Job::new, MlMetadataDiff::readJobDiffFrom); DiffableUtils.readJdkMapDiff( in, @@ -163,7 +164,7 @@ public Metadata.Custom apply(Metadata.Custom part) { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { SortedMap jobs = Collections.emptySortedMap(); DiffableUtils.diff(jobs, jobs, DiffableUtils.getStringKeySerializer()).writeTo(out); SortedMap datafeeds = Collections.emptySortedMap(); @@ -180,7 +181,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } static Diff readJobDiffFrom(StreamInput in) throws IOException { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteJobAction.java index 37cf558c2b8c2..a101865c6c175 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteJobAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; @@ -52,7 +52,7 @@ public Request(StreamInput in) throws IOException { super(in); jobId = in.readString(); force = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { deleteUserAnnotations = in.readBoolean(); } else { deleteUserAnnotations = false; @@ -110,7 +110,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeString(jobId); out.writeBoolean(force); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeBoolean(deleteUserAnnotations); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteTrainedModelAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteTrainedModelAction.java index ae1d787e8a11a..fb71884c07c4b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteTrainedModelAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteTrainedModelAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; @@ -41,7 +41,7 @@ public static class Request extends AcknowledgedRequest implements ToXC public Request(StreamInput in) throws IOException { super(in); id = in.readString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { force = in.readBoolean(); } else { force = false; @@ -88,7 +88,7 @@ public boolean equals(Object o) { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeString(id); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { out.writeBoolean(force); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FlushJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FlushJobAction.java index ff85727ef0c62..02dc7b7ead8bf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FlushJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FlushJobAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.tasks.BaseTasksResponse; import org.elasticsearch.common.io.stream.StreamInput; @@ -79,7 +79,7 @@ public Request(StreamInput in) throws IOException { advanceTime = in.readOptionalString(); skipTime = in.readOptionalString(); waitForNormalization = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_012)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_012)) { refreshRequired = in.readBoolean(); } } @@ -93,7 +93,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(advanceTime); out.writeOptionalString(skipTime); out.writeBoolean(waitForNormalization); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_012)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_012)) { out.writeBoolean(refreshRequired); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedRunningStateAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedRunningStateAction.java index e387c0a2c57b5..413bc58e6332d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedRunningStateAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedRunningStateAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.tasks.BaseTasksRequest; import org.elasticsearch.action.support.tasks.BaseTasksResponse; @@ -100,7 +100,7 @@ public RunningState(boolean realTimeConfigured, boolean realTimeRunning, @Nullab public RunningState(StreamInput in) throws IOException { this.realTimeConfigured = in.readBoolean(); this.realTimeRunning = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { this.searchInterval = in.readOptionalWriteable(SearchInterval::new); } else { this.searchInterval = null; @@ -126,7 +126,7 @@ public int hashCode() { public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(realTimeConfigured); out.writeBoolean(realTimeRunning); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { out.writeOptionalWriteable(searchInterval); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsAction.java index f6a35efe637fc..11f2a4191afe8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionType; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -118,7 +118,7 @@ public TrainedModelStats( public TrainedModelStats(StreamInput in) throws IOException { modelId = in.readString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { modelSizeStats = in.readOptionalWriteable(TrainedModelSizeStats::new); } else { modelSizeStats = null; @@ -126,7 +126,7 @@ public TrainedModelStats(StreamInput in) throws IOException { ingestStats = IngestStats.read(in); pipelineCount = in.readVInt(); inferenceStats = in.readOptionalWriteable(InferenceStats::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { this.deploymentStats = in.readOptionalWriteable(AssignmentStats::new); } else { this.deploymentStats = null; @@ -182,13 +182,13 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(modelId); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeOptionalWriteable(modelSizeStats); } ingestStats.writeTo(out); out.writeVInt(pipelineCount); out.writeOptionalWriteable(inferenceStats); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeOptionalWriteable(deploymentStats); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferModelAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferModelAction.java index 39fe8415f36fd..fdc4040b0be49 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferModelAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferModelAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; @@ -150,17 +150,17 @@ public Request(StreamInput in) throws IOException { this.objectsToInfer = in.readCollectionAsImmutableList(StreamInput::readMap); this.update = in.readNamedWriteable(InferenceConfigUpdate.class); this.previouslyLicensed = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { this.inferenceTimeout = in.readTimeValue(); } else { this.inferenceTimeout = TimeValue.MAX_VALUE; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { textInput = in.readOptionalStringCollectionAsList(); } else { textInput = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { highPriority = in.readBoolean(); } } @@ -222,13 +222,13 @@ public void writeTo(StreamOutput out) throws IOException { out.writeCollection(objectsToInfer, StreamOutput::writeGenericMap); out.writeNamedWriteable(update); out.writeBoolean(previouslyLicensed); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { out.writeTimeValue(inferenceTimeout); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeOptionalStringCollection(textInput); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeBoolean(highPriority); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentAction.java index cf2b054c869c7..916f09c84b6f5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.tasks.BaseTasksRequest; @@ -148,10 +148,10 @@ public Request(StreamInput in) throws IOException { docs = in.readCollectionAsImmutableList(StreamInput::readMap); update = in.readOptionalNamedWriteable(InferenceConfigUpdate.class); inferenceTimeout = in.readOptionalTimeValue(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { highPriority = in.readBoolean(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { textInput = in.readOptionalStringCollectionAsList(); } else { textInput = null; @@ -220,10 +220,10 @@ public void writeTo(StreamOutput out) throws IOException { out.writeCollection(docs, StreamOutput::writeGenericMap); out.writeOptionalNamedWriteable(update); out.writeOptionalTimeValue(inferenceTimeout); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { out.writeBoolean(highPriority); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeOptionalStringCollection(textInput); } } @@ -320,7 +320,7 @@ public Response(StreamInput in) throws IOException { super(in); // Multiple results added in 8.6.1 - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_6_1)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_6_1)) { results = in.readNamedWriteableCollectionAsList(InferenceResults.class); } else { results = List.of(in.readNamedWriteable(InferenceResults.class)); @@ -331,7 +331,7 @@ public Response(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_6_1)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_6_1)) { out.writeNamedWriteableCollection(results); } else { out.writeNamedWriteable(results.get(0)); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/OpenJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/OpenJobAction.java index 1b7819c38eab9..9fad95d49158e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/OpenJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/OpenJobAction.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.MasterNodeRequest; @@ -230,7 +231,7 @@ public String toString() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedAction.java index 5faf4b545ef71..c63dd20651be4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; @@ -85,7 +85,7 @@ public Request(StreamInput in) throws IOException { datafeedId = in.readString(); datafeedConfig = in.readOptionalWriteable(DatafeedConfig::new); jobConfig = in.readOptionalWriteable(Job.Builder::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { this.startTime = in.readOptionalLong(); this.endTime = in.readOptionalLong(); } else { @@ -163,7 +163,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(datafeedId); out.writeOptionalWriteable(datafeedConfig); out.writeOptionalWriteable(jobConfig); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { out.writeOptionalLong(startTime); out.writeOptionalLong(endTime); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelAction.java index affba6f6eafb3..5f81290261232 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; @@ -82,7 +82,7 @@ public Request(StreamInput in) throws IOException { super(in); this.config = new TrainedModelConfig(in); this.deferDefinitionDecompression = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { this.waitForCompletion = in.readBoolean(); } else { this.waitForCompletion = false; @@ -122,7 +122,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); config.writeTo(out); out.writeBoolean(deferDefinitionDecompression); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeBoolean(waitForCompletion); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelDefinitionPartAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelDefinitionPartAction.java index 444758962fcee..61b39e40a065c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelDefinitionPartAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelDefinitionPartAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; @@ -91,7 +91,7 @@ public Request(StreamInput in) throws IOException { this.part = in.readVInt(); this.totalDefinitionLength = in.readVLong(); this.totalParts = in.readVInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_043)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_043)) { this.allowOverwriting = in.readBoolean(); } else { this.allowOverwriting = false; @@ -148,7 +148,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVInt(part); out.writeVLong(totalDefinitionLength); out.writeVInt(totalParts); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_043)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_043)) { out.writeBoolean(allowOverwriting); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelVocabularyAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelVocabularyAction.java index 0f4ba65765714..de2e3fcb153c3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelVocabularyAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelVocabularyAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; @@ -81,17 +81,17 @@ public Request(StreamInput in) throws IOException { super(in); this.modelId = in.readString(); this.vocabulary = in.readStringCollectionAsList(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { this.merges = in.readStringCollectionAsList(); } else { this.merges = List.of(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { this.scores = in.readCollectionAsList(StreamInput::readDouble); } else { this.scores = List.of(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_043)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_043)) { this.allowOverwriting = in.readBoolean(); } else { this.allowOverwriting = false; @@ -133,13 +133,13 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeString(modelId); out.writeStringCollection(vocabulary); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { out.writeStringCollection(merges); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeCollection(scores, StreamOutput::writeDouble); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_043)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_043)) { out.writeBoolean(allowOverwriting); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ResetJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ResetJobAction.java index 904d4274b7e03..d9b900cc465d5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ResetJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ResetJobAction.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; @@ -30,7 +31,7 @@ public class ResetJobAction extends ActionType { public static final String NAME = "cluster:admin/xpack/ml/job/reset"; public static final ResetJobAction INSTANCE = new ResetJobAction(); - public static final TransportVersion TRANSPORT_VERSION_INTRODUCED = TransportVersion.V_7_14_0; + public static final TransportVersion TRANSPORT_VERSION_INTRODUCED = TransportVersions.V_7_14_0; private ResetJobAction() { super(NAME, AcknowledgedResponse::readFrom); @@ -64,7 +65,7 @@ public Request(StreamInput in) throws IOException { super(in); jobId = in.readString(); skipJobStateValidation = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { deleteUserAnnotations = in.readBoolean(); } else { deleteUserAnnotations = false; @@ -76,7 +77,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeString(jobId); out.writeBoolean(skipJobStateValidation); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeBoolean(deleteUserAnnotations); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsAction.java index 37893ae274177..dd56eec10200b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsAction.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; @@ -146,7 +147,7 @@ public String toString() { public static class TaskParams implements PersistentTaskParams, MlTaskParams { public static final MlConfigVersion VERSION_INTRODUCED = MlConfigVersion.V_7_3_0; - public static final TransportVersion TRANSPORT_VERSION_INTRODUCED = TransportVersion.V_7_3_0; + public static final TransportVersion TRANSPORT_VERSION_INTRODUCED = TransportVersions.V_7_3_0; public static final Version VERSION_DESTINATION_INDEX_MAPPINGS_CHANGED = Version.V_7_10_0; public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedAction.java index ec6e21b758605..c664cf97ba2a1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedAction.java @@ -8,6 +8,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ValidateActions; @@ -276,7 +277,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentAction.java index fa219e233cfb2..b00dcfd731aee 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.MasterNodeRequest; @@ -155,16 +155,16 @@ public Request(StreamInput in) throws IOException { numberOfAllocations = in.readVInt(); threadsPerAllocation = in.readVInt(); queueCapacity = in.readVInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { this.cacheSize = in.readOptionalWriteable(ByteSizeValue::readFrom); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { this.priority = in.readEnum(Priority.class); } else { this.priority = Priority.NORMAL; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { this.deploymentId = in.readString(); } else { this.deploymentId = modelId; @@ -253,13 +253,13 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVInt(numberOfAllocations); out.writeVInt(threadsPerAllocation); out.writeVInt(queueCapacity); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeOptionalWriteable(cacheSize); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { out.writeEnum(priority); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeString(deploymentId); } } @@ -509,17 +509,17 @@ public TaskParams(StreamInput in) throws IOException { this.threadsPerAllocation = in.readVInt(); this.numberOfAllocations = in.readVInt(); this.queueCapacity = in.readVInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { this.cacheSize = in.readOptionalWriteable(ByteSizeValue::readFrom); } else { this.cacheSize = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { this.priority = in.readEnum(Priority.class); } else { this.priority = Priority.NORMAL; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { this.deploymentId = in.readString(); } else { this.deploymentId = modelId; @@ -575,13 +575,13 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVInt(threadsPerAllocation); out.writeVInt(numberOfAllocations); out.writeVInt(queueCapacity); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeOptionalWriteable(cacheSize); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { out.writeEnum(priority); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeString(deploymentId); } if (out.getTransportVersion().onOrAfter(TrainedModelConfig.VERSION_ALLOCATION_MEMORY_ADDED)) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopTrainedModelDeploymentAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopTrainedModelDeploymentAction.java index 1588c6cab514a..5f62a48e761da 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopTrainedModelDeploymentAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopTrainedModelDeploymentAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.tasks.BaseTasksRequest; import org.elasticsearch.action.support.tasks.BaseTasksResponse; @@ -79,7 +79,7 @@ public Request(StreamInput in) throws IOException { allowNoMatch = in.readBoolean(); force = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_068)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_068)) { finishPendingWork = in.readBoolean(); } else { finishPendingWork = false; @@ -132,7 +132,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(allowNoMatch); out.writeBoolean(force); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_068)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_068)) { out.writeBoolean(finishPendingWork); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/AggProvider.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/AggProvider.java index d5e39cf75ec27..d994647743634 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/AggProvider.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/AggProvider.java @@ -8,7 +8,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -117,7 +117,7 @@ static AggProvider fromStream(StreamInput in) throws IOException { in.readMap(), in.readOptionalWriteable(AggregatorFactories.Builder::new), in.readException(), - in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0) ? in.readBoolean() : false + in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0) ? in.readBoolean() : false ); } @@ -140,7 +140,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeGenericMap(aggs); out.writeOptionalWriteable(parsedAggs); out.writeException(parsingException); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeBoolean(rewroteAggs); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfig.java index 25d76ba88cfe1..bff15c016af0e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfig.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.dataframe; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -191,7 +191,7 @@ public DataFrameAnalyticsConfig(StreamInput in) throws IOException { this.version = in.readBoolean() ? MlConfigVersion.readVersion(in) : null; this.allowLazyStart = in.readBoolean(); this.maxNumThreads = in.readVInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { Map readMeta = in.readMap(); this.meta = readMeta == null ? null : Collections.unmodifiableMap(readMeta); } else { @@ -319,7 +319,7 @@ public void writeTo(StreamOutput out) throws IOException { } out.writeBoolean(allowLazyStart); out.writeVInt(maxNumThreads); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeGenericMap(meta); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigUpdate.java index 7af2a4dc63158..330683981d1ca 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigUpdate.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.dataframe; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -83,7 +83,7 @@ public DataFrameAnalyticsConfigUpdate(StreamInput in) throws IOException { this.modelMemoryLimit = in.readOptionalWriteable(ByteSizeValue::readFrom); this.allowLazyStart = in.readOptionalBoolean(); this.maxNumThreads = in.readOptionalVInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { Map readMeta = in.readMap(); this.meta = readMeta == null ? null : Collections.unmodifiableMap(readMeta); } else { @@ -98,7 +98,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(modelMemoryLimit); out.writeOptionalBoolean(allowLazyStart); out.writeOptionalVInt(maxNumThreads); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeGenericMap(meta); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelConfig.java index dedeed44d2e86..9d4442f877b85 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelConfig.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; @@ -103,8 +104,8 @@ public class TrainedModelConfig implements ToXContentObject, Writeable { public static final ParseField PER_DEPLOYMENT_MEMORY_BYTES = new ParseField("per_deployment_memory_bytes"); public static final ParseField PER_ALLOCATION_MEMORY_BYTES = new ParseField("per_allocation_memory_bytes"); - public static final TransportVersion VERSION_3RD_PARTY_CONFIG_ADDED = TransportVersion.V_8_0_0; - public static final TransportVersion VERSION_ALLOCATION_MEMORY_ADDED = TransportVersion.V_8_500_064; + public static final TransportVersion VERSION_3RD_PARTY_CONFIG_ADDED = TransportVersions.V_8_0_0; + public static final TransportVersion VERSION_ALLOCATION_MEMORY_ADDED = TransportVersions.V_8_500_064; // These parsers follow the pattern that metadata is parsed leniently (to allow for enhancements), whilst config is parsed strictly public static final ObjectParser LENIENT_PARSER = createParser(true); @@ -271,7 +272,7 @@ public TrainedModelConfig(StreamInput in) throws IOException { this.modelType = null; this.location = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { modelPackageConfig = in.readOptionalWriteable(ModelPackageConfig::new); fullDefinition = in.readOptionalBoolean(); } else { @@ -446,7 +447,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalNamedWriteable(location); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeOptionalWriteable(modelPackageConfig); out.writeOptionalBoolean(fullDefinition); } @@ -1045,7 +1046,7 @@ public static LazyModelDefinition fromBase64String(String base64String) { } public static LazyModelDefinition fromStreamInput(StreamInput input) throws IOException { - if (input.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (input.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { return new LazyModelDefinition(input.readBytesReference(), null); } else { return fromBase64String(input.readString()); @@ -1109,7 +1110,7 @@ private void ensureParsedDefinitionUnsafe(NamedXContentRegistry xContentRegistry @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeBytesReference(getCompressedDefinition()); } else { out.writeString(getBase64CompressedDefinition()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/AssignmentStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/AssignmentStats.java index 303cfaaba3870..d8e5d7a6d9603 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/AssignmentStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/AssignmentStats.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.assignment; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -163,7 +163,7 @@ public NodeStats(StreamInput in) throws IOException { this.pendingCount = in.readOptionalVInt(); this.routingState = in.readOptionalWriteable(RoutingStateAndReason::new); this.startTime = in.readOptionalInstant(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { this.threadsPerAllocation = in.readOptionalVInt(); this.numberOfAllocations = in.readOptionalVInt(); this.errorCount = in.readVInt(); @@ -176,7 +176,7 @@ public NodeStats(StreamInput in) throws IOException { this.rejectedExecutionCount = 0; this.timeoutCount = 0; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { this.peakThroughput = in.readVLong(); this.throughputLastPeriod = in.readVLong(); this.avgInferenceTimeLastPeriod = in.readOptionalDouble(); @@ -185,14 +185,14 @@ public NodeStats(StreamInput in) throws IOException { this.throughputLastPeriod = 0; this.avgInferenceTimeLastPeriod = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { this.cacheHitCount = in.readOptionalVLong(); this.cacheHitCountLastPeriod = in.readOptionalVLong(); } else { this.cacheHitCount = null; this.cacheHitCountLastPeriod = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { this.avgInferenceTimeExcludingCacheHit = in.readOptionalDouble(); } else { this.avgInferenceTimeExcludingCacheHit = null; @@ -342,23 +342,23 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalVInt(pendingCount); out.writeOptionalWriteable(routingState); out.writeOptionalInstant(startTime); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { out.writeOptionalVInt(threadsPerAllocation); out.writeOptionalVInt(numberOfAllocations); out.writeVInt(errorCount); out.writeVInt(rejectedExecutionCount); out.writeVInt(timeoutCount); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { out.writeVLong(peakThroughput); out.writeVLong(throughputLastPeriod); out.writeOptionalDouble(avgInferenceTimeLastPeriod); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeOptionalVLong(cacheHitCount); out.writeOptionalVLong(cacheHitCountLastPeriod); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { out.writeOptionalDouble(avgInferenceTimeExcludingCacheHit); } } @@ -464,17 +464,17 @@ public AssignmentStats(StreamInput in) throws IOException { state = in.readOptionalEnum(AssignmentState.class); reason = in.readOptionalString(); allocationStatus = in.readOptionalWriteable(AllocationStatus::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { cacheSize = in.readOptionalWriteable(ByteSizeValue::readFrom); } else { cacheSize = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { priority = in.readEnum(Priority.class); } else { priority = Priority.NORMAL; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { deploymentId = in.readString(); } else { deploymentId = modelId; @@ -633,20 +633,20 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalVInt(queueCapacity); out.writeInstant(startTime); out.writeCollection(nodeStats); - if (AssignmentState.FAILED.equals(state) && out.getTransportVersion().before(TransportVersion.V_8_4_0)) { + if (AssignmentState.FAILED.equals(state) && out.getTransportVersion().before(TransportVersions.V_8_4_0)) { out.writeOptionalEnum(AssignmentState.STARTING); } else { out.writeOptionalEnum(state); } out.writeOptionalString(reason); out.writeOptionalWriteable(allocationStatus); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeOptionalWriteable(cacheSize); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { out.writeEnum(priority); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeString(deploymentId); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/RoutingInfo.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/RoutingInfo.java index 14886f42be877..fd2f3627e3fb1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/RoutingInfo.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/RoutingInfo.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.assignment; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -67,7 +67,7 @@ public RoutingInfo(int currentAllocations, int targetAllocations, RoutingState s } public RoutingInfo(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { this.currentAllocations = in.readVInt(); this.targetAllocations = in.readVInt(); } else { @@ -101,7 +101,7 @@ public boolean isOutdated() { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeVInt(currentAllocations); out.writeVInt(targetAllocations); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/RoutingInfoUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/RoutingInfoUpdate.java index 17195c2203da8..8458db7a3d641 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/RoutingInfoUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/RoutingInfoUpdate.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.assignment; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -35,7 +35,7 @@ private RoutingInfoUpdate(Optional numberOfAllocations, Optional { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/EmptyConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/EmptyConfigUpdate.java index f5287769e64a6..0ba74df1f8d54 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/EmptyConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/EmptyConfigUpdate.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xpack.core.ml.MlConfigVersion; @@ -68,7 +69,7 @@ public int hashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_9_0; + return TransportVersions.V_7_9_0; } public static class Builder implements InferenceConfigUpdate.Builder { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfig.java index 01035cdf8d2c9..24b7a95c9ccac 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfig.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -139,7 +140,7 @@ public MlConfigVersion getMinimalSupportedMlConfigVersion() { @Override public TransportVersion getMinimalSupportedTransportVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdate.java index 1518db7df713c..cb081aa48d0a2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdate.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.ObjectParser; @@ -104,7 +105,7 @@ public String getName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java index 0f0d38a7ea2ef..e7f3a66b6748f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -163,7 +164,7 @@ public MlConfigVersion getMinimalSupportedMlConfigVersion() { @Override public TransportVersion getMinimalSupportedTransportVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java index 8a685e46733ab..884ecb39df448 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.ObjectParser; @@ -147,7 +148,7 @@ public int hashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } public static class Builder implements InferenceConfigUpdate.Builder { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfigUpdate.java index fc9b1bee1a4be..92e44edcd1259 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfigUpdate.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -82,7 +82,7 @@ public NlpConfigUpdate(@Nullable TokenizationUpdate tokenizationUpdate) { } public NlpConfigUpdate(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { tokenizationUpdate = in.readOptionalNamedWriteable(TokenizationUpdate.class); } else { tokenizationUpdate = null; @@ -91,7 +91,7 @@ public NlpConfigUpdate(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { out.writeOptionalNamedWriteable(tokenizationUpdate); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfig.java index b8e953da3dbb3..74ca76779d4b2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfig.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -126,7 +127,7 @@ public MlConfigVersion getMinimalSupportedMlConfigVersion() { @Override public TransportVersion getMinimalSupportedTransportVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdate.java index 736cfb8644613..874f82dc019ca 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdate.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.ObjectParser; @@ -149,7 +150,7 @@ public int hashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } public static class Builder implements InferenceConfigUpdate.Builder { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/QuestionAnsweringConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/QuestionAnsweringConfig.java index 311f3f9c1381a..7572d757f2b5f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/QuestionAnsweringConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/QuestionAnsweringConfig.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -194,7 +195,7 @@ public MlConfigVersion getMinimalSupportedMlConfigVersion() { @Override public TransportVersion getMinimalSupportedTransportVersion() { - return TransportVersion.V_8_3_0; + return TransportVersions.V_8_3_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/QuestionAnsweringConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/QuestionAnsweringConfigUpdate.java index 6e980564ba27a..40657544a14d5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/QuestionAnsweringConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/QuestionAnsweringConfigUpdate.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -253,6 +254,6 @@ public QuestionAnsweringConfigUpdate build() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_3_0; + return TransportVersions.V_8_3_0; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java index 48d1866ec4b9a..04365d5c7ec1c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.ObjectParser; @@ -22,7 +23,7 @@ public class RegressionConfig implements LenientlyParsedInferenceConfig, Strictl public static final ParseField NAME = new ParseField("regression"); private static final MlConfigVersion MIN_SUPPORTED_VERSION = MlConfigVersion.V_7_6_0; - private static final TransportVersion MIN_SUPPORTED_TRANSPORT_VERSION = TransportVersion.V_7_6_0; + private static final TransportVersion MIN_SUPPORTED_TRANSPORT_VERSION = TransportVersions.V_7_6_0; public static final ParseField RESULTS_FIELD = new ParseField("results_field"); public static final ParseField NUM_TOP_FEATURE_IMPORTANCE_VALUES = new ParseField("num_top_feature_importance_values"); @@ -142,7 +143,7 @@ public MlConfigVersion getMinimalSupportedMlConfigVersion() { @Override public TransportVersion getMinimalSupportedTransportVersion() { - return requestingImportance() ? TransportVersion.V_7_7_0 : MIN_SUPPORTED_TRANSPORT_VERSION; + return requestingImportance() ? TransportVersions.V_7_7_0 : MIN_SUPPORTED_TRANSPORT_VERSION; } public static Builder builder() { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdate.java index 4c187ef28416b..a678806181ef8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdate.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.ObjectParser; @@ -113,7 +114,7 @@ public String getName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_8_0; + return TransportVersions.V_7_8_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ResultsFieldUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ResultsFieldUpdate.java index 514c48e6c42fa..fe1fb9844610d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ResultsFieldUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ResultsFieldUpdate.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; @@ -71,7 +72,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_9_0; + return TransportVersions.V_7_9_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java index 88670f08f1cd2..ab50f26636fc4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -139,7 +140,7 @@ public MlConfigVersion getMinimalSupportedMlConfigVersion() { @Override public TransportVersion getMinimalSupportedTransportVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdate.java index b5082a8e462f9..460a3a685d534 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdate.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.ObjectParser; @@ -99,7 +100,7 @@ public String getName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java index da67c26df0968..518b9eb62d793 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -102,7 +103,7 @@ public TextEmbeddingConfig(StreamInput in) throws IOException { vocabularyConfig = new VocabularyConfig(in); tokenization = in.readNamedWriteable(Tokenization.class); resultsField = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { embeddingSize = in.readOptionalVInt(); } else { embeddingSize = null; @@ -134,7 +135,7 @@ public void writeTo(StreamOutput out) throws IOException { vocabularyConfig.writeTo(out); out.writeNamedWriteable(tokenization); out.writeOptionalString(resultsField); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeOptionalVInt(embeddingSize); } } @@ -151,7 +152,7 @@ public MlConfigVersion getMinimalSupportedMlConfigVersion() { @Override public TransportVersion getMinimalSupportedTransportVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java index 68d89718ffa11..6acd2d209a875 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.ObjectParser; @@ -100,7 +101,7 @@ public String getName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextExpansionConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextExpansionConfig.java index 5631db5a2d7eb..d8315bec14153 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextExpansionConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextExpansionConfig.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -132,7 +133,7 @@ public MlConfigVersion getMinimalSupportedMlConfigVersion() { @Override public TransportVersion getMinimalSupportedTransportVersion() { - return TransportVersion.V_8_7_0; + return TransportVersions.V_8_7_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextExpansionConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextExpansionConfigUpdate.java index 5102e509aa10a..181cadbaf7168 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextExpansionConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextExpansionConfigUpdate.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -161,7 +162,7 @@ public String toString() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_7_0; + return TransportVersions.V_8_7_0; } public static class Builder implements InferenceConfigUpdate.Builder { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextSimilarityConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextSimilarityConfig.java index 96b2f9e54fc5d..5511df03e6f36 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextSimilarityConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextSimilarityConfig.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -155,7 +156,7 @@ public MlConfigVersion getMinimalSupportedMlConfigVersion() { @Override public TransportVersion getMinimalSupportedTransportVersion() { - return TransportVersion.V_8_5_0; + return TransportVersions.V_8_5_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextSimilarityConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextSimilarityConfigUpdate.java index bd4788393a40c..c7afacc07b944 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextSimilarityConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextSimilarityConfigUpdate.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -211,6 +212,6 @@ public TextSimilarityConfigUpdate build() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_5_0; + return TransportVersions.V_8_5_0; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/Tokenization.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/Tokenization.java index 444726d6a9479..ef437e0201510 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/Tokenization.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/Tokenization.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -125,7 +125,7 @@ public Tokenization(StreamInput in) throws IOException { this.withSpecialTokens = in.readBoolean(); this.maxSequenceLength = in.readVInt(); this.truncate = in.readEnum(Truncate.class); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { this.span = in.readInt(); } else { this.span = UNSET_SPAN_VALUE; @@ -138,7 +138,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(withSpecialTokens); out.writeVInt(maxSequenceLength); out.writeEnum(truncate); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { out.writeInt(span); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TrainedModel.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TrainedModel.java index ede41feeb8de7..42e0bdac6e83a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TrainedModel.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TrainedModel.java @@ -8,6 +8,7 @@ import org.apache.lucene.util.Accountable; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; @@ -33,6 +34,6 @@ public interface TrainedModel extends NamedXContentObject, NamedWriteable, Accou long estimatedNumOperations(); default TransportVersion getMinimalCompatibilityVersion() { - return TransportVersion.V_7_6_0; + return TransportVersions.V_7_6_0; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java index f946d0ca17a6b..ba4c130b987d2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -204,7 +205,7 @@ public MlConfigVersion getMinimalSupportedMlConfigVersion() { @Override public TransportVersion getMinimalSupportedTransportVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java index 5ad41a9a6f5db..47fd75ed6ff42 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -244,6 +245,6 @@ public ZeroShotClassificationConfigUpdate build() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/Ensemble.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/Ensemble.java index a4c26d78a016e..9afad760e1b7f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/Ensemble.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/Ensemble.java @@ -10,6 +10,7 @@ import org.apache.lucene.util.Accountables; import org.apache.lucene.util.RamUsageEstimator; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -285,7 +286,7 @@ public TransportVersion getMinimalCompatibilityVersion() { return models.stream() .map(TrainedModel::getMinimalCompatibilityVersion) .max(TransportVersion::compareTo) - .orElse(TransportVersion.V_7_6_0); + .orElse(TransportVersions.V_7_6_0); } public static class Builder { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/Tree.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/Tree.java index f7eac8317ccd8..458cbb2b602f5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/Tree.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/Tree.java @@ -10,6 +10,7 @@ import org.apache.lucene.util.Accountables; import org.apache.lucene.util.RamUsageEstimator; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -289,9 +290,9 @@ public Collection getChildResources() { @Override public TransportVersion getMinimalCompatibilityVersion() { if (nodes.stream().filter(TreeNode::isLeaf).anyMatch(t -> t.getLeafValue().length > 1)) { - return TransportVersion.V_7_7_0; + return TransportVersions.V_7_7_0; } - return TransportVersion.V_7_6_0; + return TransportVersions.V_7_6_0; } public static class Builder { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/DataDescription.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/DataDescription.java index 4cd8aae3561d4..65a4524b1bcff 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/DataDescription.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/DataDescription.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.job.config; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -131,12 +131,12 @@ public DataDescription(String timeFieldName, String timeFormat) { } public DataDescription(StreamInput in) throws IOException { - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { DataFormat.readFromStream(in); } timeFieldName = in.readString(); timeFormat = in.readString(); - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { // fieldDelimiter if (in.readBoolean()) { in.read(); @@ -150,12 +150,12 @@ public DataDescription(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { DataFormat.XCONTENT.writeTo(out); } out.writeString(timeFieldName); out.writeString(timeFormat); - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { // fieldDelimiter out.writeBoolean(false); // quoteCharacter diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/output/FlushAcknowledgement.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/output/FlushAcknowledgement.java index 06def9204686e..183ccd3a791b9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/output/FlushAcknowledgement.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/output/FlushAcknowledgement.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.job.process.autodetect.output; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -66,7 +66,7 @@ public FlushAcknowledgement(String id, Instant lastFinalizedBucketEnd, Boolean r public FlushAcknowledgement(StreamInput in) throws IOException { id = in.readString(); lastFinalizedBucketEnd = in.readOptionalInstant(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_012)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_012)) { refreshRequired = in.readBoolean(); } else { refreshRequired = true; @@ -77,7 +77,7 @@ public FlushAcknowledgement(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { out.writeString(id); out.writeOptionalInstant(lastFinalizedBucketEnd); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_012)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_012)) { out.writeBoolean(refreshRequired); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyRecord.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyRecord.java index fbf5ab4f4212b..54f77655e2822 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyRecord.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyRecord.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.job.results; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -217,7 +217,7 @@ public AnomalyRecord(StreamInput in) throws IOException { influences = in.readCollectionAsList(Influence::new); } geoResults = in.readOptionalWriteable(GeoResults::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { anomalyScoreExplanation = in.readOptionalWriteable(AnomalyScoreExplanation::new); } } @@ -264,7 +264,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeCollection(influences); } out.writeOptionalWriteable(geoResults); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { out.writeOptionalWriteable(anomalyScoreExplanation); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyScoreExplanation.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyScoreExplanation.java index 17c0da6a7020f..cb19f7703ed42 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyScoreExplanation.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyScoreExplanation.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.job.results; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -88,10 +88,10 @@ public AnomalyScoreExplanation(StreamInput in) throws IOException { this.upperConfidenceBound = in.readOptionalDouble(); this.highVariancePenalty = in.readOptionalBoolean(); this.incompleteBucketPenalty = in.readOptionalBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { this.multimodalDistribution = in.readOptionalBoolean(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { this.byFieldFirstOccurrence = in.readOptionalBoolean(); this.byFieldRelativeRarity = in.readOptionalDouble(); } @@ -109,10 +109,10 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalDouble(upperConfidenceBound); out.writeOptionalBoolean(highVariancePenalty); out.writeOptionalBoolean(incompleteBucketPenalty); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeOptionalBoolean(multimodalDistribution); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeOptionalBoolean(byFieldFirstOccurrence); out.writeOptionalDouble(byFieldRelativeRarity); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/snapshot/upgrade/SnapshotUpgradeTaskParams.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/snapshot/upgrade/SnapshotUpgradeTaskParams.java index a0c707edf3cd5..c159f997798a9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/snapshot/upgrade/SnapshotUpgradeTaskParams.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/snapshot/upgrade/SnapshotUpgradeTaskParams.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.job.snapshot.upgrade; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.persistent.PersistentTaskParams; @@ -68,7 +69,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_11_0; + return TransportVersions.V_7_11_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/MonitoringFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/MonitoringFeatureSetUsage.java index 67615b6b79c65..546c139766248 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/MonitoringFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/MonitoringFeatureSetUsage.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.monitoring; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -39,7 +40,7 @@ public MonitoringFeatureSetUsage(boolean collectionEnabled, Map @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_0_0; + return TransportVersions.V_7_0_0; } public Map getExporters() { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupFeatureSetUsage.java index 671349362dd00..fd5cf1c41b466 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupFeatureSetUsage.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.rollup; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; @@ -25,7 +26,7 @@ public RollupFeatureSetUsage() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_0_0; + return TransportVersions.V_7_0_0; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJob.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJob.java index fc2a97e0de8cd..3918f96ae2c56 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJob.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJob.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.rollup.job; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.SimpleDiffable; import org.elasticsearch.common.io.stream.StreamInput; @@ -119,6 +120,6 @@ public int hashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJobStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJobStatus.java index 55e3ea54cea02..19c718073d702 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJobStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJobStatus.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.rollup.job; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -75,7 +75,7 @@ public RollupJobStatus(IndexerState state, @Nullable Map positio public RollupJobStatus(StreamInput in) throws IOException { state = IndexerState.fromStream(in); currentPosition = in.readBoolean() ? new TreeMap<>(in.readMap()) : null; - if (in.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) { // 7.x nodes serialize `upgradedDocumentID` flag. We don't need it anymore, but // we need to pull it off the stream // This can go away completely in 9.0 @@ -122,7 +122,7 @@ public void writeTo(StreamOutput out) throws IOException { if (currentPosition != null) { out.writeGenericMap(currentPosition); } - if (out.getTransportVersion().before(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) { // 7.x nodes expect a boolean `upgradedDocumentID` flag. We don't have it anymore, // but we need to tell them we are upgraded in case there is a mixed cluster // This can go away completely in 9.0 diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/AsyncStatusResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/AsyncStatusResponse.java index 4d544b6bceb38..b63d7ec32b9db 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/AsyncStatusResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/AsyncStatusResponse.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.search.action; import org.elasticsearch.ExceptionsHelper; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.io.stream.StreamInput; @@ -136,12 +136,12 @@ public AsyncStatusResponse(StreamInput in) throws IOException { this.skippedShards = in.readVInt(); this.failedShards = in.readVInt(); this.completionStatus = (this.isRunning == false) ? RestStatus.readFrom(in) : null; - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { this.clusters = in.readOptionalWriteable(SearchResponse.Clusters::new); } else { this.clusters = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_035)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_035)) { this.completionTimeMillis = in.readOptionalVLong(); } else { this.completionTimeMillis = null; @@ -162,11 +162,11 @@ public void writeTo(StreamOutput out) throws IOException { if (isRunning == false) { RestStatus.writeTo(out, completionStatus); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { // optional since only CCS uses is; it is null for local-only searches out.writeOptionalWriteable(clusters); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_035)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_035)) { out.writeOptionalVLong(completionTimeMillis); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/MountSearchableSnapshotRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/MountSearchableSnapshotRequest.java index eb1017fcd4399..276eedc6408e1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/MountSearchableSnapshotRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/MountSearchableSnapshotRequest.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.searchablesnapshots; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.cluster.metadata.IndexMetadata; @@ -83,7 +84,7 @@ public class MountSearchableSnapshotRequest extends MasterNodeRequest roleDescriptors = in.readOptionalCollectionAsList(RoleDescriptor::new); this.roleDescriptors = roleDescriptors != null ? List.copyOf(roleDescriptors) : null; this.limitedBy = in.readOptionalWriteable(RoleDescriptorsIntersection::new); @@ -308,7 +309,7 @@ private void buildXContentForCrossClusterApiKeyAccess(XContentBuilder builder, R @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_5_0)) { out.writeOptionalString(name); } else { out.writeString(name); @@ -322,10 +323,10 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(invalidated); out.writeString(username); out.writeString(realm); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeGenericMap(metadata); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { out.writeOptionalCollection(roleDescriptors); out.writeOptionalWriteable(limitedBy); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/CreateApiKeyRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/CreateApiKeyRequest.java index 1d26d23734499..e49ba19631a7e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/CreateApiKeyRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/CreateApiKeyRequest.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.security.action.apikey; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.UUIDs; @@ -57,7 +57,7 @@ public CreateApiKeyRequest( public CreateApiKeyRequest(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_5_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_5_0)) { this.name = in.readOptionalString(); } else { this.name = in.readString(); @@ -65,7 +65,7 @@ public CreateApiKeyRequest(StreamInput in) throws IOException { this.expiration = in.readOptionalTimeValue(); this.roleDescriptors = in.readCollectionAsImmutableList(RoleDescriptor::new); this.refreshPolicy = WriteRequest.RefreshPolicy.readFrom(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { this.metadata = in.readMap(); } else { this.metadata = null; @@ -74,7 +74,7 @@ public CreateApiKeyRequest(StreamInput in) throws IOException { @Override protected String doReadId(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { return in.readString(); } else { return UUIDs.base64UUID(); @@ -118,10 +118,10 @@ public ActionRequestValidationException validate() { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeString(id); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_5_0)) { out.writeOptionalString(name); } else { out.writeString(name); @@ -129,7 +129,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalTimeValue(expiration); out.writeCollection(getRoleDescriptors()); refreshPolicy.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { out.writeGenericMap(metadata); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/GetApiKeyRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/GetApiKeyRequest.java index ebf36bdcdc421..d76696dc4fe99 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/GetApiKeyRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/GetApiKeyRequest.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.security.action.apikey; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.Strings; @@ -25,7 +26,7 @@ */ public final class GetApiKeyRequest extends ActionRequest { - static TransportVersion API_KEY_ACTIVE_ONLY_PARAM_TRANSPORT_VERSION = TransportVersion.V_8_500_054; + static TransportVersion API_KEY_ACTIVE_ONLY_PARAM_TRANSPORT_VERSION = TransportVersions.V_8_500_054; private final String realmName; private final String userName; @@ -41,12 +42,12 @@ public GetApiKeyRequest(StreamInput in) throws IOException { userName = textOrNull(in.readOptionalString()); apiKeyId = textOrNull(in.readOptionalString()); apiKeyName = textOrNull(in.readOptionalString()); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_4_0)) { ownedByAuthenticatedUser = in.readOptionalBoolean(); } else { ownedByAuthenticatedUser = false; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { withLimitedBy = in.readBoolean(); } else { withLimitedBy = false; @@ -140,10 +141,10 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(userName); out.writeOptionalString(apiKeyId); out.writeOptionalString(apiKeyName); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_4_0)) { out.writeOptionalBoolean(ownedByAuthenticatedUser); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { out.writeBoolean(withLimitedBy); } if (out.getTransportVersion().onOrAfter(API_KEY_ACTIVE_ONLY_PARAM_TRANSPORT_VERSION)) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/InvalidateApiKeyRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/InvalidateApiKeyRequest.java index 2c43767af7b92..bb5b364005395 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/InvalidateApiKeyRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/InvalidateApiKeyRequest.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.security.action.apikey; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.Strings; @@ -41,7 +41,7 @@ public InvalidateApiKeyRequest(StreamInput in) throws IOException { super(in); realmName = textOrNull(in.readOptionalString()); userName = textOrNull(in.readOptionalString()); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { ids = in.readOptionalStringArray(); } else { final String id = in.readOptionalString(); @@ -49,7 +49,7 @@ public InvalidateApiKeyRequest(StreamInput in) throws IOException { } validateIds(ids); name = textOrNull(in.readOptionalString()); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_4_0)) { ownedByAuthenticatedUser = in.readOptionalBoolean(); } else { ownedByAuthenticatedUser = false; @@ -209,7 +209,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeOptionalString(realmName); out.writeOptionalString(userName); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { out.writeOptionalStringArray(ids); } else { if (ids != null) { @@ -223,7 +223,7 @@ public void writeTo(StreamOutput out) throws IOException { } } out.writeOptionalString(name); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_4_0)) { out.writeOptionalBoolean(ownedByAuthenticatedUser); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/QueryApiKeyRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/QueryApiKeyRequest.java index ebb1f40c2e270..e7eefaeb3a525 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/QueryApiKeyRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/QueryApiKeyRequest.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.security.action.apikey; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.StreamInput; @@ -72,7 +72,7 @@ public QueryApiKeyRequest(StreamInput in) throws IOException { this.fieldSortBuilders = null; } this.searchAfterBuilder = in.readOptionalWriteable(SearchAfterBuilder::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { this.withLimitedBy = in.readBoolean(); } else { this.withLimitedBy = false; @@ -136,7 +136,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeCollection(fieldSortBuilders); } out.writeOptionalWriteable(searchAfterBuilder); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { out.writeBoolean(withLimitedBy); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectAuthenticateRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectAuthenticateRequest.java index 022c5bc943c21..3f1160df95e22 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectAuthenticateRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectAuthenticateRequest.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.security.action.oidc; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.Strings; @@ -54,7 +54,7 @@ public OpenIdConnectAuthenticateRequest(StreamInput in) throws IOException { redirectUri = in.readString(); state = in.readString(); nonce = in.readString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_4_0)) { realm = in.readOptionalString(); } @@ -113,7 +113,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(redirectUri); out.writeString(state); out.writeString(nonce); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_4_0)) { out.writeOptionalString(realm); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectAuthenticateResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectAuthenticateResponse.java index 29fcba5be85f8..936a2892a6dbe 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectAuthenticateResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectAuthenticateResponse.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.security.action.oidc; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -42,7 +42,7 @@ public OpenIdConnectAuthenticateResponse(StreamInput in) throws IOException { accessTokenString = in.readString(); refreshTokenString = in.readString(); expiresIn = in.readTimeValue(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { authentication = new Authentication(in); } } @@ -73,7 +73,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(accessTokenString); out.writeString(refreshTokenString); out.writeTimeValue(expiresIn); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { authentication.writeTo(out); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectPrepareAuthenticationResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectPrepareAuthenticationResponse.java index 00cb814b7e1d7..88d8de80fe7a1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectPrepareAuthenticationResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectPrepareAuthenticationResponse.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.security.action.oidc; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -47,7 +47,7 @@ public OpenIdConnectPrepareAuthenticationResponse(StreamInput in) throws IOExcep authenticationRequestUrl = in.readString(); state = in.readString(); nonce = in.readString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { realmName = in.readString(); } } @@ -73,7 +73,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(authenticationRequestUrl); out.writeString(state); out.writeString(nonce); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { out.writeString(realmName); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequest.java index bdd8695630d10..e82a77f311de6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequest.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.security.action.role; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.WriteRequest; @@ -59,7 +59,7 @@ public PutRoleRequest(StreamInput in) throws IOException { runAs = in.readStringArray(); refreshPolicy = RefreshPolicy.readFrom(in); metadata = in.readMap(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { remoteIndicesPrivileges = in.readCollectionAsList(RoleDescriptor.RemoteIndicesPrivileges::new); } } @@ -214,12 +214,12 @@ public void writeTo(StreamOutput out) throws IOException { out.writeStringArray(runAs); refreshPolicy.writeTo(out); out.writeGenericMap(metadata); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeCollection(remoteIndicesPrivileges); } else if (hasRemoteIndicesPrivileges()) { throw new IllegalArgumentException( "versions of Elasticsearch before [" - + TransportVersion.V_8_8_0 + + TransportVersions.V_8_8_0 + "] can't handle remote indices privileges and attempted to send to [" + out.getTransportVersion() + "]" diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingRequest.java index 5f6119c761dad..8059a30b88952 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingRequest.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.security.action.rolemapping; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.WriteRequest; @@ -47,7 +47,7 @@ public PutRoleMappingRequest(StreamInput in) throws IOException { this.name = in.readString(); this.enabled = in.readBoolean(); this.roles = in.readStringCollectionAsList(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { this.roleTemplates = in.readCollectionAsList(TemplateRoleName::new); } this.rules = ExpressionParser.readExpression(in); @@ -155,7 +155,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(name); out.writeBoolean(enabled); out.writeStringCollection(roles); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { out.writeCollection(roleTemplates); } ExpressionParser.writeExpression(rules, out); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlAuthenticateResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlAuthenticateResponse.java index 707c9f36729a8..2cb0a76c2d6bf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlAuthenticateResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlAuthenticateResponse.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.security.action.saml; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -31,13 +31,13 @@ public final class SamlAuthenticateResponse extends ActionResponse { public SamlAuthenticateResponse(StreamInput in) throws IOException { super(in); principal = in.readString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { realm = in.readString(); } tokenString = in.readString(); refreshToken = in.readString(); expiresIn = in.readTimeValue(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { authentication = new Authentication(in); } } @@ -78,13 +78,13 @@ public Authentication getAuthentication() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(principal); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeString(realm); } out.writeString(tokenString); out.writeString(refreshToken); out.writeTimeValue(expiresIn); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { authentication.writeTo(out); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlPrepareAuthenticationRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlPrepareAuthenticationRequest.java index 02d55ca18beed..3b5ddb21be91c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlPrepareAuthenticationRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/saml/SamlPrepareAuthenticationRequest.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.security.action.saml; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.StreamInput; @@ -33,7 +33,7 @@ public SamlPrepareAuthenticationRequest(StreamInput in) throws IOException { super(in); realmName = in.readOptionalString(); assertionConsumerServiceURL = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_5_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_5_0)) { relayState = in.readOptionalString(); } } @@ -87,7 +87,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeOptionalString(realmName); out.writeOptionalString(assertionConsumerServiceURL); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_5_0)) { out.writeOptionalString(relayState); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenResponse.java index c5e06ce5d1843..73719c7cae489 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenResponse.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.security.action.token; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -41,7 +41,7 @@ public CreateTokenResponse(StreamInput in) throws IOException { scope = in.readOptionalString(); refreshToken = in.readOptionalString(); kerberosAuthenticationResponseToken = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { authentication = new Authentication(in); } } @@ -93,7 +93,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(scope); out.writeOptionalString(refreshToken); out.writeOptionalString(kerberosAuthenticationResponseToken); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { authentication.writeTo(out); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateRequest.java index 73e334f2a2495..78533dd93564f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateRequest.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.security.action.user; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.StreamInput; @@ -20,7 +20,7 @@ public class AuthenticateRequest extends ActionRequest { public AuthenticateRequest(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().before(TransportVersion.V_8_5_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_5_0)) { // Older versions included the username as a field in.readString(); } @@ -37,7 +37,7 @@ public ActionRequestValidationException validate() { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().before(TransportVersion.V_8_5_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_5_0)) { throw new IllegalStateException("cannot send authenticate request to a node of earlier version"); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateResponse.java index 127a84b103ecf..70ffdb8bb9c9c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateResponse.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.security.action.user; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -19,7 +20,7 @@ public class AuthenticateResponse extends ActionResponse implements ToXContent { - public static final TransportVersion VERSION_OPERATOR_FIELD = TransportVersion.V_8_500_028; + public static final TransportVersion VERSION_OPERATOR_FIELD = TransportVersions.V_8_500_028; private final Authentication authentication; private final boolean operator; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponse.java index 6ad9a1de369d0..2cd37df4ef15e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponse.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.security.action.user; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; @@ -48,7 +48,7 @@ public GetUserPrivilegesResponse(StreamInput in) throws IOException { index = in.readCollectionAsImmutableSet(Indices::new); application = in.readCollectionAsImmutableSet(RoleDescriptor.ApplicationResourcePrivileges::new); runAs = in.readCollectionAsImmutableSet(StreamInput::readString); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { remoteIndex = in.readCollectionAsImmutableSet(RemoteIndices::new); } else { remoteIndex = Set.of(); @@ -106,12 +106,12 @@ public void writeTo(StreamOutput out) throws IOException { out.writeCollection(index); out.writeCollection(application); out.writeStringCollection(runAs); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeCollection(remoteIndex); } else if (hasRemoteIndicesPrivileges()) { throw new IllegalArgumentException( "versions of Elasticsearch before [" - + TransportVersion.V_8_8_0 + + TransportVersions.V_8_8_0 + "] can't handle remote indices privileges and attempted to send to [" + out.getTransportVersion() + "]" diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersRequest.java index e6e7c0e6b8a8a..29c48f29709fd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersRequest.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.security.action.user; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.Strings; @@ -28,7 +28,7 @@ public class GetUsersRequest extends ActionRequest implements UserRequest { public GetUsersRequest(StreamInput in) throws IOException { super(in); usernames = in.readStringArray(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { withProfileUid = in.readBoolean(); } else { withProfileUid = false; @@ -77,7 +77,7 @@ public void setWithProfileUid(boolean withProfileUid) { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeStringArray(usernames); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { out.writeBoolean(withProfileUid); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersResponse.java index 44e69c79f7be1..6395d2a090afa 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersResponse.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.security.action.user; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -43,7 +43,7 @@ public GetUsersResponse(StreamInput in) throws IOException { users[i] = user; } } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { if (in.readBoolean()) { profileUidLookup = in.readMap(StreamInput::readString); } else { @@ -83,7 +83,7 @@ public void writeTo(StreamOutput out) throws IOException { Authentication.AuthenticationSerializationHelper.writeUserTo(user, out); } } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { if (profileUidLookup != null) { out.writeBoolean(true); out.writeMap(profileUidLookup, StreamOutput::writeString); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java index 39d3b19410480..6efb1cfd1fe03 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java @@ -9,6 +9,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; @@ -103,9 +104,9 @@ public final class Authentication implements ToXContentObject { private static final Logger logger = LogManager.getLogger(Authentication.class); private static final TransportVersion VERSION_AUTHENTICATION_TYPE = TransportVersion.fromId(6_07_00_99); - public static final TransportVersion VERSION_API_KEY_ROLES_AS_BYTES = TransportVersion.V_7_9_0; - public static final TransportVersion VERSION_REALM_DOMAINS = TransportVersion.V_8_2_0; - public static final TransportVersion VERSION_METADATA_BEYOND_GENERIC_MAP = TransportVersion.V_8_8_0; + public static final TransportVersion VERSION_API_KEY_ROLES_AS_BYTES = TransportVersions.V_7_9_0; + public static final TransportVersion VERSION_REALM_DOMAINS = TransportVersions.V_8_2_0; + public static final TransportVersion VERSION_METADATA_BEYOND_GENERIC_MAP = TransportVersions.V_8_8_0; private final AuthenticationType type; private final Subject authenticatingSubject; private final Subject effectiveSubject; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/TokenMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/TokenMetadata.java index 86ec099a50d41..54668c9dd2df7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/TokenMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/TokenMetadata.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.security.authc; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.AbstractNamedDiffable; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.NamedDiff; @@ -93,7 +94,7 @@ public String toString() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/TokensInvalidationResult.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/TokensInvalidationResult.java index 1ba63c35f982a..8fe018a825468 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/TokensInvalidationResult.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/TokensInvalidationResult.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.security.authc.support; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -59,10 +59,10 @@ public TokensInvalidationResult(StreamInput in) throws IOException { this.invalidatedTokens = in.readStringCollectionAsList(); this.previouslyInvalidatedTokens = in.readStringCollectionAsList(); this.errors = in.readCollectionAsList(StreamInput::readException); - if (in.getTransportVersion().before(TransportVersion.V_7_2_0)) { + if (in.getTransportVersion().before(TransportVersions.V_7_2_0)) { in.readVInt(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { this.restStatus = RestStatus.readFrom(in); } } @@ -111,10 +111,10 @@ public void writeTo(StreamOutput out) throws IOException { out.writeStringCollection(invalidatedTokens); out.writeStringCollection(previouslyInvalidatedTokens); out.writeCollection(errors, StreamOutput::writeException); - if (out.getTransportVersion().before(TransportVersion.V_7_2_0)) { + if (out.getTransportVersion().before(TransportVersions.V_7_2_0)) { out.writeVInt(5); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { RestStatus.writeTo(out, restStatus); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ExpressionRoleMapping.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ExpressionRoleMapping.java index c95ffe19f71a5..426e8b0563a90 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ExpressionRoleMapping.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ExpressionRoleMapping.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.security.authc.support.mapper; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; @@ -97,7 +97,7 @@ public ExpressionRoleMapping(StreamInput in) throws IOException { this.name = in.readString(); this.enabled = in.readBoolean(); this.roles = in.readStringCollectionAsList(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { this.roleTemplates = in.readCollectionAsList(TemplateRoleName::new); } else { this.roleTemplates = Collections.emptyList(); @@ -111,7 +111,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(name); out.writeBoolean(enabled); out.writeStringCollection(roles); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_2_0)) { out.writeCollection(roleTemplates); } ExpressionParser.writeExpression(expression, out); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java index 977031ebf28d3..e08d43c989474 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java @@ -9,6 +9,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.bytes.BytesArray; @@ -53,7 +54,7 @@ */ public class RoleDescriptor implements ToXContentObject, Writeable { - public static final TransportVersion WORKFLOWS_RESTRICTION_VERSION = TransportVersion.V_8_500_010; + public static final TransportVersion WORKFLOWS_RESTRICTION_VERSION = TransportVersions.V_8_500_010; public static final String ROLE_TYPE = "role"; @@ -194,7 +195,7 @@ public RoleDescriptor(StreamInput in) throws IOException { this.applicationPrivileges = in.readArray(ApplicationResourcePrivileges::new, ApplicationResourcePrivileges[]::new); this.configurableClusterPrivileges = ConfigurableClusterPrivileges.readArray(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { this.remoteIndicesPrivileges = in.readArray(RemoteIndicesPrivileges::new, RemoteIndicesPrivileges[]::new); } else { this.remoteIndicesPrivileges = RemoteIndicesPrivileges.NONE; @@ -413,7 +414,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeGenericMap(transientMetadata); out.writeArray(ApplicationResourcePrivileges::write, applicationPrivileges); ConfigurableClusterPrivileges.writeArray(out, getConditionalClusterPrivileges()); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeArray(remoteIndicesPrivileges); } if (out.getTransportVersion().onOrAfter(WORKFLOWS_RESTRICTION_VERSION)) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SLMFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SLMFeatureSetUsage.java index ffb564b9e0d5d..289c76714b731 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SLMFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SLMFeatureSetUsage.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.slm; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -40,7 +41,7 @@ public SLMFeatureSetUsage(@Nullable SnapshotLifecycleStats slmStats) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_5_0; + return TransportVersions.V_7_5_0; } public SnapshotLifecycleStats getStats() { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleMetadata.java index 6eb1e9f5becb1..9610f70689897 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleMetadata.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.slm; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; @@ -131,7 +132,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_4_0; + return TransportVersions.V_7_4_0; } @Override @@ -230,7 +231,7 @@ static Diff readLifecyclePolicyDiffFrom(StreamI @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_4_0; + return TransportVersions.V_7_4_0; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyMetadata.java index 921a74828287b..a317b79901751 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyMetadata.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.slm; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.SimpleDiffable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -116,7 +116,7 @@ public static SnapshotLifecyclePolicyMetadata parse(XContentParser parser, Strin this.modifiedDate = in.readVLong(); this.lastSuccess = in.readOptionalWriteable(SnapshotInvocationRecord::new); this.lastFailure = in.readOptionalWriteable(SnapshotInvocationRecord::new); - this.invocationsSinceLastSuccess = in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0) ? in.readVLong() : 0L; + this.invocationsSinceLastSuccess = in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0) ? in.readVLong() : 0L; } @Override @@ -127,7 +127,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(this.modifiedDate); out.writeOptionalWriteable(this.lastSuccess); out.writeOptionalWriteable(this.lastFailure); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeVLong(this.invocationsSinceLastSuccess); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/spatial/SpatialFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/spatial/SpatialFeatureSetUsage.java index 0c68b5a150998..380c0e97d30dd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/spatial/SpatialFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/spatial/SpatialFeatureSetUsage.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.spatial; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xpack.core.XPackFeatureSet; @@ -28,7 +29,7 @@ public SpatialFeatureSetUsage(SpatialStatsAction.Response statsResponse) { public SpatialFeatureSetUsage(StreamInput input) throws IOException { super(input); - if (input.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (input.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { this.statsResponse = new SpatialStatsAction.Response(input); } else { this.statsResponse = null; @@ -37,7 +38,7 @@ public SpatialFeatureSetUsage(StreamInput input) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_4_0; + return TransportVersions.V_7_4_0; } SpatialStatsAction.Response statsResponse() { @@ -47,7 +48,7 @@ SpatialStatsAction.Response statsResponse() { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_11_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_11_0)) { this.statsResponse.writeTo(out); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/sql/SqlFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/sql/SqlFeatureSetUsage.java index 1cc55f267ce0a..fbb8025d0e446 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/sql/SqlFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/sql/SqlFeatureSetUsage.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.sql; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -33,7 +34,7 @@ public SqlFeatureSetUsage(Map stats) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_0_0; + return TransportVersions.V_7_0_0; } public Map stats() { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/cert/CertificateInfo.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/cert/CertificateInfo.java index 3588d21110bc0..ee077e5140606 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/cert/CertificateInfo.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/cert/CertificateInfo.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ssl.cert; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -56,7 +56,7 @@ public CertificateInfo(String path, String format, String alias, boolean hasPriv } public CertificateInfo(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { this.path = in.readOptionalString(); } else { this.path = in.readString(); @@ -67,7 +67,7 @@ public CertificateInfo(StreamInput in) throws IOException { this.serialNumber = in.readString(); this.hasPrivateKey = in.readBoolean(); this.expiry = Instant.ofEpochMilli(in.readLong()).atZone(ZoneOffset.UTC); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { this.issuer = in.readString(); } else { this.issuer = ""; @@ -76,7 +76,7 @@ public CertificateInfo(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeOptionalString(this.path); } else { out.writeString(this.path == null ? "" : this.path); @@ -87,7 +87,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(serialNumber); out.writeBoolean(hasPrivateKey); out.writeLong(expiry.toInstant().toEpochMilli()); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeString(issuer); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumRequest.java index 40de316c8c61c..84a28d9c8d1ef 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumRequest.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.termsenum.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.action.support.IndicesOptions; @@ -78,7 +78,7 @@ public NodeTermsEnumRequest(StreamInput in) throws IOException { for (int i = 0; i < numShards; i++) { shardIds.add(new ShardId(in)); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_15_1)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_15_1)) { originalIndices = OriginalIndices.readOriginalIndices(in); } else { String[] indicesNames = shardIds.stream().map(ShardId::getIndexName).distinct().toArray(String[]::new); @@ -106,7 +106,7 @@ public void writeTo(StreamOutput out) throws IOException { for (ShardId shardId : shardIds) { shardId.writeTo(out); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_15_1)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_15_1)) { OriginalIndices.writeOriginalIndices(originalIndices, out); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumResponse.java index beadd6c5b18ec..51c183b8e49c3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumResponse.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.termsenum.action; import org.elasticsearch.ExceptionsHelper; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -31,7 +31,7 @@ class NodeTermsEnumResponse extends TransportResponse { NodeTermsEnumResponse(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().before(TransportVersion.V_8_2_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_2_0)) { terms = in.readCollectionAsList(r -> { String term = r.readString(); in.readLong(); // obsolete docCount field @@ -70,7 +70,7 @@ private NodeTermsEnumResponse(String nodeId, List terms, String error, b @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().before(TransportVersion.V_8_2_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_2_0)) { out.writeCollection(terms.stream().map(term -> (Writeable) out1 -> { out1.writeString(term); out1.writeLong(1); // obsolete docCount field diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/action/FindStructureAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/action/FindStructureAction.java index 58414f1fc1e82..8387511fa50f5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/action/FindStructureAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/action/FindStructureAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.textstructure.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; @@ -146,7 +146,7 @@ public Request(StreamInput in) throws IOException { quote = in.readBoolean() ? (char) in.readVInt() : null; shouldTrimFields = in.readOptionalBoolean(); grokPattern = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { ecsCompatibility = in.readOptionalString(); } else { ecsCompatibility = null; @@ -408,7 +408,7 @@ public void writeTo(StreamOutput out) throws IOException { } out.writeOptionalBoolean(shouldTrimFields); out.writeOptionalString(grokPattern); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { out.writeOptionalString(ecsCompatibility); } out.writeOptionalString(timestampFormat); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/structurefinder/TextStructure.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/structurefinder/TextStructure.java index 5969811b808c0..c37c795f5a94c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/structurefinder/TextStructure.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/structurefinder/TextStructure.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.textstructure.structurefinder; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -226,7 +226,7 @@ public TextStructure(StreamInput in) throws IOException { quote = in.readBoolean() ? (char) in.readVInt() : null; shouldTrimFields = in.readOptionalBoolean(); grokPattern = in.readOptionalString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { ecsCompatibility = getNonNullEcsCompatibilityString(in.readString()); } else { ecsCompatibility = getNonNullEcsCompatibilityString(null); @@ -272,7 +272,7 @@ public void writeTo(StreamOutput out) throws IOException { } out.writeOptionalBoolean(shouldTrimFields); out.writeOptionalString(grokPattern); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { out.writeString(ecsCompatibility); } if (jodaTimestampFormats == null) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformFeatureSetUsage.java index 6737680c41342..66c97876c1f6f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformFeatureSetUsage.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.transform; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -49,7 +50,7 @@ public TransformFeatureSetUsage( @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_5_0; + return TransportVersions.V_7_5_0; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformMetadata.java index bdbb5b5ff5371..e54cf2edb2690 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformMetadata.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.transform; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.NamedDiff; @@ -54,7 +55,7 @@ public boolean isResetMode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } @Override @@ -120,7 +121,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/DeleteTransformAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/DeleteTransformAction.java index 96c3312dfeb0e..6f7cc7cf1eea6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/DeleteTransformAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/DeleteTransformAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.transform.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; @@ -45,7 +45,7 @@ public Request(StreamInput in) throws IOException { super(in); id = in.readString(); force = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { deleteDestIndex = in.readBoolean(); } else { deleteDestIndex = false; @@ -69,7 +69,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeString(id); out.writeBoolean(force); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeBoolean(deleteDestIndex); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformAction.java index 1f55a030b008e..737218607cb8b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.transform.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.common.ValidationException; @@ -136,7 +136,7 @@ public Response(List transformConfigs, long count, List public Response(StreamInput in) throws IOException { super(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { if (in.readBoolean()) { this.errors = in.readCollectionAsList(Error::new); } else { @@ -197,7 +197,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { if (errors != null) { out.writeBoolean(true); out.writeCollection(errors); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/StartTransformAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/StartTransformAction.java index 12979a38f8601..e5d11e8bc4c47 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/StartTransformAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/StartTransformAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.transform.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; @@ -48,7 +48,7 @@ public Request(String id, Instant from, TimeValue timeout) { public Request(StreamInput in) throws IOException { super(in); id = in.readString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { from = in.readOptionalInstant(); } else { from = null; @@ -67,7 +67,7 @@ public Instant from() { public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeString(id); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeOptionalInstant(from); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformAction.java index be99bc7d2106c..6ecdd6519714b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.transform.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.tasks.BaseTasksRequest; @@ -65,7 +65,7 @@ public Request(StreamInput in) throws IOException { if (in.readBoolean()) { this.config = new TransformConfig(in); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { if (in.readBoolean()) { this.authState = new AuthorizationState(in); } @@ -152,7 +152,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(true); config.writeTo(out); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { if (authState == null) { out.writeBoolean(false); } else { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/DestConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/DestConfig.java index fd439b0d6079d..b306f13d19a63 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/DestConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/DestConfig.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.transform.transforms; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -64,7 +64,7 @@ public DestConfig(String index, List aliases, String pipeline) { public DestConfig(final StreamInput in) throws IOException { index = in.readString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { aliases = in.readOptionalCollectionAsList(DestAlias::new); } else { aliases = null; @@ -96,7 +96,7 @@ public void checkForDeprecations(String id, NamedXContentRegistry namedXContentR @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(index); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeOptionalCollection(aliases); } out.writeOptionalString(pipeline); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SettingsConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SettingsConfig.java index 441882cd53f9d..9b0fa3876819b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SettingsConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SettingsConfig.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.transform.transforms; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -163,17 +163,17 @@ public SettingsConfig(final StreamInput in) throws IOException { this.alignCheckpoints = in.readOptionalInt(); this.usePit = in.readOptionalInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { deduceMappings = in.readOptionalInt(); } else { deduceMappings = DEFAULT_DEDUCE_MAPPINGS; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { numFailureRetries = in.readOptionalInt(); } else { numFailureRetries = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { unattended = in.readOptionalInt(); } else { unattended = DEFAULT_UNATTENDED; @@ -279,13 +279,13 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalInt(alignCheckpoints); out.writeOptionalInt(usePit); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_1_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_1_0)) { out.writeOptionalInt(deduceMappings); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_4_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_4_0)) { out.writeOptionalInt(numFailureRetries); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_5_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_5_0)) { out.writeOptionalInt(unattended); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformHealthIssue.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformHealthIssue.java index d53df56e5d9a3..5697e1793f0b0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformHealthIssue.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformHealthIssue.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.transform.transforms; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -49,7 +49,7 @@ public TransformHealthIssue(String type, String issue, String details, int count } public TransformHealthIssue(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { this.type = in.readString(); } else { this.type = DEFAULT_TYPE_PRE_8_8; @@ -97,7 +97,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeString(type); } out.writeString(issue); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformState.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformState.java index f09291d5a9a7d..2508b5e1bf01b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformState.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformState.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.transform.transforms; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -131,7 +131,7 @@ public TransformState( public TransformState(StreamInput in) throws IOException { taskState = TransformTaskState.fromStream(in); indexerState = IndexerState.fromStream(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_3_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_3_0)) { position = in.readOptionalWriteable(TransformIndexerPosition::new); } else { Map pos = in.readMap(); @@ -140,17 +140,17 @@ public TransformState(StreamInput in) throws IOException { checkpoint = in.readLong(); reason = in.readOptionalString(); progress = in.readOptionalWriteable(TransformProgress::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_3_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_3_0)) { node = in.readOptionalWriteable(NodeAttributes::new); } else { node = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { shouldStopAtNextCheckpoint = in.readBoolean(); } else { shouldStopAtNextCheckpoint = false; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { authState = in.readOptionalWriteable(AuthorizationState::new); } else { authState = null; @@ -241,7 +241,7 @@ public String getWriteableName() { public void writeTo(StreamOutput out) throws IOException { taskState.writeTo(out); indexerState.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_3_0)) { out.writeOptionalWriteable(position); } else { out.writeGenericMap(position != null ? position.getIndexerPosition() : null); @@ -249,13 +249,13 @@ public void writeTo(StreamOutput out) throws IOException { out.writeLong(checkpoint); out.writeOptionalString(reason); out.writeOptionalWriteable(progress); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_3_0)) { out.writeOptionalWriteable(node); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_6_0)) { out.writeBoolean(shouldStopAtNextCheckpoint); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) { out.writeOptionalWriteable(authState); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStats.java index e7ea69fae493e..74b61d24bed41 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStats.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.transform.transforms; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -90,7 +90,7 @@ public TransformStats(StreamInput in) throws IOException { this.indexerStats = new TransformIndexerStats(in); this.checkpointingInfo = new TransformCheckpointingInfo(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { if (in.readBoolean()) { this.health = new TransformHealth(in); } else { @@ -134,7 +134,7 @@ public void writeTo(StreamOutput out) throws IOException { } indexerStats.writeTo(out); checkpointingInfo.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { if (health != null) { out.writeBoolean(true); health.writeTo(out); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformTaskParams.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformTaskParams.java index 613a595a86195..9b49b58b0d6ec 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformTaskParams.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformTaskParams.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.transform.transforms; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.SimpleDiffable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -76,7 +77,7 @@ public TransformTaskParams(String transformId, TransformConfigVersion version, I public TransformTaskParams(StreamInput in) throws IOException { this.transformId = in.readString(); this.version = TransformConfigVersion.readVersion(in); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { this.from = in.readOptionalInstant(); } else { this.from = null; @@ -92,14 +93,14 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_17_0; + return TransportVersions.V_7_17_0; } @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(transformId); TransformConfigVersion.writeVersion(version, out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeOptionalInstant(from); } out.writeOptionalTimeValue(frequency); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSource.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSource.java index b36a6a447b6b2..3d21a7f2f14bb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSource.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSource.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.transform.transforms.pivot; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Rounding; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -228,7 +228,7 @@ public DateHistogramGroupSource(StreamInput in) throws IOException { super(in); this.interval = readInterval(in); this.timeZone = in.readOptionalZoneId(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { this.offset = in.readLong(); } else { this.offset = 0; @@ -331,7 +331,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); writeInterval(interval, out); out.writeOptionalZoneId(timeZone); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeLong(offset); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/votingonly/VotingOnlyNodeFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/votingonly/VotingOnlyNodeFeatureSetUsage.java index 78ca1035b57ae..cf9d2499b60b7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/votingonly/VotingOnlyNodeFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/votingonly/VotingOnlyNodeFeatureSetUsage.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.votingonly; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; @@ -24,7 +25,7 @@ public VotingOnlyNodeFeatureSetUsage() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_3_0; + return TransportVersions.V_7_3_0; } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherFeatureSetUsage.java index b7db037fde49b..18ffeeb9a3206 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherFeatureSetUsage.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.watcher; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xcontent.XContentBuilder; @@ -32,7 +33,7 @@ public WatcherFeatureSetUsage(boolean available, boolean enabled, Map stats() { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherMetadata.java index 918d9840a5fb1..994bb8b75178e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherMetadata.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.watcher; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.AbstractNamedDiffable; import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.cluster.metadata.Metadata; @@ -43,7 +44,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.MINIMUM_COMPATIBLE; + return TransportVersions.MINIMUM_COMPATIBLE; } @Override diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/GetFeatureUsageResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/GetFeatureUsageResponseTests.java index 3396dc8a0463c..cb29f2a85aa8b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/GetFeatureUsageResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/GetFeatureUsageResponseTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.license; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.license.GetFeatureUsageResponse.FeatureUsageInfo; @@ -46,7 +47,7 @@ public void assertStreamInputOutput(TransportVersion version, String family, Str } public void testPre715StreamFormat() throws IOException { - assertStreamInputOutput(TransportVersionUtils.getPreviousVersion(TransportVersion.V_7_15_0), null, null); + assertStreamInputOutput(TransportVersionUtils.getPreviousVersion(TransportVersions.V_7_15_0), null, null); } public void testStreamFormat() throws IOException { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/protocol/xpack/XPackInfoRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/protocol/xpack/XPackInfoRequestTests.java index 9065915fa4201..4aea054c83f2d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/protocol/xpack/XPackInfoRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/protocol/xpack/XPackInfoRequestTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.protocol.xpack; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.protocol.xpack.XPackInfoRequest.Category; import org.elasticsearch.test.ESTestCase; @@ -28,8 +29,8 @@ public void testSerializeUsing7xVersion() throws Exception { assertSerialization( TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_8_1, - TransportVersionUtils.getPreviousVersion(TransportVersion.V_8_0_0) + TransportVersions.V_7_8_1, + TransportVersionUtils.getPreviousVersion(TransportVersions.V_8_0_0) ) ); } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ClientHelperTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ClientHelperTests.java index f26152d66045d..4119bb7c3d60d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ClientHelperTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ClientHelperTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.cluster.health.ClusterHealthAction; import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; @@ -444,7 +445,7 @@ public void testGetPersistableSafeSecurityHeaders() throws IOException { // Rewritten for older version final TransportVersion previousVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, TransportVersionUtils.getPreviousVersion() ); when(clusterState.getMinTransportVersion()).thenReturn(previousVersion); diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/LifecycleOperationMetadataTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/LifecycleOperationMetadataTests.java index 7c57a9cf04784..868bbc03b652c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/LifecycleOperationMetadataTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/LifecycleOperationMetadataTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.test.AbstractChunkedSerializingTestCase; @@ -54,7 +55,7 @@ protected Metadata.Custom mutateInstance(Metadata.Custom instance) { public void testMinimumSupportedVersion() { TransportVersion min = createTestInstance().getMinimalSupportedVersion(); assertTrue( - min.onOrBefore(TransportVersionUtils.randomVersionBetween(random(), TransportVersion.V_8_7_0, TransportVersion.current())) + min.onOrBefore(TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_8_7_0, TransportVersion.current())) ); } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/RolloverActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/RolloverActionTests.java index 9ec5160ce5b22..cb13e694f9c24 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/RolloverActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/RolloverActionTests.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ilm; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.admin.indices.rollover.RolloverConditions; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.unit.ByteSizeValue; @@ -150,12 +150,12 @@ public void testToSteps() { public void testBwcSerializationWithMaxPrimaryShardDocs() throws Exception { // In case of serializing to node with older version, replace maxPrimaryShardDocs with maxDocs. RolloverAction instance = new RolloverAction(null, null, null, null, 1L, null, null, null, null, null); - RolloverAction deserializedInstance = copyInstance(instance, TransportVersion.V_8_1_0); + RolloverAction deserializedInstance = copyInstance(instance, TransportVersions.V_8_1_0); assertThat(deserializedInstance.getConditions().getMaxPrimaryShardDocs(), nullValue()); // But not if maxDocs is also specified: instance = new RolloverAction(null, null, null, 2L, 1L, null, null, null, null, null); - deserializedInstance = copyInstance(instance, TransportVersion.V_8_1_0); + deserializedInstance = copyInstance(instance, TransportVersions.V_8_1_0); assertThat(deserializedInstance.getConditions().getMaxPrimaryShardDocs(), nullValue()); assertThat(deserializedInstance.getConditions().getMaxDocs(), equalTo(instance.getConditions().getMaxDocs())); } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/AbstractBWCWireSerializationTestCase.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/AbstractBWCWireSerializationTestCase.java index 7f8e6c72d3fff..e9a5b08f8051d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/AbstractBWCWireSerializationTestCase.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/AbstractBWCWireSerializationTestCase.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ml; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.test.AbstractWireSerializingTestCase; @@ -19,7 +20,7 @@ public abstract class AbstractBWCWireSerializationTestCase extends AbstractWireSerializingTestCase { public static List getAllBWCVersions() { - int minCompatVersion = Collections.binarySearch(ALL_VERSIONS, TransportVersion.MINIMUM_COMPATIBLE); + int minCompatVersion = Collections.binarySearch(ALL_VERSIONS, TransportVersions.MINIMUM_COMPATIBLE); return ALL_VERSIONS.subList(minCompatVersion, ALL_VERSIONS.size()); } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/FlushJobActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/FlushJobActionRequestTests.java index be82f11b00260..232cf8bf03b1c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/FlushJobActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/FlushJobActionRequestTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.xpack.core.ml.AbstractBWCWireSerializationTestCase; import org.elasticsearch.xpack.core.ml.action.FlushJobAction.Request; @@ -52,7 +53,7 @@ protected Writeable.Reader instanceReader() { @Override protected Request mutateInstanceForVersion(Request instance, TransportVersion version) { - if (version.before(TransportVersion.V_8_500_012)) { + if (version.before(TransportVersions.V_8_500_012)) { instance.setRefreshRequired(true); } return instance; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsActionResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsActionResponseTests.java index 1b21dc547a8ac..7da61dec302a5 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsActionResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsActionResponseTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.ingest.IngestStats; import org.elasticsearch.xpack.core.action.util.QueryPage; @@ -78,7 +79,7 @@ protected Writeable.Reader instanceReader() { @Override protected Response mutateInstanceForVersion(Response instance, TransportVersion version) { - if (version.before(TransportVersion.V_8_0_0)) { + if (version.before(TransportVersions.V_8_0_0)) { return new Response( new QueryPage<>( instance.getResources() @@ -99,7 +100,7 @@ protected Response mutateInstanceForVersion(Response instance, TransportVersion RESULTS_FIELD ) ); - } else if (version.before(TransportVersion.V_8_1_0)) { + } else if (version.before(TransportVersions.V_8_1_0)) { return new Response( new QueryPage<>( instance.getResources() @@ -157,7 +158,7 @@ protected Response mutateInstanceForVersion(Response instance, TransportVersion RESULTS_FIELD ) ); - } else if (version.before(TransportVersion.V_8_2_0)) { + } else if (version.before(TransportVersions.V_8_2_0)) { return new Response( new QueryPage<>( instance.getResources() @@ -215,7 +216,7 @@ protected Response mutateInstanceForVersion(Response instance, TransportVersion RESULTS_FIELD ) ); - } else if (version.before(TransportVersion.V_8_4_0)) { + } else if (version.before(TransportVersions.V_8_4_0)) { return new Response( new QueryPage<>( instance.getResources() @@ -273,7 +274,7 @@ protected Response mutateInstanceForVersion(Response instance, TransportVersion RESULTS_FIELD ) ); - } else if (version.before(TransportVersion.V_8_5_0)) { + } else if (version.before(TransportVersions.V_8_5_0)) { return new Response( new QueryPage<>( instance.getResources() @@ -331,7 +332,7 @@ protected Response mutateInstanceForVersion(Response instance, TransportVersion RESULTS_FIELD ) ); - } else if (version.before(TransportVersion.V_8_6_0)) { + } else if (version.before(TransportVersions.V_8_6_0)) { // priority added return new Response( new QueryPage<>( @@ -390,7 +391,7 @@ protected Response mutateInstanceForVersion(Response instance, TransportVersion RESULTS_FIELD ) ); - } else if (version.before(TransportVersion.V_8_8_0)) { + } else if (version.before(TransportVersions.V_8_8_0)) { // deployment_id added return new Response( new QueryPage<>( diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferModelActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferModelActionRequestTests.java index ebd348ea567e9..2f073cb32d09a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferModelActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferModelActionRequestTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; @@ -179,7 +180,7 @@ protected Request mutateInstanceForVersion(Request instance, TransportVersion ve adjustedUpdate = currentUpdate; } - if (version.before(TransportVersion.V_8_3_0)) { + if (version.before(TransportVersions.V_8_3_0)) { return new Request( instance.getId(), adjustedUpdate, @@ -188,7 +189,7 @@ protected Request mutateInstanceForVersion(Request instance, TransportVersion ve TimeValue.MAX_VALUE, instance.isPreviouslyLicensed() ); - } else if (version.before(TransportVersion.V_8_7_0)) { + } else if (version.before(TransportVersions.V_8_7_0)) { return new Request( instance.getId(), adjustedUpdate, @@ -197,7 +198,7 @@ protected Request mutateInstanceForVersion(Request instance, TransportVersion ve instance.getInferenceTimeout(), instance.isPreviouslyLicensed() ); - } else if (version.before(TransportVersion.V_8_8_0)) { + } else if (version.before(TransportVersions.V_8_8_0)) { var r = new Request( instance.getId(), adjustedUpdate, diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentResponseTests.java index 61bb883739e73..4db7d05b60658 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentResponseTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.xcontent.NamedXContentRegistry; @@ -67,7 +68,7 @@ protected InferTrainedModelDeploymentAction.Response mutateInstanceForVersion( InferTrainedModelDeploymentAction.Response instance, TransportVersion version ) { - if (version.before(TransportVersion.V_8_6_1)) { + if (version.before(TransportVersions.V_8_6_1)) { return new InferTrainedModelDeploymentAction.Response(instance.getResults().subList(0, 1)); } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelDefinitionPartActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelDefinitionPartActionRequestTests.java index 99cc52e180ca7..4ffa2e27fe60c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelDefinitionPartActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelDefinitionPartActionRequestTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.Writeable; @@ -71,7 +72,7 @@ protected Writeable.Reader instanceReader() { @Override protected Request mutateInstanceForVersion(Request instance, TransportVersion version) { - if (version.before(TransportVersion.V_8_500_043)) { + if (version.before(TransportVersions.V_8_500_043)) { return new Request( instance.getModelId(), instance.getDefinition(), diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/AggProviderWireSerializationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/AggProviderWireSerializationTests.java index dbe852b5f6a82..6e3aad0c8bc11 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/AggProviderWireSerializationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/AggProviderWireSerializationTests.java @@ -8,6 +8,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; @@ -73,7 +74,7 @@ public static AggProvider createRandomValidAggProvider() { @Override protected AggProvider mutateInstanceForVersion(AggProvider instance, TransportVersion version) { - if (version.before(TransportVersion.V_8_0_0)) { + if (version.before(TransportVersions.V_8_0_0)) { return new AggProvider(instance.getAggs(), instance.getParsedAggs(), instance.getParsingException(), false); } return instance; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigTests.java index 5857eca3789b2..e0318e3c63bc5 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigTests.java @@ -11,6 +11,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; @@ -116,7 +117,7 @@ protected DataFrameAnalyticsConfig mutateInstanceForVersion(DataFrameAnalyticsCo if (instance.getAnalysis() instanceof Classification) { builder.setAnalysis(ClassificationTests.mutateForVersion((Classification) instance.getAnalysis(), version)); } - if (version.before(TransportVersion.V_8_8_0)) { + if (version.before(TransportVersions.V_8_8_0)) { builder.setMeta(null); } return builder.build(); diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertJapaneseTokenizationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertJapaneseTokenizationTests.java index cd763fd0ffcab..79c069afbd4ab 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertJapaneseTokenizationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertJapaneseTokenizationTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; @@ -20,7 +21,7 @@ public class BertJapaneseTokenizationTests extends AbstractBWCSerializationTestC private boolean lenient; public static BertJapaneseTokenization mutateForVersion(BertJapaneseTokenization instance, TransportVersion version) { - if (version.before(TransportVersion.V_8_2_0)) { + if (version.before(TransportVersions.V_8_2_0)) { return new BertJapaneseTokenization( instance.doLowerCase, instance.withSpecialTokens, diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertJapaneseTokenizationUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertJapaneseTokenizationUpdateTests.java index 99ec0905687c0..f8f87b2eb4144 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertJapaneseTokenizationUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertJapaneseTokenizationUpdateTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.xpack.core.ml.AbstractBWCWireSerializationTestCase; @@ -74,7 +75,7 @@ protected BertJapaneseTokenizationUpdate mutateInstance(BertJapaneseTokenization @Override protected BertJapaneseTokenizationUpdate mutateInstanceForVersion(BertJapaneseTokenizationUpdate instance, TransportVersion version) { - if (version.before(TransportVersion.V_8_2_0)) { + if (version.before(TransportVersions.V_8_2_0)) { return new BertJapaneseTokenizationUpdate(instance.getTruncate(), null); } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenizationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenizationTests.java index d7d62eae9b03c..a00ebec79a862 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenizationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenizationTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; @@ -20,7 +21,7 @@ public class BertTokenizationTests extends AbstractBWCSerializationTestCase { public static TextEmbeddingConfig mutateForVersion(TextEmbeddingConfig instance, TransportVersion version) { - if (version.before(TransportVersion.V_8_8_0)) { + if (version.before(TransportVersions.V_8_8_0)) { return new TextEmbeddingConfig( instance.getVocabularyConfig(), InferenceConfigTestScaffolding.mutateTokenizationForVersion(instance.getTokenization(), version), diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdateTests.java index 3f3e5201efdcc..06abb12bdb0a2 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdateTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.Tuple; import org.elasticsearch.xcontent.XContentParser; @@ -35,7 +36,7 @@ public static TextEmbeddingConfigUpdate randomUpdate() { } public static TextEmbeddingConfigUpdate mutateForVersion(TextEmbeddingConfigUpdate instance, TransportVersion version) { - if (version.before(TransportVersion.V_8_1_0)) { + if (version.before(TransportVersions.V_8_1_0)) { return new TextEmbeddingConfigUpdate(instance.getResultsField(), null); } return instance; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextExpansionConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextExpansionConfigUpdateTests.java index 5d244441348e1..ba373dfd23b64 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextExpansionConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextExpansionConfigUpdateTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.Tuple; import org.elasticsearch.xcontent.XContentParser; @@ -30,7 +31,7 @@ public static TextExpansionConfigUpdate randomUpdate() { } public static TextExpansionConfigUpdate mutateForVersion(TextExpansionConfigUpdate instance, TransportVersion version) { - if (version.before(TransportVersion.V_8_1_0)) { + if (version.before(TransportVersions.V_8_1_0)) { return new TextExpansionConfigUpdate(instance.getResultsField(), null); } return instance; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextSimilarityConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextSimilarityConfigUpdateTests.java index 23bb6e1e15452..b8b5f50d15bae 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextSimilarityConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextSimilarityConfigUpdateTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.Tuple; import org.elasticsearch.xcontent.XContentParser; @@ -40,7 +41,7 @@ public static TextSimilarityConfigUpdate randomUpdate() { } public static TextSimilarityConfigUpdate mutateForVersion(TextSimilarityConfigUpdate instance, TransportVersion version) { - if (version.before(TransportVersion.V_8_1_0)) { + if (version.before(TransportVersions.V_8_1_0)) { return new TextSimilarityConfigUpdate(instance.getText(), instance.getResultsField(), null, null); } return instance; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/XLMRobertaTokenizationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/XLMRobertaTokenizationTests.java index 80b3db42ade64..c7525b1c571a2 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/XLMRobertaTokenizationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/XLMRobertaTokenizationTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; @@ -20,7 +21,7 @@ public class XLMRobertaTokenizationTests extends AbstractBWCSerializationTestCas private boolean lenient; public static XLMRobertaTokenization mutateForVersion(XLMRobertaTokenization instance, TransportVersion version) { - if (version.before(TransportVersion.V_8_2_0)) { + if (version.before(TransportVersions.V_8_2_0)) { return new XLMRobertaTokenization(instance.withSpecialTokens, instance.maxSequenceLength, instance.truncate, null); } return instance; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/XLMRobertaTokenizationUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/XLMRobertaTokenizationUpdateTests.java index 8b0b3b6117646..90492cbcfde1c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/XLMRobertaTokenizationUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/XLMRobertaTokenizationUpdateTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.xpack.core.ml.AbstractBWCWireSerializationTestCase; @@ -67,7 +68,7 @@ protected XLMRobertaTokenizationUpdate mutateInstance(XLMRobertaTokenizationUpda @Override protected XLMRobertaTokenizationUpdate mutateInstanceForVersion(XLMRobertaTokenizationUpdate instance, TransportVersion version) { - if (version.before(TransportVersion.V_8_2_0)) { + if (version.before(TransportVersions.V_8_2_0)) { return new XLMRobertaTokenizationUpdate(instance.getTruncate(), null); } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java index 0fadd891cb027..09c8eed048d96 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.Tuple; import org.elasticsearch.xcontent.XContentParser; @@ -37,7 +38,7 @@ public static ZeroShotClassificationConfigUpdate mutateForVersion( ZeroShotClassificationConfigUpdate instance, TransportVersion version ) { - if (version.before(TransportVersion.V_8_1_0)) { + if (version.before(TransportVersions.V_8_1_0)) { return new ZeroShotClassificationConfigUpdate(instance.getLabels(), instance.getMultiLabel(), instance.getResultsField(), null); } return instance; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/apikey/CreateApiKeyRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/apikey/CreateApiKeyRequestTests.java index bac11d9f0fc53..63dd636a31c3f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/apikey/CreateApiKeyRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/apikey/CreateApiKeyRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.security.action.apikey; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.io.stream.BytesStreamOutput; @@ -161,12 +161,12 @@ public void testSerialization() throws IOException { try (BytesStreamOutput out = new BytesStreamOutput()) { if (testV710Bwc) { - out.setTransportVersion(TransportVersion.V_7_9_0); // a version before 7.10 + out.setTransportVersion(TransportVersions.V_7_9_0); // a version before 7.10 } request.writeTo(out); try (StreamInput in = out.bytes().streamInput()) { if (testV710Bwc) { - in.setTransportVersion(TransportVersion.V_7_9_0); + in.setTransportVersion(TransportVersions.V_7_9_0); } final CreateApiKeyRequest serialized = new CreateApiKeyRequest(in); assertEquals(name, serialized.getName()); diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/apikey/GetApiKeyRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/apikey/GetApiKeyRequestTests.java index 1001cd4863f5d..e4a443eb2ab22 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/apikey/GetApiKeyRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/apikey/GetApiKeyRequestTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.security.action.apikey; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.InputStreamStreamInput; @@ -134,11 +135,11 @@ public void testSerialization() throws IOException { final GetApiKeyRequest getApiKeyRequest = GetApiKeyRequest.builder().ownedByAuthenticatedUser(true).apiKeyId(apiKeyId).build(); ByteArrayOutputStream outBuffer = new ByteArrayOutputStream(); OutputStreamStreamOutput out = new OutputStreamStreamOutput(outBuffer); - out.setTransportVersion(randomVersionBetween(random(), TransportVersion.V_7_0_0, TransportVersion.V_7_3_0)); + out.setTransportVersion(randomVersionBetween(random(), TransportVersions.V_7_0_0, TransportVersions.V_7_3_0)); getApiKeyRequest.writeTo(out); InputStreamStreamInput inputStreamStreamInput = new InputStreamStreamInput(new ByteArrayInputStream(outBuffer.toByteArray())); - inputStreamStreamInput.setTransportVersion(randomVersionBetween(random(), TransportVersion.V_7_0_0, TransportVersion.V_7_3_0)); + inputStreamStreamInput.setTransportVersion(randomVersionBetween(random(), TransportVersions.V_7_0_0, TransportVersions.V_7_3_0)); GetApiKeyRequest requestFromInputStream = new GetApiKeyRequest(inputStreamStreamInput); assertThat(requestFromInputStream.getApiKeyId(), equalTo(getApiKeyRequest.getApiKeyId())); @@ -154,11 +155,11 @@ public void testSerialization() throws IOException { .build(); ByteArrayOutputStream outBuffer = new ByteArrayOutputStream(); OutputStreamStreamOutput out = new OutputStreamStreamOutput(outBuffer); - out.setTransportVersion(randomVersionBetween(random(), TransportVersion.V_7_4_0, TransportVersion.V_8_4_0)); + out.setTransportVersion(randomVersionBetween(random(), TransportVersions.V_7_4_0, TransportVersions.V_8_4_0)); getApiKeyRequest.writeTo(out); InputStreamStreamInput inputStreamStreamInput = new InputStreamStreamInput(new ByteArrayInputStream(outBuffer.toByteArray())); - inputStreamStreamInput.setTransportVersion(randomVersionBetween(random(), TransportVersion.V_7_4_0, TransportVersion.V_8_4_0)); + inputStreamStreamInput.setTransportVersion(randomVersionBetween(random(), TransportVersions.V_7_4_0, TransportVersions.V_8_4_0)); GetApiKeyRequest requestFromInputStream = new GetApiKeyRequest(inputStreamStreamInput); assertThat(requestFromInputStream.getApiKeyId(), equalTo(getApiKeyRequest.getApiKeyId())); @@ -178,11 +179,11 @@ public void testSerialization() throws IOException { ByteArrayOutputStream outBuffer = new ByteArrayOutputStream(); OutputStreamStreamOutput out = new OutputStreamStreamOutput(outBuffer); TransportVersion beforeActiveOnly = TransportVersionUtils.getPreviousVersion(API_KEY_ACTIVE_ONLY_PARAM_TRANSPORT_VERSION); - out.setTransportVersion(randomVersionBetween(random(), TransportVersion.V_8_5_0, beforeActiveOnly)); + out.setTransportVersion(randomVersionBetween(random(), TransportVersions.V_8_5_0, beforeActiveOnly)); getApiKeyRequest.writeTo(out); InputStreamStreamInput inputStreamStreamInput = new InputStreamStreamInput(new ByteArrayInputStream(outBuffer.toByteArray())); - inputStreamStreamInput.setTransportVersion(randomVersionBetween(random(), TransportVersion.V_8_5_0, beforeActiveOnly)); + inputStreamStreamInput.setTransportVersion(randomVersionBetween(random(), TransportVersions.V_8_5_0, beforeActiveOnly)); GetApiKeyRequest requestFromInputStream = new GetApiKeyRequest(inputStreamStreamInput); assertThat(requestFromInputStream.getApiKeyId(), equalTo(getApiKeyRequest.getApiKeyId())); diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/apikey/InvalidateApiKeyRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/apikey/InvalidateApiKeyRequestTests.java index ab324f7dbbe53..db1ea1f6e6617 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/apikey/InvalidateApiKeyRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/apikey/InvalidateApiKeyRequestTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.security.action.apikey; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.Strings; @@ -119,7 +120,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeOptionalString(realm); out.writeOptionalString(user); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_10_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_10_0)) { if (Strings.hasText(apiKeyId)) { out.writeOptionalStringArray(new String[] { apiKeyId }); } else { @@ -161,8 +162,8 @@ public void writeTo(StreamOutput out) throws IOException { ) { TransportVersion streamVersion = randomVersionBetween( random(), - TransportVersion.V_7_4_0, - getPreviousVersion(TransportVersion.V_7_10_0) + TransportVersions.V_7_4_0, + getPreviousVersion(TransportVersions.V_7_10_0) ); Dummy d = new Dummy(inputs[caseNo]); osso.setTransportVersion(streamVersion); @@ -188,11 +189,11 @@ public void testSerialization() throws IOException { { ByteArrayOutputStream outBuffer = new ByteArrayOutputStream(); OutputStreamStreamOutput out = new OutputStreamStreamOutput(outBuffer); - out.setTransportVersion(randomVersionBetween(random(), TransportVersion.V_7_0_0, TransportVersion.V_7_3_0)); + out.setTransportVersion(randomVersionBetween(random(), TransportVersions.V_7_0_0, TransportVersions.V_7_3_0)); invalidateApiKeyRequest.writeTo(out); InputStreamStreamInput inputStreamStreamInput = new InputStreamStreamInput(new ByteArrayInputStream(outBuffer.toByteArray())); - inputStreamStreamInput.setTransportVersion(randomVersionBetween(random(), TransportVersion.V_7_0_0, TransportVersion.V_7_3_0)); + inputStreamStreamInput.setTransportVersion(randomVersionBetween(random(), TransportVersions.V_7_0_0, TransportVersions.V_7_3_0)); InvalidateApiKeyRequest requestFromInputStream = new InvalidateApiKeyRequest(inputStreamStreamInput); assertThat(requestFromInputStream.getIds(), equalTo(invalidateApiKeyRequest.getIds())); @@ -202,11 +203,11 @@ public void testSerialization() throws IOException { { ByteArrayOutputStream outBuffer = new ByteArrayOutputStream(); OutputStreamStreamOutput out = new OutputStreamStreamOutput(outBuffer); - out.setTransportVersion(randomVersionBetween(random(), TransportVersion.V_7_4_0, TransportVersion.V_7_9_0)); + out.setTransportVersion(randomVersionBetween(random(), TransportVersions.V_7_4_0, TransportVersions.V_7_9_0)); invalidateApiKeyRequest.writeTo(out); InputStreamStreamInput inputStreamStreamInput = new InputStreamStreamInput(new ByteArrayInputStream(outBuffer.toByteArray())); - inputStreamStreamInput.setTransportVersion(randomVersionBetween(random(), TransportVersion.V_7_4_0, TransportVersion.V_7_9_0)); + inputStreamStreamInput.setTransportVersion(randomVersionBetween(random(), TransportVersions.V_7_4_0, TransportVersions.V_7_9_0)); InvalidateApiKeyRequest requestFromInputStream = new InvalidateApiKeyRequest(inputStreamStreamInput); assertThat(requestFromInputStream, equalTo(invalidateApiKeyRequest)); @@ -214,12 +215,12 @@ public void testSerialization() throws IOException { { ByteArrayOutputStream outBuffer = new ByteArrayOutputStream(); OutputStreamStreamOutput out = new OutputStreamStreamOutput(outBuffer); - out.setTransportVersion(randomVersionBetween(random(), TransportVersion.V_7_10_0, TransportVersion.current())); + out.setTransportVersion(randomVersionBetween(random(), TransportVersions.V_7_10_0, TransportVersion.current())); invalidateApiKeyRequest.writeTo(out); InputStreamStreamInput inputStreamStreamInput = new InputStreamStreamInput(new ByteArrayInputStream(outBuffer.toByteArray())); inputStreamStreamInput.setTransportVersion( - randomVersionBetween(random(), TransportVersion.V_7_10_0, TransportVersion.current()) + randomVersionBetween(random(), TransportVersions.V_7_10_0, TransportVersion.current()) ); InvalidateApiKeyRequest requestFromInputStream = new InvalidateApiKeyRequest(inputStreamStreamInput); @@ -237,7 +238,7 @@ public void testSerializationWillThrowWhenMultipleIdsAndOldVersionStream() { ); ByteArrayOutputStream outBuffer = new ByteArrayOutputStream(); OutputStreamStreamOutput out = new OutputStreamStreamOutput(outBuffer); - out.setTransportVersion(randomVersionBetween(random(), TransportVersion.V_7_4_0, getPreviousVersion(TransportVersion.V_7_10_0))); + out.setTransportVersion(randomVersionBetween(random(), TransportVersions.V_7_4_0, getPreviousVersion(TransportVersions.V_7_10_0))); final IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> invalidateApiKeyRequest.writeTo(out)); assertThat(e.getMessage(), containsString("a request with multi-valued field [ids] cannot be sent to an older version")); } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequestTests.java index 1acdb3b161afc..d864a89581a18 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequestTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.security.action.role; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.Strings; @@ -173,7 +174,7 @@ public void testSerialization() throws IOException { logger.info("Serializing with version {}", version); out.setTransportVersion(version); } - final boolean mayIncludeRemoteIndices = out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0); + final boolean mayIncludeRemoteIndices = out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0); final PutRoleRequest original = buildRandomRequest(mayIncludeRemoteIndices); original.writeTo(out); @@ -190,11 +191,11 @@ public void testSerialization() throws IOException { public void testSerializationWithRemoteIndicesThrowsOnUnsupportedVersions() throws IOException { final BytesStreamOutput out = new BytesStreamOutput(); final TransportVersion versionBeforeAdvancedRemoteClusterSecurity = TransportVersionUtils.getPreviousVersion( - TransportVersion.V_8_8_0 + TransportVersions.V_8_8_0 ); final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_17_0, + TransportVersions.V_7_17_0, versionBeforeAdvancedRemoteClusterSecurity ); out.setTransportVersion(version); @@ -206,7 +207,7 @@ public void testSerializationWithRemoteIndicesThrowsOnUnsupportedVersions() thro ex.getMessage(), containsString( "versions of Elasticsearch before [" - + TransportVersion.V_8_8_0 + + TransportVersions.V_8_8_0 + "] can't handle remote indices privileges and attempted to send to [" + version + "]" diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponseTests.java index 3fa5044a8883e..9556d09186311 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponseTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.security.action.user; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.ByteBufferStreamInput; @@ -65,7 +66,7 @@ public void testSerialization() throws IOException { public void testSerializationForCurrentVersion() throws Exception { final TransportVersion version = TransportVersionUtils.randomCompatibleVersion(random()); - final boolean canIncludeRemoteIndices = version.onOrAfter(TransportVersion.V_8_8_0); + final boolean canIncludeRemoteIndices = version.onOrAfter(TransportVersions.V_8_8_0); final GetUserPrivilegesResponse original = randomResponse(canIncludeRemoteIndices); @@ -83,11 +84,11 @@ public void testSerializationForCurrentVersion() throws Exception { public void testSerializationWithRemoteIndicesThrowsOnUnsupportedVersions() throws IOException { final BytesStreamOutput out = new BytesStreamOutput(); final TransportVersion versionBeforeAdvancedRemoteClusterSecurity = TransportVersionUtils.getPreviousVersion( - TransportVersion.V_8_8_0 + TransportVersions.V_8_8_0 ); final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_17_0, + TransportVersions.V_7_17_0, versionBeforeAdvancedRemoteClusterSecurity ); out.setTransportVersion(version); @@ -99,7 +100,7 @@ public void testSerializationWithRemoteIndicesThrowsOnUnsupportedVersions() thro ex.getMessage(), containsString( "versions of Elasticsearch before [" - + TransportVersion.V_8_8_0 + + TransportVersions.V_8_8_0 + "] can't handle remote indices privileges and attempted to send to [" + version + "]" diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationSerializationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationSerializationTests.java index 6b2b3748ce36b..b098b686f6c2c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationSerializationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationSerializationTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.security.authc; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.test.ESTestCase; @@ -83,7 +84,7 @@ public void testWriteToWithCrossClusterAccessThrowsOnUnsupportedVersion() throws final BytesStreamOutput out = new BytesStreamOutput(); final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_17_0, + TransportVersions.V_7_17_0, TransportVersionUtils.getPreviousVersion(RemoteClusterPortSettings.TRANSPORT_VERSION_ADVANCED_REMOTE_CLUSTER_SECURITY) ); out.setTransportVersion(version); diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationTests.java index 7014b9f299cd9..e1a60d41ca212 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.security.authc; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; @@ -662,10 +663,10 @@ public void testDomainSerialize() throws Exception { } try (BytesStreamOutput out = new BytesStreamOutput()) { - out.setTransportVersion(TransportVersion.V_8_0_0); + out.setTransportVersion(TransportVersions.V_8_0_0); test.writeTo(out); StreamInput in = out.bytes().streamInput(); - in.setTransportVersion(TransportVersion.V_8_0_0); + in.setTransportVersion(TransportVersions.V_8_0_0); Authentication testBack = new Authentication(in); assertThat(testBack.getDomain(), nullValue()); assertThat(testBack.isAssignedToDomain(), is(false)); @@ -847,7 +848,7 @@ public void testMaybeRewriteForOlderVersionWithCrossClusterAccessThrowsOnUnsuppo ); final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_17_0, // the minimum compatible version of 8.x + TransportVersions.V_7_17_0, // the minimum compatible version of 8.x versionBeforeCrossClusterAccessRealm ); @@ -909,7 +910,7 @@ public void testMaybeRewriteMetadataForCrossClusterAccessAuthentication() throws // pick a version before that of the authentication instance to force a rewrite final TransportVersion olderVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, TransportVersionUtils.getPreviousVersion(authentication.getEffectiveSubject().getTransportVersion()) ); @@ -952,7 +953,7 @@ public void testCopyWithFilteredMetadataFields() { public void testMaybeRewriteForOlderVersionErasesDomainForVersionsBeforeDomains() { final TransportVersion olderVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_17_0, + TransportVersions.V_7_17_0, TransportVersionUtils.getPreviousVersion(Authentication.VERSION_REALM_DOMAINS) ); final Authentication authentication = AuthenticationTestHelper.builder() @@ -1171,7 +1172,7 @@ public static Authentication randomAuthentication(User user, RealmRef realmRef, realmRef = randomRealmRef(false); } // If the realm is expected to have a domain, we need a version that's at least compatible with domains - final TransportVersion minVersion = realmRef.getDomain() != null ? Authentication.VERSION_REALM_DOMAINS : TransportVersion.V_7_0_0; + final TransportVersion minVersion = realmRef.getDomain() != null ? Authentication.VERSION_REALM_DOMAINS : TransportVersions.V_7_0_0; final TransportVersion version = TransportVersionUtils.randomVersionBetween(random(), minVersion, TransportVersion.current()); final Map metadata; if (randomBoolean()) { @@ -1188,7 +1189,7 @@ public static Authentication randomApiKeyAuthentication(User user, String apiKey return randomApiKeyAuthentication( user, apiKeyId, - TransportVersionUtils.randomVersionBetween(random(), TransportVersion.V_7_0_0, TransportVersion.current()) + TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_7_0_0, TransportVersion.current()) ); } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/SubjectTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/SubjectTests.java index 6e5bf4ffcdc5a..1c4592c331080 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/SubjectTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/SubjectTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.security.authc; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; @@ -302,7 +303,7 @@ public void testGetRoleReferencesForApiKeyBwc() { final Subject subject = new Subject( new User("joe"), new Authentication.RealmRef(API_KEY_REALM_NAME, API_KEY_REALM_TYPE, "node"), - TransportVersionUtils.randomVersionBetween(random(), TransportVersion.V_7_0_0, TransportVersion.V_7_8_1), + TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_7_0_0, TransportVersions.V_7_8_1), authMetadata ); diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptorTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptorTests.java index bb7d04d5aeb17..294ad7e975286 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptorTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptorTests.java @@ -8,6 +8,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; @@ -495,7 +496,7 @@ public void testParsingFieldPermissionsUsesCache() throws IOException { public void testSerializationForCurrentVersion() throws Exception { final TransportVersion version = TransportVersionUtils.randomCompatibleVersion(random()); - final boolean canIncludeRemoteIndices = version.onOrAfter(TransportVersion.V_8_8_0); + final boolean canIncludeRemoteIndices = version.onOrAfter(TransportVersions.V_8_8_0); final boolean canIncludeWorkflows = version.onOrAfter(WORKFLOWS_RESTRICTION_VERSION); logger.info("Testing serialization with version {}", version); BytesStreamOutput output = new BytesStreamOutput(); @@ -515,10 +516,10 @@ public void testSerializationForCurrentVersion() throws Exception { } public void testSerializationWithRemoteIndicesThrowsOnUnsupportedVersions() throws IOException { - final TransportVersion versionBeforeRemoteIndices = TransportVersionUtils.getPreviousVersion(TransportVersion.V_8_8_0); + final TransportVersion versionBeforeRemoteIndices = TransportVersionUtils.getPreviousVersion(TransportVersions.V_8_8_0); final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_17_0, + TransportVersions.V_7_17_0, versionBeforeRemoteIndices ); final BytesStreamOutput output = new BytesStreamOutput(); @@ -560,7 +561,7 @@ public void testSerializationWithWorkflowsRestrictionAndUnsupportedVersions() th final TransportVersion versionBeforeWorkflowsRestriction = TransportVersionUtils.getPreviousVersion(WORKFLOWS_RESTRICTION_VERSION); final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_17_0, + TransportVersions.V_7_17_0, versionBeforeWorkflowsRestriction ); final BytesStreamOutput output = new BytesStreamOutput(); diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ssl/cert/CertificateInfoTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ssl/cert/CertificateInfoTests.java index e76f74371151c..dbf416ddbe1bc 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ssl/cert/CertificateInfoTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ssl/cert/CertificateInfoTests.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ssl.cert; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.InputStreamStreamInput; @@ -94,12 +94,12 @@ public void testMissingIssuer() throws Exception { // send from old ByteArrayOutputStream outBuffer = new ByteArrayOutputStream(); OutputStreamStreamOutput out = new OutputStreamStreamOutput(outBuffer); - out.setTransportVersion(TransportVersion.V_8_3_0); + out.setTransportVersion(TransportVersions.V_8_3_0); certInfo.writeTo(out); // receive from old ByteArrayInputStream inBuffer = new ByteArrayInputStream(outBuffer.toByteArray()); StreamInput in = new InputStreamStreamInput(inBuffer); - in.setTransportVersion(TransportVersion.V_8_3_0); + in.setTransportVersion(TransportVersions.V_8_3_0); CertificateInfo certInfoFromOld = new CertificateInfo(in); // convert to a JSON string String toXContentString = Strings.toString(certInfoFromOld.toXContent(XContentFactory.jsonBuilder(), ToXContent.EMPTY_PARAMS)); diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TransportTermsEnumActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TransportTermsEnumActionTests.java index f2328d2837d03..bc38a1aa007b5 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TransportTermsEnumActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TransportTermsEnumActionTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core.termsenum; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; @@ -69,7 +70,7 @@ public void onFailure(final Exception e) { */ public void testCCSCheckCompatibility() throws Exception { TermsEnumRequest request = new TermsEnumRequest().field("field").timeout(TimeValue.timeValueSeconds(5)); - TransportVersion version = TransportVersionUtils.getNextVersion(TransportVersion.MINIMUM_CCS_VERSION, true); + TransportVersion version = TransportVersionUtils.getNextVersion(TransportVersions.MINIMUM_CCS_VERSION, true); request.indexFilter(new DummyQueryBuilder() { @Override public TransportVersion getMinimalSupportedVersion() { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedAggregationBuilder.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedAggregationBuilder.java index dc5e863346b52..da65edb957b94 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedAggregationBuilder.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.transform; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.logging.DeprecationCategory; @@ -104,6 +105,6 @@ public static MockDeprecatedAggregationBuilder fromXContent(XContentParser p) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedQueryBuilder.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedQueryBuilder.java index 5f55c3bc40c91..145263beb0eb3 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedQueryBuilder.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedQueryBuilder.java @@ -9,6 +9,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -87,6 +88,6 @@ protected int doHashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformHealthIssueTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformHealthIssueTests.java index a282668141027..9a16ef41e959b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformHealthIssueTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformHealthIssueTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.transform.transforms; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.test.AbstractWireSerializingTestCase; @@ -53,7 +53,7 @@ public void testMissingTypePre88() throws IOException { getNamedWriteableRegistry(), StreamOutput::writeWriteable, TransformHealthIssue::new, - TransportVersion.V_8_7_0 + TransportVersions.V_8_7_0 ); assertThat(deserializedIssue.getType(), is(equalTo("unknown"))); } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStateTests.java index b8a71359c2def..e01549032be5e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStateTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.transform.transforms; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.Writeable.Reader; @@ -92,10 +92,10 @@ public void testBackwardsSerialization() throws IOException { null ); try (BytesStreamOutput output = new BytesStreamOutput()) { - output.setTransportVersion(TransportVersion.V_7_5_0); + output.setTransportVersion(TransportVersions.V_7_5_0); state.writeTo(output); try (StreamInput in = output.bytes().streamInput()) { - in.setTransportVersion(TransportVersion.V_7_5_0); + in.setTransportVersion(TransportVersions.V_7_5_0); TransformState streamedState = new TransformState(in); assertEquals(expectedState, streamedState); } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSourceTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSourceTests.java index 9bfe4df047c35..ff92bf7e4df91 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSourceTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSourceTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.transform.transforms.pivot; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Rounding; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; @@ -101,10 +101,10 @@ public void testBackwardsSerialization72() throws IOException { ); try (BytesStreamOutput output = new BytesStreamOutput()) { - output.setTransportVersion(TransportVersion.V_7_2_0); + output.setTransportVersion(TransportVersions.V_7_2_0); groupSource.writeTo(output); try (StreamInput in = output.bytes().streamInput()) { - in.setTransportVersion(TransportVersion.V_7_2_0); + in.setTransportVersion(TransportVersions.V_7_2_0); DateHistogramGroupSource streamedGroupSource = new DateHistogramGroupSource(in); assertEquals(groupSource, streamedGroupSource); } diff --git a/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecatedQueryBuilder.java b/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecatedQueryBuilder.java index a2400cab1fedb..205a699d23593 100644 --- a/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecatedQueryBuilder.java +++ b/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecatedQueryBuilder.java @@ -9,6 +9,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -91,6 +92,6 @@ protected boolean doEquals(TestDeprecatedQueryBuilder other) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.ZERO; + return TransportVersions.ZERO; } } diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationInfoAction.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationInfoAction.java index 23421a88ae958..0351db53b6c69 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationInfoAction.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationInfoAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.deprecation; import org.elasticsearch.ElasticsearchStatusException; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; @@ -154,7 +154,7 @@ public Response(StreamInput in) throws IOException { clusterSettingsIssues = in.readCollectionAsList(DeprecationIssue::new); nodeSettingsIssues = in.readCollectionAsList(DeprecationIssue::new); indexSettingsIssues = in.readMapOfLists(DeprecationIssue::new); - if (in.getTransportVersion().before(TransportVersion.V_7_11_0)) { + if (in.getTransportVersion().before(TransportVersions.V_7_11_0)) { List mlIssues = in.readCollectionAsList(DeprecationIssue::new); pluginSettingsIssues = new HashMap<>(); pluginSettingsIssues.put("ml_settings", mlIssues); @@ -204,7 +204,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeCollection(clusterSettingsIssues); out.writeCollection(nodeSettingsIssues); out.writeMap(indexSettingsIssues, StreamOutput::writeCollection); - if (out.getTransportVersion().before(TransportVersion.V_7_11_0)) { + if (out.getTransportVersion().before(TransportVersions.V_7_11_0)) { out.writeCollection(pluginSettingsIssues.getOrDefault("ml_settings", Collections.emptyList())); } else { out.writeMap(pluginSettingsIssues, StreamOutput::writeCollection); diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/EnrichCoordinatorStatsAction.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/EnrichCoordinatorStatsAction.java index aca76b7f7329a..7b2bc64b62c98 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/EnrichCoordinatorStatsAction.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/EnrichCoordinatorStatsAction.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.enrich.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.FailedNodeException; import org.elasticsearch.action.support.ActionFilters; @@ -101,7 +101,7 @@ public static class NodeResponse extends BaseNodeResponse { NodeResponse(StreamInput in) throws IOException { super(in); - this.cacheStats = in.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0) + this.cacheStats = in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0) ? new EnrichStatsAction.Response.CacheStats(in) : null; this.coordinatorStats = new CoordinatorStats(in); @@ -118,7 +118,7 @@ public EnrichStatsAction.Response.CacheStats getCacheStats() { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { cacheStats.writeTo(out); } coordinatorStats.writeTo(out); diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRuleCriteria.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRuleCriteria.java index 6f6a5f33ef5f1..4bed3d0b5a352 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRuleCriteria.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRuleCriteria.java @@ -9,6 +9,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; @@ -36,7 +37,7 @@ public class QueryRuleCriteria implements Writeable, ToXContentObject { - public static final TransportVersion CRITERIA_METADATA_VALUES_TRANSPORT_VERSION = TransportVersion.V_8_500_046; + public static final TransportVersion CRITERIA_METADATA_VALUES_TRANSPORT_VERSION = TransportVersions.V_8_500_046; private final QueryRuleCriteriaType criteriaType; private final String criteriaMetadata; private final List criteriaValues; diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRulesetListItem.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRulesetListItem.java index bedfaae57498f..0a1ff919493c3 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRulesetListItem.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/QueryRulesetListItem.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.application.rules; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -27,7 +28,7 @@ public class QueryRulesetListItem implements Writeable, ToXContentObject { // TODO we need to actually bump transport version, but there's no point until main is merged. Placeholder for now. - public static final TransportVersion EXPANDED_RULESET_COUNT_TRANSPORT_VERSION = TransportVersion.V_8_500_052; + public static final TransportVersion EXPANDED_RULESET_COUNT_TRANSPORT_VERSION = TransportVersions.V_8_500_052; public static final ParseField RULESET_ID_FIELD = new ParseField("ruleset_id"); public static final ParseField RULE_TOTAL_COUNT_FIELD = new ParseField("rule_total_count"); diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/RuleQueryBuilder.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/RuleQueryBuilder.java index 2e4e0bf216ccd..0f445fe50e9d7 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/RuleQueryBuilder.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/rules/RuleQueryBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.util.SetOnce; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.get.GetRequest; import org.elasticsearch.client.internal.Client; import org.elasticsearch.client.internal.OriginSettingClient; @@ -72,7 +73,7 @@ public class RuleQueryBuilder extends AbstractQueryBuilder { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_500_033; + return TransportVersions.V_8_500_033; } public RuleQueryBuilder(QueryBuilder organicQuery, Map matchCriteria, String rulesetId) { diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/SearchApplication.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/SearchApplication.java index fe4034647dbf5..1425f18eaa6cb 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/SearchApplication.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/SearchApplication.java @@ -9,6 +9,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.ReleasableBytesStreamOutput; @@ -54,7 +55,7 @@ public class SearchApplication implements Writeable, ToXContentObject { + "We recommend storing a template to avoid breaking changes."; public static final String NO_ALIAS_WARNING = "Alias is missing for the search application"; - private static final TransportVersion INDICES_REMOVED_TRANSPORT_VERSION = TransportVersion.V_8_500_069; + private static final TransportVersion INDICES_REMOVED_TRANSPORT_VERSION = TransportVersions.V_8_500_069; private final String name; @Nullable diff --git a/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/search/SearchApplicationTests.java b/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/search/SearchApplicationTests.java index 147eeb617a143..60b88476285df 100644 --- a/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/search/SearchApplicationTests.java +++ b/x-pack/plugin/ent-search/src/test/java/org/elasticsearch/xpack/application/search/SearchApplicationTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.application.search; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; @@ -140,7 +140,7 @@ private SearchApplication assertIndexSerialization(SearchApplication testInstanc SearchApplicationIndexService.writeSearchApplicationBinaryWithVersion( testInstance, output, - TransportVersion.MINIMUM_COMPATIBLE + TransportVersions.MINIMUM_COMPATIBLE ); try ( StreamInput in = new NamedWriteableAwareStreamInput( diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchRequest.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchRequest.java index 96c381e7a04bb..5811d328ae7dd 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchRequest.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchRequest.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.eql.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.IndicesRequest; @@ -115,16 +115,16 @@ public EqlSearchRequest(StreamInput in) throws IOException { size = in.readVInt(); fetchSize = in.readVInt(); query = in.readString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_15_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_15_0)) { this.ccsMinimizeRoundtrips = in.readBoolean(); } this.waitForCompletionTimeout = in.readOptionalTimeValue(); this.keepAlive = in.readOptionalTimeValue(); this.keepOnCompletion = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_17_8)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_17_8)) { resultPosition = in.readString(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { if (in.readBoolean()) { fetchFields = in.readCollectionAsList(FieldAndFormat::new); } @@ -132,7 +132,7 @@ public EqlSearchRequest(StreamInput in) throws IOException { } else { runtimeMappings = emptyMap(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { maxSamplesPerKey = in.readInt(); } } @@ -451,23 +451,23 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVInt(size); out.writeVInt(fetchSize); out.writeString(query); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_15_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_15_0)) { out.writeBoolean(ccsMinimizeRoundtrips); } out.writeOptionalTimeValue(waitForCompletionTimeout); out.writeOptionalTimeValue(keepAlive); out.writeBoolean(keepOnCompletion); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_17_8)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_17_8)) { out.writeString(resultPosition); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { out.writeBoolean(fetchFields != null); if (fetchFields != null) { out.writeCollection(fetchFields); } out.writeGenericMap(runtimeMappings); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeInt(maxSamplesPerKey); } } diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchResponse.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchResponse.java index 606e645271840..0640347a7ea91 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchResponse.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchResponse.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.eql.action; import org.apache.lucene.search.TotalHits; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; @@ -276,12 +276,12 @@ private Event(StreamInput in) throws IOException { index = in.readString(); id = in.readString(); source = in.readBytesReference(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0) && in.readBoolean()) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0) && in.readBoolean()) { fetchFields = in.readMap(DocumentField::new); } else { fetchFields = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_038)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_038)) { missing = in.readBoolean(); } else { missing = index.isEmpty(); @@ -298,13 +298,13 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(index); out.writeString(id); out.writeBytesReference(source); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { out.writeBoolean(fetchFields != null); if (fetchFields != null) { out.writeMap(fetchFields, StreamOutput::writeWriteable); } } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_038)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_038)) { // for BWC, 8.9.1+ does not have "missing" attribute, but it considers events with an empty index "" as missing events // see https://github.com/elastic/elasticsearch/pull/98130 out.writeBoolean(missing); diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/AbstractBWCSerializationTestCase.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/AbstractBWCSerializationTestCase.java index 541b66446e209..ec910f147c014 100644 --- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/AbstractBWCSerializationTestCase.java +++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/AbstractBWCSerializationTestCase.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.eql; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.test.AbstractXContentSerializingTestCase; import org.elasticsearch.xcontent.ToXContent; @@ -21,7 +22,7 @@ public abstract class AbstractBWCSerializationTestCase extends AbstractXContentSerializingTestCase { private static List getAllBWCVersions() { - int minCompatVersion = Collections.binarySearch(ALL_VERSIONS, TransportVersion.MINIMUM_COMPATIBLE); + int minCompatVersion = Collections.binarySearch(ALL_VERSIONS, TransportVersions.MINIMUM_COMPATIBLE); return ALL_VERSIONS.subList(minCompatVersion, ALL_VERSIONS.size()); } diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/AbstractBWCWireSerializingTestCase.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/AbstractBWCWireSerializingTestCase.java index 887006e12206c..90d9e8467137a 100644 --- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/AbstractBWCWireSerializingTestCase.java +++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/AbstractBWCWireSerializingTestCase.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.eql; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.test.AbstractWireSerializingTestCase; @@ -20,7 +21,7 @@ public abstract class AbstractBWCWireSerializingTestCase extends AbstractWireSerializingTestCase { private static List getAllBWCVersions() { - int minCompatVersion = Collections.binarySearch(ALL_VERSIONS, TransportVersion.MINIMUM_COMPATIBLE); + int minCompatVersion = Collections.binarySearch(ALL_VERSIONS, TransportVersions.MINIMUM_COMPATIBLE); return ALL_VERSIONS.subList(minCompatVersion, ALL_VERSIONS.size()); } diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchRequestTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchRequestTests.java index f3ecfc99162a4..e5b0a0baa8505 100644 --- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchRequestTests.java +++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchRequestTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.eql.action; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; @@ -132,14 +133,14 @@ protected EqlSearchRequest mutateInstanceForVersion(EqlSearchRequest instance, T mutatedInstance.size(instance.size()); mutatedInstance.fetchSize(instance.fetchSize()); mutatedInstance.query(instance.query()); - mutatedInstance.ccsMinimizeRoundtrips(version.onOrAfter(TransportVersion.V_7_15_0) == false || instance.ccsMinimizeRoundtrips()); + mutatedInstance.ccsMinimizeRoundtrips(version.onOrAfter(TransportVersions.V_7_15_0) == false || instance.ccsMinimizeRoundtrips()); mutatedInstance.waitForCompletionTimeout(instance.waitForCompletionTimeout()); mutatedInstance.keepAlive(instance.keepAlive()); mutatedInstance.keepOnCompletion(instance.keepOnCompletion()); - mutatedInstance.fetchFields(version.onOrAfter(TransportVersion.V_7_13_0) ? instance.fetchFields() : null); - mutatedInstance.runtimeMappings(version.onOrAfter(TransportVersion.V_7_13_0) ? instance.runtimeMappings() : emptyMap()); - mutatedInstance.resultPosition(version.onOrAfter(TransportVersion.V_7_17_8) ? instance.resultPosition() : "tail"); - mutatedInstance.maxSamplesPerKey(version.onOrAfter(TransportVersion.V_8_7_0) ? instance.maxSamplesPerKey() : 1); + mutatedInstance.fetchFields(version.onOrAfter(TransportVersions.V_7_13_0) ? instance.fetchFields() : null); + mutatedInstance.runtimeMappings(version.onOrAfter(TransportVersions.V_7_13_0) ? instance.runtimeMappings() : emptyMap()); + mutatedInstance.resultPosition(version.onOrAfter(TransportVersions.V_7_17_8) ? instance.resultPosition() : "tail"); + mutatedInstance.maxSamplesPerKey(version.onOrAfter(TransportVersions.V_8_7_0) ? instance.maxSamplesPerKey() : 1); return mutatedInstance; } diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchResponseTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchResponseTests.java index 8848958dde885..765fd94d4c6be 100644 --- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchResponseTests.java +++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchResponseTests.java @@ -8,6 +8,7 @@ import org.apache.lucene.search.TotalHits; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.document.DocumentField; @@ -287,8 +288,8 @@ private List mutateEvents(List original, TransportVersion version) e.index(), e.id(), e.source(), - version.onOrAfter(TransportVersion.V_7_13_0) ? e.fetchFields() : null, - version.onOrAfter(TransportVersion.V_8_500_038) ? e.missing() : e.index().isEmpty() + version.onOrAfter(TransportVersions.V_7_13_0) ? e.fetchFields() : null, + version.onOrAfter(TransportVersions.V_8_500_038) ? e.missing() : e.index().isEmpty() ) ); } @@ -298,10 +299,10 @@ private List mutateEvents(List original, TransportVersion version) public void testEmptyIndexAsMissingEvent() throws IOException { Event event = new Event("", "", new BytesArray("{}".getBytes(StandardCharsets.UTF_8)), null); BytesStreamOutput out = new BytesStreamOutput(); - out.setTransportVersion(TransportVersion.V_8_500_020);// 8.9.1 + out.setTransportVersion(TransportVersions.V_8_500_020);// 8.9.1 event.writeTo(out); ByteArrayStreamInput in = new ByteArrayStreamInput(out.bytes().array()); - in.setTransportVersion(TransportVersion.V_8_500_020); + in.setTransportVersion(TransportVersions.V_8_500_020); Event event2 = Event.readFrom(in); assertTrue(event2.missing()); } diff --git a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/DeleteSamlServiceProviderRequestTests.java b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/DeleteSamlServiceProviderRequestTests.java index 7634dab750b8b..4beda3cc18792 100644 --- a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/DeleteSamlServiceProviderRequestTests.java +++ b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/DeleteSamlServiceProviderRequestTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.idp.action; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.test.TransportVersionUtils; @@ -28,7 +29,7 @@ public void testSerialization() throws IOException { ); final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_7_0, + TransportVersions.V_7_7_0, TransportVersion.current() ); final DeleteSamlServiceProviderRequest read = copyWriteable( diff --git a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderRequestTests.java b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderRequestTests.java index 50556a26f5260..60675b9355973 100644 --- a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderRequestTests.java +++ b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderRequestTests.java @@ -9,6 +9,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.WriteRequest.RefreshPolicy; import org.elasticsearch.common.Strings; @@ -86,7 +87,7 @@ public void testSerialization() throws IOException { final PutSamlServiceProviderRequest request = new PutSamlServiceProviderRequest(doc, RefreshPolicy.NONE); final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_7_0, + TransportVersions.V_7_7_0, TransportVersion.current() ); final PutSamlServiceProviderRequest read = copyWriteable( diff --git a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java index a4fedb3b5b8d0..233702d7ddd9a 100644 --- a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java +++ b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.idp.saml.sp; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; @@ -161,7 +162,7 @@ private SamlServiceProviderDocument assertXContentRoundTrip(SamlServiceProviderD private SamlServiceProviderDocument assertSerializationRoundTrip(SamlServiceProviderDocument doc) throws IOException { final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_7_0, + TransportVersions.V_7_7_0, TransportVersion.current() ); final SamlServiceProviderDocument read = copyWriteable( diff --git a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/support/SamlAuthenticationStateTests.java b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/support/SamlAuthenticationStateTests.java index 35dd53211bbbc..934126e7f0fa0 100644 --- a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/support/SamlAuthenticationStateTests.java +++ b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/support/SamlAuthenticationStateTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.idp.saml.support; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.xcontent.XContentHelper; @@ -89,7 +90,7 @@ private SamlAuthenticationState assertXContentRoundTrip(SamlAuthenticationState private SamlAuthenticationState assertSerializationRoundTrip(SamlAuthenticationState state) throws IOException { final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_7_0, + TransportVersions.V_7_7_0, TransportVersion.current() ); final SamlAuthenticationState read = copyWriteable( diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilder.java index 7efc0de20e091..8df56d9df9c2f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilder.java @@ -9,6 +9,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; @@ -50,7 +51,7 @@ public class CategorizeTextAggregationBuilder extends AbstractAggregationBuilder // some nodes are pre-8.3 and others are newer, so we throw an error in // this situation. The aggregation was experimental at the time this change // was made, so this is acceptable. - public static final TransportVersion ALGORITHM_CHANGED_VERSION = TransportVersion.V_8_3_0; + public static final TransportVersion ALGORITHM_CHANGED_VERSION = TransportVersions.V_8_3_0; static final ParseField FIELD_NAME = new ParseField("field"); static final ParseField SIMILARITY_THRESHOLD = new ParseField("similarity_threshold"); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/changepoint/ChangePointAggregationBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/changepoint/ChangePointAggregationBuilder.java index 3aa4c71ad41c9..1a82c5310332f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/changepoint/ChangePointAggregationBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/changepoint/ChangePointAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.ml.aggs.changepoint; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers; @@ -59,7 +60,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_2_0; + return TransportVersions.V_8_2_0; } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/BucketCorrelationAggregationBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/BucketCorrelationAggregationBuilder.java index 3503cc20d1e89..9db6849b86873 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/BucketCorrelationAggregationBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/BucketCorrelationAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.ml.aggs.correlation; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers; @@ -137,6 +138,6 @@ public int hashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_14_0; + return TransportVersions.V_7_14_0; } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/frequentitemsets/FrequentItemSetsAggregationBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/frequentitemsets/FrequentItemSetsAggregationBuilder.java index dad96e8ffabcf..9081f4118f89f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/frequentitemsets/FrequentItemSetsAggregationBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/frequentitemsets/FrequentItemSetsAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.ml.aggs.frequentitemsets; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -164,12 +165,12 @@ public FrequentItemSetsAggregationBuilder(StreamInput in) throws IOException { this.minimumSupport = in.readDouble(); this.minimumSetSize = in.readVInt(); this.size = in.readVInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { this.filter = in.readOptionalNamedWriteable(QueryBuilder.class); } else { this.filter = null; } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { this.executionHint = in.readOptionalString(); } else { this.executionHint = null; @@ -202,10 +203,10 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeDouble(minimumSupport); out.writeVInt(minimumSetSize); out.writeVInt(size); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { out.writeOptionalNamedWriteable(filter); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_7_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_7_0)) { out.writeOptionalString(executionHint); } } @@ -265,7 +266,7 @@ public FrequentItemSetsAggregationBuilder subAggregation(AggregationBuilder aggr @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_4_0; + return TransportVersions.V_8_4_0; } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/frequentitemsets/ImmutableTransactionStore.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/frequentitemsets/ImmutableTransactionStore.java index 878d646160320..f6d62b7b0f8dd 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/frequentitemsets/ImmutableTransactionStore.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/frequentitemsets/ImmutableTransactionStore.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.ml.aggs.frequentitemsets; import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.BigArrays; @@ -82,7 +82,7 @@ public ImmutableTransactionStore(StreamInput in, BigArrays bigArrays) throws IOE } this.totalTransactionCount = in.readVLong(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { this.filteredTransactionCount = in.readVLong(); } else { this.filteredTransactionCount = 0; @@ -158,7 +158,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(transactionCounts.get(i)); } out.writeVLong(totalTransactionCount); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_6_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_6_0)) { out.writeVLong(filteredTransactionCount); } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/inference/InferencePipelineAggregationBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/inference/InferencePipelineAggregationBuilder.java index 2e07267c43396..cac9d88256696 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/inference/InferencePipelineAggregationBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/inference/InferencePipelineAggregationBuilder.java @@ -9,6 +9,7 @@ import org.apache.lucene.util.SetOnce; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.client.internal.Client; import org.elasticsearch.common.Strings; @@ -380,6 +381,6 @@ public boolean equals(Object obj) { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_9_0; + return TransportVersions.V_7_9_0; } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/kstest/BucketCountKSTestAggregationBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/kstest/BucketCountKSTestAggregationBuilder.java index 147d7831af5dc..dd204840e6fae 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/kstest/BucketCountKSTestAggregationBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/kstest/BucketCountKSTestAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.ml.aggs.kstest; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; @@ -185,6 +186,6 @@ public int hashCode() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_14_0; + return TransportVersions.V_7_14_0; } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlScalingReason.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlScalingReason.java index df2490c83afde..bb124f11ad637 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlScalingReason.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlScalingReason.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.autoscaling; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; @@ -49,7 +49,7 @@ public MlScalingReason(StreamInput in) throws IOException { this.waitingAnalyticsJobs = in.readStringCollectionAsList(); this.waitingAnomalyJobs = in.readStringCollectionAsList(); this.waitingSnapshotUpgrades = in.readStringCollectionAsList(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { this.waitingModels = in.readStringCollectionAsList(); } else { this.waitingModels = List.of(); @@ -136,7 +136,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeStringCollection(this.waitingAnalyticsJobs); out.writeStringCollection(this.waitingAnomalyJobs); out.writeStringCollection(this.waitingSnapshotUpgrades); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_0_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) { out.writeStringCollection(this.waitingModels); } this.passedConfiguration.writeTo(out); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedConfigAutoUpdater.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedConfigAutoUpdater.java index 380b47a23e5bd..3df50cf7f62ed 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedConfigAutoUpdater.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedConfigAutoUpdater.java @@ -11,6 +11,7 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.cluster.ClusterState; @@ -42,7 +43,7 @@ public DatafeedConfigAutoUpdater(DatafeedConfigProvider provider, IndexNameExpre @Override public boolean isMinTransportVersionSupported(TransportVersion minNodeVersion) { - return minNodeVersion.onOrAfter(TransportVersion.V_8_0_0); + return minNodeVersion.onOrAfter(TransportVersions.V_8_0_0); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ModelAliasMetadata.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ModelAliasMetadata.java index fc44cf9715614..0847479489ec2 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ModelAliasMetadata.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ModelAliasMetadata.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.ml.inference; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; @@ -112,7 +113,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_13_0; + return TransportVersions.V_7_13_0; } @Override @@ -162,7 +163,7 @@ public void writeTo(StreamOutput out) throws IOException { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_13_0; + return TransportVersions.V_7_13_0; } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentClusterService.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentClusterService.java index 6602bc28184d6..efc8bd84c6350 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentClusterService.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentClusterService.java @@ -12,6 +12,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.cluster.ClusterChangedEvent; @@ -69,8 +70,8 @@ public class TrainedModelAssignmentClusterService implements ClusterStateListene private static final Logger logger = LogManager.getLogger(TrainedModelAssignmentClusterService.class); - private static final TransportVersion RENAME_ALLOCATION_TO_ASSIGNMENT_TRANSPORT_VERSION = TransportVersion.V_8_3_0; - public static final TransportVersion DISTRIBUTED_MODEL_ALLOCATION_TRANSPORT_VERSION = TransportVersion.V_8_4_0; + private static final TransportVersion RENAME_ALLOCATION_TO_ASSIGNMENT_TRANSPORT_VERSION = TransportVersions.V_8_3_0; + public static final TransportVersion DISTRIBUTED_MODEL_ALLOCATION_TRANSPORT_VERSION = TransportVersions.V_8_4_0; private final ClusterService clusterService; private final ThreadPool threadPool; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentMetadata.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentMetadata.java index 33ffc74445240..8391d287a6847 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentMetadata.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentMetadata.java @@ -10,6 +10,7 @@ import org.elasticsearch.ResourceAlreadyExistsException; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; @@ -155,7 +156,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } @Override @@ -319,7 +320,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_0_0; + return TransportVersions.V_8_0_0; } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/Vocabulary.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/Vocabulary.java index 6613f8e494cf5..680c68d9b9553 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/Vocabulary.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/Vocabulary.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.inference.nlp; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -64,12 +64,12 @@ public Vocabulary(List vocab, String modelId, @Nullable List mer public Vocabulary(StreamInput in) throws IOException { vocab = in.readStringCollectionAsList(); modelId = in.readString(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { merges = in.readStringCollectionAsList(); } else { merges = List.of(); } - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { scores = in.readCollectionAsList(StreamInput::readDouble); } else { scores = List.of(); @@ -92,10 +92,10 @@ public List scores() { public void writeTo(StreamOutput out) throws IOException { out.writeStringCollection(vocab); out.writeString(modelId); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_2_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_2_0)) { out.writeStringCollection(merges); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_010)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_010)) { out.writeCollection(scores, StreamOutput::writeDouble); } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/task/OpenJobPersistentTasksExecutor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/task/OpenJobPersistentTasksExecutor.java index 7a027e2c5cfa4..0fef2a34a3de3 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/task/OpenJobPersistentTasksExecutor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/task/OpenJobPersistentTasksExecutor.java @@ -13,6 +13,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.RetryableAction; import org.elasticsearch.client.internal.Client; @@ -83,7 +84,7 @@ public class OpenJobPersistentTasksExecutor extends AbstractJobPersistentTasksEx // Resuming a job with a running datafeed from its current snapshot was added in 7.11 and // can only be done if the master node is on or after that version. - private static final TransportVersion MIN_TRANSPORT_VERSION_FOR_REVERTING_TO_CURRENT_SNAPSHOT = TransportVersion.V_7_11_0; + private static final TransportVersion MIN_TRANSPORT_VERSION_FOR_REVERTING_TO_CURRENT_SNAPSHOT = TransportVersions.V_7_11_0; public static String[] indicesOfInterest(String resultsIndex) { if (resultsIndex == null) { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/queries/TextExpansionQueryBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/queries/TextExpansionQueryBuilder.java index b749bb74dfbd8..2d74b1b34888f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/queries/TextExpansionQueryBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/queries/TextExpansionQueryBuilder.java @@ -10,6 +10,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.util.SetOnce; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; @@ -89,7 +90,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_8_0; + return TransportVersions.V_8_8_0; } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/vectors/TextEmbeddingQueryVectorBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/vectors/TextEmbeddingQueryVectorBuilder.java index b5bfa4611ea4d..2dd76c8fab7cc 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/vectors/TextEmbeddingQueryVectorBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/vectors/TextEmbeddingQueryVectorBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.ml.vectors; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.client.internal.Client; import org.elasticsearch.common.io.stream.StreamInput; @@ -71,7 +72,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_7_0; + return TransportVersions.V_8_7_0; } @Override diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/heuristic/PValueScoreTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/heuristic/PValueScoreTests.java index f5291bd1b03ed..17898d7205b66 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/heuristic/PValueScoreTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/heuristic/PValueScoreTests.java @@ -9,6 +9,7 @@ import org.apache.commons.math3.util.FastMath; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.search.SearchModule; @@ -32,7 +33,7 @@ public class PValueScoreTests extends AbstractNXYSignificanceHeuristicTestCase { @Override protected TransportVersion randomVersion() { - return randomFrom(TransportVersion.V_8_0_0, TransportVersion.V_7_16_0); + return randomFrom(TransportVersions.V_8_0_0, TransportVersions.V_7_16_0); } @Override diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/utils/TransportVersionUtilsTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/utils/TransportVersionUtilsTests.java index 020ee64a0328a..abfb72cdbe5a4 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/utils/TransportVersionUtilsTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/utils/TransportVersionUtilsTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.ml.utils; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.block.ClusterBlocks; @@ -21,13 +22,13 @@ public class TransportVersionUtilsTests extends ESTestCase { private static final Map transportVersions = Map.of( "Alfredo", - TransportVersion.V_7_0_0, + TransportVersions.V_7_0_0, "Bertram", - TransportVersion.V_7_0_1, + TransportVersions.V_7_0_1, "Charles", - TransportVersion.V_8_500_010, + TransportVersions.V_8_500_010, "Dominic", - TransportVersion.V_8_0_0 + TransportVersions.V_8_0_0 ); private static final ClusterState state = new ClusterState( @@ -45,7 +46,7 @@ public class TransportVersionUtilsTests extends ESTestCase { ); public void testGetMinTransportVersion() { - assertThat(TransportVersionUtils.getMinTransportVersion(state), equalTo(TransportVersion.V_7_0_0)); + assertThat(TransportVersionUtils.getMinTransportVersion(state), equalTo(TransportVersions.V_7_0_0)); } public void testIsMinTransformVersionSameAsCurrent() { @@ -71,7 +72,7 @@ public void testIsMinTransformVersionSameAsCurrent() { } public void testIsMinTransportVersionOnOrAfter() { - assertThat(TransportVersionUtils.isMinTransportVersionOnOrAfter(state, TransportVersion.V_7_0_0), equalTo(true)); - assertThat(TransportVersionUtils.isMinTransportVersionOnOrAfter(state, TransportVersion.V_8_500_010), equalTo(false)); + assertThat(TransportVersionUtils.isMinTransportVersionOnOrAfter(state, TransportVersions.V_7_0_0), equalTo(true)); + assertThat(TransportVersionUtils.isMinTransportVersionOnOrAfter(state, TransportVersions.V_8_500_010), equalTo(false)); } } diff --git a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/execution/search/extractor/AbstractFieldHitExtractor.java b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/execution/search/extractor/AbstractFieldHitExtractor.java index f8f20d25df708..8dfe040a839bb 100644 --- a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/execution/search/extractor/AbstractFieldHitExtractor.java +++ b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/execution/search/extractor/AbstractFieldHitExtractor.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.ql.execution.search.extractor; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -74,7 +74,7 @@ protected AbstractFieldHitExtractor(StreamInput in) throws IOException { String typeName = in.readOptionalString(); dataType = typeName != null ? loadTypeFromName(typeName) : null; hitName = in.readOptionalString(); - if (in.getTransportVersion().before(TransportVersion.V_8_6_0)) { + if (in.getTransportVersion().before(TransportVersions.V_8_6_0)) { this.multiValueSupport = in.readBoolean() ? MultiValueSupport.LENIENT : MultiValueSupport.NONE; } else { this.multiValueSupport = in.readEnum(MultiValueSupport.class); @@ -93,7 +93,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(fieldName); out.writeOptionalString(dataType == null ? null : dataType.typeName()); out.writeOptionalString(hitName); - if (out.getTransportVersion().before(TransportVersion.V_8_6_0)) { + if (out.getTransportVersion().before(TransportVersions.V_8_6_0)) { out.writeBoolean(multiValueSupport != MultiValueSupport.NONE); } else { out.writeEnum(multiValueSupport); diff --git a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/index/VersionCompatibilityChecks.java b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/index/VersionCompatibilityChecks.java index 532c466e63a7f..e194f385d1606 100644 --- a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/index/VersionCompatibilityChecks.java +++ b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/index/VersionCompatibilityChecks.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.ql.index; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.ql.type.DataType; @@ -20,7 +21,7 @@ public final class VersionCompatibilityChecks { public static final Version INTRODUCING_UNSIGNED_LONG = V_8_2_0; - public static final TransportVersion INTRODUCING_UNSIGNED_LONG_TRANSPORT = TransportVersion.V_8_2_0; + public static final TransportVersion INTRODUCING_UNSIGNED_LONG_TRANSPORT = TransportVersions.V_8_2_0; public static final Version INTRODUCING_VERSION_FIELD_TYPE = V_8_4_0; private VersionCompatibilityChecks() {} diff --git a/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRankBuilder.java b/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRankBuilder.java index 90900644ea294..f0a8e299de632 100644 --- a/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRankBuilder.java +++ b/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRankBuilder.java @@ -9,6 +9,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.license.LicenseUtils; @@ -86,7 +87,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_8_0; + return TransportVersions.V_8_8_0; } public int rankConstant() { diff --git a/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRankShardResult.java b/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRankShardResult.java index 52f808fe8bb35..18a6e041d7873 100644 --- a/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRankShardResult.java +++ b/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRankShardResult.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.rank.rrf; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.rank.RankShardResult; @@ -48,7 +49,7 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_8_0; + return TransportVersions.V_8_8_0; } @Override diff --git a/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilder.java b/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilder.java index bf8c7443db9ad..6c6dc00b83155 100644 --- a/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilder.java +++ b/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilder.java @@ -14,6 +14,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.util.NumericUtils; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -219,7 +220,7 @@ private PinnedQueryBuilder(QueryBuilder organicQuery, List ids, List invalidateAccessToken( tokenService.prependVersionAndEncodeAccessToken( - TransportVersion.V_7_3_2, - tokenService.getRandomTokenBytes(TransportVersion.V_7_3_2, randomBoolean()).v1() + TransportVersions.V_7_3_2, + tokenService.getRandomTokenBytes(TransportVersions.V_7_3_2, randomBoolean()).v1() ) ) ); @@ -343,7 +344,7 @@ public void testInvalidateNotValidAccessTokens() throws Exception { byte[] longerAccessToken = new byte[randomIntBetween(17, 24)]; random().nextBytes(longerAccessToken); invalidateResponse = invalidateAccessToken( - tokenService.prependVersionAndEncodeAccessToken(TransportVersion.V_7_3_2, longerAccessToken) + tokenService.prependVersionAndEncodeAccessToken(TransportVersions.V_7_3_2, longerAccessToken) ); assertThat(invalidateResponse.invalidated(), equalTo(0)); assertThat(invalidateResponse.previouslyInvalidated(), equalTo(0)); @@ -361,7 +362,7 @@ public void testInvalidateNotValidAccessTokens() throws Exception { byte[] shorterAccessToken = new byte[randomIntBetween(12, 15)]; random().nextBytes(shorterAccessToken); invalidateResponse = invalidateAccessToken( - tokenService.prependVersionAndEncodeAccessToken(TransportVersion.V_7_3_2, shorterAccessToken) + tokenService.prependVersionAndEncodeAccessToken(TransportVersions.V_7_3_2, shorterAccessToken) ); assertThat(invalidateResponse.invalidated(), equalTo(0)); assertThat(invalidateResponse.previouslyInvalidated(), equalTo(0)); @@ -390,8 +391,8 @@ public void testInvalidateNotValidAccessTokens() throws Exception { invalidateResponse = invalidateAccessToken( tokenService.prependVersionAndEncodeAccessToken( - TransportVersion.V_7_3_2, - tokenService.getRandomTokenBytes(TransportVersion.V_7_3_2, randomBoolean()).v1() + TransportVersions.V_7_3_2, + tokenService.getRandomTokenBytes(TransportVersions.V_7_3_2, randomBoolean()).v1() ) ); assertThat(invalidateResponse.invalidated(), equalTo(0)); @@ -416,8 +417,8 @@ public void testInvalidateNotValidRefreshTokens() throws Exception { ResponseException.class, () -> invalidateRefreshToken( TokenService.prependVersionAndEncodeRefreshToken( - TransportVersion.V_7_3_2, - tokenService.getRandomTokenBytes(TransportVersion.V_7_3_2, true).v2() + TransportVersions.V_7_3_2, + tokenService.getRandomTokenBytes(TransportVersions.V_7_3_2, true).v2() ) ) ); @@ -437,7 +438,7 @@ public void testInvalidateNotValidRefreshTokens() throws Exception { byte[] longerRefreshToken = new byte[randomIntBetween(17, 24)]; random().nextBytes(longerRefreshToken); invalidateResponse = invalidateRefreshToken( - TokenService.prependVersionAndEncodeRefreshToken(TransportVersion.V_7_3_2, longerRefreshToken) + TokenService.prependVersionAndEncodeRefreshToken(TransportVersions.V_7_3_2, longerRefreshToken) ); assertThat(invalidateResponse.invalidated(), equalTo(0)); assertThat(invalidateResponse.previouslyInvalidated(), equalTo(0)); @@ -455,7 +456,7 @@ public void testInvalidateNotValidRefreshTokens() throws Exception { byte[] shorterRefreshToken = new byte[randomIntBetween(12, 15)]; random().nextBytes(shorterRefreshToken); invalidateResponse = invalidateRefreshToken( - TokenService.prependVersionAndEncodeRefreshToken(TransportVersion.V_7_3_2, shorterRefreshToken) + TokenService.prependVersionAndEncodeRefreshToken(TransportVersions.V_7_3_2, shorterRefreshToken) ); assertThat(invalidateResponse.invalidated(), equalTo(0)); assertThat(invalidateResponse.previouslyInvalidated(), equalTo(0)); @@ -484,8 +485,8 @@ public void testInvalidateNotValidRefreshTokens() throws Exception { invalidateResponse = invalidateRefreshToken( TokenService.prependVersionAndEncodeRefreshToken( - TransportVersion.V_7_3_2, - tokenService.getRandomTokenBytes(TransportVersion.V_7_3_2, true).v2() + TransportVersions.V_7_3_2, + tokenService.getRandomTokenBytes(TransportVersions.V_7_3_2, true).v2() ) ); assertThat(invalidateResponse.invalidated(), equalTo(0)); @@ -755,15 +756,15 @@ public void testAuthenticateWithWrongToken() throws Exception { // Now attempt to authenticate with an invalid access token with valid structure (pre 7.2) assertUnauthorizedToken( tokenService.prependVersionAndEncodeAccessToken( - TransportVersion.V_7_1_0, - tokenService.getRandomTokenBytes(TransportVersion.V_7_1_0, randomBoolean()).v1() + TransportVersions.V_7_1_0, + tokenService.getRandomTokenBytes(TransportVersions.V_7_1_0, randomBoolean()).v1() ) ); // Now attempt to authenticate with an invalid access token with valid structure (after 7.2 pre 8.10) assertUnauthorizedToken( tokenService.prependVersionAndEncodeAccessToken( - TransportVersion.V_7_4_0, - tokenService.getRandomTokenBytes(TransportVersion.V_7_4_0, randomBoolean()).v1() + TransportVersions.V_7_4_0, + tokenService.getRandomTokenBytes(TransportVersions.V_7_4_0, randomBoolean()).v1() ) ); // Now attempt to authenticate with an invalid access token with valid structure (current version) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/TokenService.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/TokenService.java index 25c4285c3dc43..e543248b8ad1d 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/TokenService.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/TokenService.java @@ -16,6 +16,7 @@ import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.DocWriteRequest.OpType; import org.elasticsearch.action.DocWriteResponse; @@ -202,12 +203,12 @@ public final class TokenService { static final int MINIMUM_BYTES = VERSION_BYTES + TOKEN_LENGTH + 1; static final int LEGACY_MINIMUM_BASE64_BYTES = Double.valueOf(Math.ceil((4 * LEGACY_MINIMUM_BYTES) / 3)).intValue(); public static final int MINIMUM_BASE64_BYTES = Double.valueOf(Math.ceil((4 * MINIMUM_BYTES) / 3)).intValue(); - static final TransportVersion VERSION_HASHED_TOKENS = TransportVersion.V_7_2_0; - static final TransportVersion VERSION_TOKENS_INDEX_INTRODUCED = TransportVersion.V_7_2_0; - static final TransportVersion VERSION_ACCESS_TOKENS_AS_UUIDS = TransportVersion.V_7_2_0; - static final TransportVersion VERSION_MULTIPLE_CONCURRENT_REFRESHES = TransportVersion.V_7_2_0; - static final TransportVersion VERSION_CLIENT_AUTH_FOR_REFRESH = TransportVersion.V_8_2_0; - static final TransportVersion VERSION_GET_TOKEN_DOC_FOR_REFRESH = TransportVersion.V_8_500_040; + static final TransportVersion VERSION_HASHED_TOKENS = TransportVersions.V_7_2_0; + static final TransportVersion VERSION_TOKENS_INDEX_INTRODUCED = TransportVersions.V_7_2_0; + static final TransportVersion VERSION_ACCESS_TOKENS_AS_UUIDS = TransportVersions.V_7_2_0; + static final TransportVersion VERSION_MULTIPLE_CONCURRENT_REFRESHES = TransportVersions.V_7_2_0; + static final TransportVersion VERSION_CLIENT_AUTH_FOR_REFRESH = TransportVersions.V_8_2_0; + static final TransportVersion VERSION_GET_TOKEN_DOC_FOR_REFRESH = TransportVersions.V_8_500_040; private static final Logger logger = LogManager.getLogger(TokenService.class); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/SecurityContextTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/SecurityContextTests.java index 3abb40d23cf8a..07c858f10f447 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/SecurityContextTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/SecurityContextTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.security; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; @@ -190,7 +191,7 @@ public void testExecuteAfterRewritingAuthenticationWillConditionallyRewriteNewAp final Authentication original = AuthenticationTestHelper.builder() .apiKey() .metadata(metadata) - .transportVersion(TransportVersion.V_8_0_0) + .transportVersion(TransportVersions.V_8_0_0) .build(); original.writeToContext(threadContext); @@ -205,7 +206,7 @@ public void testExecuteAfterRewritingAuthenticationWillConditionallyRewriteNewAp Map.of("limitedBy role", Map.of("cluster", List.of("all"))), authentication.getAuthenticatingSubject().getMetadata().get(AuthenticationField.API_KEY_LIMITED_ROLE_DESCRIPTORS_KEY) ); - }, TransportVersion.V_7_8_0); + }, TransportVersions.V_7_8_0); // If target is new node, no need to rewrite the new style API key metadata securityContext.executeAfterRewritingAuthentication(originalCtx -> { @@ -215,7 +216,7 @@ public void testExecuteAfterRewritingAuthenticationWillConditionallyRewriteNewAp } public void testExecuteAfterRewritingAuthenticationWillConditionallyRewriteOldApiKeyMetadata() throws IOException { - final Authentication original = AuthenticationTestHelper.builder().apiKey().transportVersion(TransportVersion.V_7_8_0).build(); + final Authentication original = AuthenticationTestHelper.builder().apiKey().transportVersion(TransportVersions.V_7_8_0).build(); // original authentication has the old style of role descriptor maps assertThat( @@ -233,7 +234,7 @@ public void testExecuteAfterRewritingAuthenticationWillConditionallyRewriteOldAp securityContext.executeAfterRewritingAuthentication(originalCtx -> { Authentication authentication = securityContext.getAuthentication(); assertSame(original.getAuthenticatingSubject().getMetadata(), authentication.getAuthenticatingSubject().getMetadata()); - }, TransportVersion.V_7_8_0); + }, TransportVersions.V_7_8_0); // If target is new node, ensure old map style API key metadata is rewritten to bytesreference securityContext.executeAfterRewritingAuthentication(originalCtx -> { diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java index ac80c7b5bbb64..117d1f1fe14bb 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java @@ -13,6 +13,7 @@ import org.apache.lucene.search.TotalHits; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.DocWriteRequest; @@ -2341,7 +2342,7 @@ public void testMaybeRemoveRemoteIndicesPrivilegesWithUnsupportedVersion() { // Selecting random unsupported version. final TransportVersion minTransportVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, TransportVersionUtils.getPreviousVersion(TRANSPORT_VERSION_ADVANCED_REMOTE_CLUSTER_SECURITY) ); @@ -2431,7 +2432,7 @@ public void testCreateCrossClusterApiKeyMinVersionConstraint() { when(clusterService.state()).thenReturn(clusterState); final TransportVersion minTransportVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, TransportVersionUtils.getPreviousVersion(TRANSPORT_VERSION_ADVANCED_REMOTE_CLUSTER_SECURITY) ); when(clusterState.getMinTransportVersion()).thenReturn(minTransportVersion); @@ -2566,7 +2567,7 @@ public void testCreateOrUpdateApiKeyWithWorkflowsRestrictionForUnsupportedVersio when(clusterService.state()).thenReturn(clusterState); final TransportVersion minTransportVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, TransportVersionUtils.getPreviousVersion(WORKFLOWS_RESTRICTION_VERSION) ); when(clusterState.getMinTransportVersion()).thenReturn(minTransportVersion); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/CrossClusterAccessAuthenticationServiceTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/CrossClusterAccessAuthenticationServiceTests.java index ed111f595483d..0b2243a77f21e 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/CrossClusterAccessAuthenticationServiceTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/CrossClusterAccessAuthenticationServiceTests.java @@ -9,6 +9,7 @@ import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.cluster.service.ClusterService; @@ -69,7 +70,7 @@ public void testAuthenticateThrowsOnUnsupportedMinVersions() throws IOException clusterService = mockClusterServiceWithMinTransportVersion( TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, TransportVersionUtils.getPreviousVersion(TRANSPORT_VERSION_ADVANCED_REMOTE_CLUSTER_SECURITY) ) ); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenServiceTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenServiceTests.java index 01e9c7587f8db..dfd841c75edd2 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenServiceTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenServiceTests.java @@ -9,6 +9,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.DocWriteRequest; @@ -240,10 +241,10 @@ private static DiscoveryNode addAnother7071DataNode(ClusterService clusterServic TransportVersion transportVersion; if (randomBoolean()) { version = Version.V_7_0_0; - transportVersion = TransportVersion.V_7_0_0; + transportVersion = TransportVersions.V_7_0_0; } else { version = Version.V_7_1_0; - transportVersion = TransportVersion.V_7_1_0; + transportVersion = TransportVersions.V_7_1_0; } return addAnotherDataNodeWithVersion(clusterService, version, transportVersion); } @@ -253,10 +254,10 @@ private static DiscoveryNode addAnotherPre8500DataNode(ClusterService clusterSer TransportVersion transportVersion; if (randomBoolean()) { version = Version.V_8_8_1; - transportVersion = TransportVersion.V_8_8_1; + transportVersion = TransportVersions.V_8_8_1; } else { version = Version.V_8_9_0; - transportVersion = TransportVersion.V_8_500_015; + transportVersion = TransportVersions.V_8_500_015; } return addAnotherDataNodeWithVersion(clusterService, version, transportVersion); } @@ -824,8 +825,8 @@ public void testNonExistingPre72Token() throws Exception { storeTokenHeader( requestContext, tokenService.prependVersionAndEncodeAccessToken( - TransportVersion.V_7_1_0, - tokenService.getRandomTokenBytes(TransportVersion.V_7_1_0, randomBoolean()).v1() + TransportVersions.V_7_1_0, + tokenService.getRandomTokenBytes(TransportVersions.V_7_1_0, randomBoolean()).v1() ) ); @@ -846,7 +847,7 @@ public void testNonExistingUUIDToken() throws Exception { .build(false); mockGetTokenFromAccessTokenBytes(tokenService, tokenService.getRandomTokenBytes(randomBoolean()).v1(), authentication, false, null); ThreadContext requestContext = new ThreadContext(Settings.EMPTY); - TransportVersion uuidTokenVersion = randomFrom(TransportVersion.V_7_2_0, TransportVersion.V_7_3_2); + TransportVersion uuidTokenVersion = randomFrom(TransportVersions.V_7_2_0, TransportVersions.V_7_3_2); storeTokenHeader( requestContext, tokenService.prependVersionAndEncodeAccessToken( diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/mapper/ExpressionRoleMappingTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/mapper/ExpressionRoleMappingTests.java index 56bb40e65f5a1..55248e5e0a227 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/mapper/ExpressionRoleMappingTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/mapper/ExpressionRoleMappingTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.security.authc.support.mapper; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; @@ -407,7 +408,7 @@ public void testToXContentWithTemplates() throws Exception { public void testSerialization() throws Exception { final ExpressionRoleMapping original = randomRoleMapping(true); - TransportVersion version = TransportVersionUtils.randomVersionBetween(random(), TransportVersion.V_7_2_0, null); + TransportVersion version = TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_7_2_0, null); BytesStreamOutput output = new BytesStreamOutput(); output.setTransportVersion(version); original.writeTo(output); @@ -425,7 +426,7 @@ public void testSerialization() throws Exception { public void testSerializationPreV71() throws Exception { final ExpressionRoleMapping original = randomRoleMapping(false); - TransportVersion version = TransportVersionUtils.randomVersionBetween(random(), TransportVersion.V_7_0_0, TransportVersion.V_7_0_1); + TransportVersion version = TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_7_0_0, TransportVersions.V_7_0_1); BytesStreamOutput output = new BytesStreamOutput(); output.setTransportVersion(version); original.writeTo(output); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStoreTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStoreTests.java index dd716b79e1db3..f30fb242abc13 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStoreTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStoreTests.java @@ -11,6 +11,7 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsAction; import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsAction; @@ -1884,7 +1885,7 @@ public void testApiKeyAuthUsesApiKeyService() throws Exception { AuditUtil.getOrGenerateRequestId(threadContext); final TransportVersion version = randomFrom( TransportVersion.current(), - TransportVersionUtils.randomVersionBetween(random(), TransportVersion.V_7_0_0, TransportVersion.V_7_8_1) + TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_7_0_0, TransportVersions.V_7_8_1) ); final Authentication authentication = createApiKeyAuthentication( apiKeyService, @@ -1967,7 +1968,7 @@ public void testApiKeyAuthUsesApiKeyServiceWithScopedRole() throws Exception { AuditUtil.getOrGenerateRequestId(threadContext); final TransportVersion version = randomFrom( TransportVersion.current(), - TransportVersionUtils.randomVersionBetween(random(), TransportVersion.V_7_0_0, TransportVersion.V_7_8_1) + TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_7_0_0, TransportVersions.V_7_8_1) ); final Authentication authentication = createApiKeyAuthentication( apiKeyService, diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStoreTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStoreTests.java index 4a35cc675850d..49d5a67b7d20e 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStoreTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStoreTests.java @@ -10,6 +10,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.client.internal.Client; @@ -389,7 +390,7 @@ public void testPutRoleWithRemoteIndicesUnsupportedMinNodeVersion() { ); final TransportVersion minTransportVersion = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.MINIMUM_COMPATIBLE, + TransportVersions.MINIMUM_COMPATIBLE, transportVersionBeforeAdvancedRemoteClusterSecurity ); final ClusterService clusterService = mockClusterServiceWithMinNodeVersion(minTransportVersion); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/SecurityServerTransportInterceptorTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/SecurityServerTransportInterceptorTests.java index 69944f6f3255e..9bd5d416940d3 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/SecurityServerTransportInterceptorTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/SecurityServerTransportInterceptorTests.java @@ -8,6 +8,7 @@ import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.cluster.state.ClusterStateAction; import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest; @@ -985,7 +986,7 @@ public void sendRequest( ); final TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), - TransportVersion.V_7_17_0, + TransportVersions.V_7_17_0, versionBeforeCrossClusterAccessRealm ); when(connection.getTransportVersion()).thenReturn(version); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/SimpleSecurityNetty4ServerTransportTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/SimpleSecurityNetty4ServerTransportTests.java index 2cfeb154693b3..ce3260a7875a1 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/SimpleSecurityNetty4ServerTransportTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/SimpleSecurityNetty4ServerTransportTests.java @@ -14,6 +14,7 @@ import org.apache.lucene.util.Constants; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.cluster.node.DiscoveryNode; @@ -1069,7 +1070,7 @@ public void executeHandshake( super.executeHandshake(node, channel, profile, listener); } else { assert getVersion().equals(TransportVersion.current()); - listener.onResponse(TransportVersion.MINIMUM_COMPATIBLE); + listener.onResponse(TransportVersions.MINIMUM_COMPATIBLE); } } diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/BlobAnalyzeAction.java b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/BlobAnalyzeAction.java index db349ff5944c5..e5ebe47d177ff 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/BlobAnalyzeAction.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/BlobAnalyzeAction.java @@ -9,7 +9,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListenerResponseHandler; import org.elasticsearch.action.ActionRequest; @@ -699,7 +699,7 @@ public static class Request extends ActionRequest { earlyReadNodeCount = in.readVInt(); readEarly = in.readBoolean(); writeAndOverwrite = in.readBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_14_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_14_0)) { abortWrite = in.readBoolean(); } else { abortWrite = false; @@ -719,7 +719,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVInt(earlyReadNodeCount); out.writeBoolean(readEarly); out.writeBoolean(writeAndOverwrite); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_14_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_14_0)) { out.writeBoolean(abortWrite); } else if (abortWrite) { throw new IllegalStateException("cannot send abortWrite request on transport version [" + out.getTransportVersion() + "]"); diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RegisterAnalyzeAction.java b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RegisterAnalyzeAction.java index 81a21836bb325..b12f23c4b9afa 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RegisterAnalyzeAction.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RegisterAnalyzeAction.java @@ -9,7 +9,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; @@ -192,7 +192,7 @@ public Request(String repositoryName, String containerPath, String registerName, public Request(StreamInput in) throws IOException { super(in); - assert in.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0); + assert in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0); repositoryName = in.readString(); containerPath = in.readString(); registerName = in.readString(); @@ -202,7 +202,7 @@ public Request(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { - assert out.getTransportVersion().onOrAfter(TransportVersion.V_8_8_0); + assert out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0); super.writeTo(out); out.writeString(repositoryName); out.writeString(containerPath); diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalyzeAction.java b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalyzeAction.java index 9d3dd7ee7c3e1..88ee149919874 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalyzeAction.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalyzeAction.java @@ -10,7 +10,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.ExceptionsHelper; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListenerResponseHandler; @@ -802,7 +802,7 @@ public Request(StreamInput in) throws IOException { maxTotalDataSize = ByteSizeValue.readFrom(in); detailed = in.readBoolean(); reroutedFrom = in.readOptionalWriteable(DiscoveryNode::new); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_14_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_14_0)) { abortWritePermitted = in.readBoolean(); } else { abortWritePermitted = false; @@ -829,7 +829,7 @@ public void writeTo(StreamOutput out) throws IOException { maxTotalDataSize.writeTo(out); out.writeBoolean(detailed); out.writeOptionalWriteable(reroutedFrom); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_14_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_14_0)) { out.writeBoolean(abortWritePermitted); } else if (abortWritePermitted) { throw new IllegalStateException( diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/GeoGridQueryBuilder.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/GeoGridQueryBuilder.java index 7fb42dd024b14..843842cf863c7 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/GeoGridQueryBuilder.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/GeoGridQueryBuilder.java @@ -13,6 +13,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.io.stream.StreamInput; @@ -398,6 +399,6 @@ public String getWriteableName() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_3_0; + return TransportVersions.V_8_3_0; } } diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilder.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilder.java index 53b59d17e284f..c786b47e2a9a1 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilder.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilder.java @@ -9,6 +9,7 @@ import org.apache.lucene.search.ConstantScoreQuery; import org.apache.lucene.search.Query; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.geo.GeometryParser; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -175,6 +176,6 @@ public static ShapeQueryBuilder fromXContent(XContentParser parser) throws IOExc @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_4_0; + return TransportVersions.V_7_4_0; } } diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/GeoLineAggregationBuilder.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/GeoLineAggregationBuilder.java index 114c67b82e73f..e232ec9e463d9 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/GeoLineAggregationBuilder.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/GeoLineAggregationBuilder.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.spatial.search.aggregations; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.cluster.metadata.DataStream; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -211,6 +212,6 @@ public String getType() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_7_11_0; + return TransportVersions.V_7_11_0; } } diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/InternalGeoLine.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/InternalGeoLine.java index e8a210549d0b7..0de11109e33e7 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/InternalGeoLine.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/InternalGeoLine.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.spatial.search.aggregations; import org.apache.lucene.geo.GeoEncodingUtils; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationReduceContext; @@ -88,7 +88,7 @@ public InternalGeoLine(StreamInput in) throws IOException { this.includeSorts = in.readBoolean(); this.sortOrder = SortOrder.readFromStream(in); this.size = in.readVInt(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_8_500_020)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_500_020)) { nonOverlapping = in.readBoolean(); simplified = in.readBoolean(); } else { @@ -105,7 +105,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeBoolean(includeSorts); sortOrder.writeTo(out); out.writeVInt(size); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_500_020)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_500_020)) { out.writeBoolean(nonOverlapping); out.writeBoolean(simplified); } diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/bucket/geogrid/GeoHexGridAggregationBuilder.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/bucket/geogrid/GeoHexGridAggregationBuilder.java index ad5a4371114f3..b3aa1f5e440d8 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/bucket/geogrid/GeoHexGridAggregationBuilder.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/bucket/geogrid/GeoHexGridAggregationBuilder.java @@ -9,6 +9,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.geo.GeoBoundingBox; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.xcontent.support.XContentMapValues; @@ -124,6 +125,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_1_0; + return TransportVersions.V_8_1_0; } } diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/metrics/CartesianBoundsAggregationBuilder.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/metrics/CartesianBoundsAggregationBuilder.java index 5d2e63b8986c6..a7385b30ea165 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/metrics/CartesianBoundsAggregationBuilder.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/metrics/CartesianBoundsAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.spatial.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -105,6 +106,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_6_0; + return TransportVersions.V_8_6_0; } } diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/metrics/CartesianCentroidAggregationBuilder.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/metrics/CartesianCentroidAggregationBuilder.java index 80191803ff172..dbd8c41af671b 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/metrics/CartesianCentroidAggregationBuilder.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/metrics/CartesianCentroidAggregationBuilder.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.spatial.search.aggregations.metrics; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -112,6 +113,6 @@ protected ValuesSourceRegistry.RegistryKey getRegistryKey() { @Override public TransportVersion getMinimalSupportedVersion() { - return TransportVersion.V_8_6_0; + return TransportVersions.V_8_6_0; } } diff --git a/x-pack/plugin/sql/qa/mixed-node/src/javaRestTest/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java b/x-pack/plugin/sql/qa/mixed-node/src/javaRestTest/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java index 1ca89f87d7345..5bc7e0dd219ca 100644 --- a/x-pack/plugin/sql/qa/mixed-node/src/javaRestTest/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java +++ b/x-pack/plugin/sql/qa/mixed-node/src/javaRestTest/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java @@ -9,6 +9,7 @@ import org.apache.http.HttpHost; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; @@ -129,7 +130,7 @@ public static String sqlQueryEntityWithOptionalMode(Map fields) } public void testHistoricCursorFromOldNodeFailsOnNewNode() throws IOException { - assumeTrue("BwC checks only enabled for <=8.7.0", bwcVersion.before(TransportVersion.V_8_8_0)); + assumeTrue("BwC checks only enabled for <=8.7.0", bwcVersion.before(TransportVersions.V_8_8_0)); assertCursorNotCompatibleAcrossVersions(bwcVersion, oldNodesClient, TransportVersion.current(), newNodesClient); } diff --git a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlQueryRequest.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlQueryRequest.java index 5c2cdb62c241d..e4023a89d31ac 100644 --- a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlQueryRequest.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlQueryRequest.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.sql.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.CompositeIndicesRequest; import org.elasticsearch.common.Strings; @@ -429,14 +429,14 @@ public AbstractSqlQueryRequest(StreamInput in) throws IOException { query = in.readString(); params = in.readCollectionAsList(AbstractSqlQueryRequest::readSqlTypedParamValue); zoneId = in.readZoneId(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { catalog = in.readOptionalString(); } fetchSize = in.readVInt(); requestTimeout = in.readTimeValue(); pageTimeout = in.readTimeValue(); filter = in.readOptionalNamedWriteable(QueryBuilder.class); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { runtimeMappings = in.readMap(); } } @@ -457,14 +457,14 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(query); out.writeCollection(params, AbstractSqlQueryRequest::writeSqlTypedParamValue); out.writeZoneId(zoneId); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_16_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_16_0)) { out.writeOptionalString(catalog); } out.writeVInt(fetchSize); out.writeTimeValue(requestTimeout); out.writeTimeValue(pageTimeout); out.writeOptionalNamedWriteable(filter); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_13_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_13_0)) { out.writeGenericMap(runtimeMappings); } } diff --git a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequest.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequest.java index 5369be6f2c0f5..f24d1ba800987 100644 --- a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequest.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequest.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.sql.action; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -160,12 +160,12 @@ public SqlQueryRequest(StreamInput in) throws IOException { fieldMultiValueLeniency = in.readBoolean(); indexIncludeFrozen = in.readBoolean(); binaryCommunication = in.readOptionalBoolean(); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_14_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_14_0)) { this.waitForCompletionTimeout = in.readOptionalTimeValue(); this.keepOnCompletion = in.readBoolean(); this.keepAlive = in.readOptionalTimeValue(); } - allowPartialSearchResults = in.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0) && in.readBoolean(); + allowPartialSearchResults = in.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0) && in.readBoolean(); } /** @@ -294,12 +294,12 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(fieldMultiValueLeniency); out.writeBoolean(indexIncludeFrozen); out.writeOptionalBoolean(binaryCommunication); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_7_14_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_14_0)) { out.writeOptionalTimeValue(waitForCompletionTimeout); out.writeBoolean(keepOnCompletion); out.writeOptionalTimeValue(keepAlive); } - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { out.writeBoolean(allowPartialSearchResults); } } diff --git a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java index 9ea0e4b0e889a..637b554847dfc 100644 --- a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.core.JsonGenerator; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -83,7 +83,7 @@ public SqlQueryResponse(StreamInput in) throws IOException { } } this.rows = unmodifiableList(rows); - if (in.getTransportVersion().onOrAfter(TransportVersion.V_7_14_0)) { + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_14_0)) { columnar = in.readBoolean(); asyncExecutionId = in.readOptionalString(); isPartial = in.readBoolean(); diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/common/io/SqlStreamInput.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/common/io/SqlStreamInput.java index 2eae1dab13135..456067fba6b04 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/common/io/SqlStreamInput.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/common/io/SqlStreamInput.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.sql.common.io; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.compress.CompressorFactory; import org.elasticsearch.common.io.stream.InputStreamStreamInput; import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; @@ -43,7 +44,7 @@ public static SqlStreamInput fromString(String base64encoded, NamedWriteableRegi * using TransportVersion. */ private static void validateStreamVersion(TransportVersion version, TransportVersion cursorVersion) { - if (cursorVersion.before(TransportVersion.V_8_8_0) && version.equals(cursorVersion) == false) { + if (cursorVersion.before(TransportVersions.V_8_8_0) && version.equals(cursorVersion) == false) { throw new SqlIllegalArgumentException("Unsupported cursor version [{}], expected [{}]", cursorVersion, version); } } diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/SearchHitCursor.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/SearchHitCursor.java index 86b5668ca5656..36a42aaad7161 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/SearchHitCursor.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/SearchHitCursor.java @@ -8,7 +8,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; @@ -69,7 +69,7 @@ public SearchHitCursor(StreamInput in) throws IOException { extractors = in.readNamedWriteableCollectionAsList(HitExtractor.class); mask = BitSet.valueOf(in.readByteArray()); includeFrozen = in.readBoolean(); - allowPartialSearchResults = in.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0) && in.readBoolean(); + allowPartialSearchResults = in.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0) && in.readBoolean(); } @Override @@ -80,7 +80,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeNamedWriteableCollection(extractors); out.writeByteArray(mask.toByteArray()); out.writeBoolean(includeFrozen); - if (out.getTransportVersion().onOrAfter(TransportVersion.V_8_3_0)) { + if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_3_0)) { out.writeBoolean(allowPartialSearchResults); } } diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/common/io/SqlStreamTests.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/common/io/SqlStreamTests.java index b46897e97804f..b5f23f6ab7abb 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/common/io/SqlStreamTests.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/common/io/SqlStreamTests.java @@ -9,6 +9,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.common.io.stream.InputStreamStreamInput; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.test.ESTestCase; @@ -68,7 +69,7 @@ public void testOldCursorProducesVersionMismatchError() { } public void testVersionCanBeReadByOldNodes() throws IOException { - TransportVersion version = randomFrom(TransportVersion.V_7_0_0, TransportVersion.V_7_2_1, TransportVersion.V_8_1_0); + TransportVersion version = randomFrom(TransportVersions.V_7_0_0, TransportVersions.V_7_2_1, TransportVersions.V_8_1_0); SqlStreamOutput out = SqlStreamOutput.create(version, randomZone()); out.writeString("payload"); out.close(); diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/CursorTests.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/CursorTests.java index 04149801266d0..726b40616e2d4 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/CursorTests.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/CursorTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.sql.plugin; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.client.internal.Client; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; @@ -56,7 +57,7 @@ public void testHistoricVersionHandling() { TransportVersion otherVersion = TransportVersionUtils.randomVersionBetween( random(), TransportVersionUtils.getFirstVersion(), - TransportVersion.V_8_7_0 + TransportVersions.V_8_7_0 ); String encodedWithWrongVersion = encodeToString(cursor, otherVersion, randomZone()); @@ -126,7 +127,7 @@ public void testAttachingFormatterToCursorFromOtherVersion() { TransportVersion version = TransportVersionUtils.randomVersionBetween( random(), TransportVersionUtils.getFirstVersion(), - TransportVersion.V_8_7_0 + TransportVersions.V_8_7_0 ); String encoded = encodeToString(cursor, version, zone); diff --git a/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/checkpoint/TransformGetCheckpointTests.java b/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/checkpoint/TransformGetCheckpointTests.java index f3935ed75ecd6..169ae7b04787f 100644 --- a/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/checkpoint/TransformGetCheckpointTests.java +++ b/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/checkpoint/TransformGetCheckpointTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.transform.checkpoint; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.LatchedActionListener; @@ -125,7 +125,7 @@ protected void onSendRequest(long requestId, String action, TransportRequest req testIndices = testIndicesList.toArray(new String[0]); clusterStateWithIndex = ClusterState.builder(ClusterStateCreationUtils.state(numberOfNodes, testIndices, numberOfShards)) - .putTransportVersion("node01", TransportVersion.V_8_5_0) + .putTransportVersion("node01", TransportVersions.V_8_5_0) .build(); transformTask = new Task( diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportGetCheckpointAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportGetCheckpointAction.java index 9a3aa82c499d9..23bc6406736fe 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportGetCheckpointAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportGetCheckpointAction.java @@ -8,7 +8,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListenerResponseHandler; import org.elasticsearch.action.NoShardAvailableActionException; @@ -106,7 +106,7 @@ private Map> resolveIndicesToPrimaryShards(ClusterState sta } if (shard.assignedToNode() && nodes.get(shard.currentNodeId()) != null) { // special case: The minimum TransportVersion in the cluster is on an old version - if (state.getMinTransportVersion().before(TransportVersion.V_8_2_0)) { + if (state.getMinTransportVersion().before(TransportVersions.V_8_2_0)) { throw new ActionNotFoundTransportException(GetCheckpointNodeAction.NAME); } diff --git a/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TransportVersionClusterStateUpgradeIT.java b/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TransportVersionClusterStateUpgradeIT.java index 727b5ac1b478f..53c8564695add 100644 --- a/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TransportVersionClusterStateUpgradeIT.java +++ b/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TransportVersionClusterStateUpgradeIT.java @@ -8,6 +8,7 @@ package org.elasticsearch.upgrades; import org.elasticsearch.TransportVersion; +import org.elasticsearch.TransportVersions; import org.elasticsearch.Version; import org.elasticsearch.client.Request; import org.elasticsearch.common.util.Maps; @@ -24,7 +25,7 @@ public class TransportVersionClusterStateUpgradeIT extends AbstractUpgradeTestCa public void testReadsInferredTransportVersions() throws IOException { assumeTrue("TransportVersion introduced in 8.8.0", UPGRADE_FROM_VERSION.before(Version.V_8_8_0)); - assumeTrue("This only has visible effects when upgrading beyond 8.8.0", TransportVersion.current().after(TransportVersion.V_8_8_0)); + assumeTrue("This only has visible effects when upgrading beyond 8.8.0", TransportVersion.current().after(TransportVersions.V_8_8_0)); assumeTrue("Only runs on the mixed cluster", CLUSTER_TYPE == ClusterType.MIXED); // if the master is not upgraded, and the secondary node is, then the cluster info from the secondary // should have inferred transport versions in it @@ -51,7 +52,7 @@ public void testReadsInferredTransportVersions() throws IOException { assertThat( "Node " + ver.getKey() + " should have an inferred transport version", tvs.get(ver.getKey()), - equalTo(TransportVersion.V_8_8_0) + equalTo(TransportVersions.V_8_8_0) ); } } @@ -59,7 +60,7 @@ public void testReadsInferredTransportVersions() throws IOException { public void testCompletesRealTransportVersions() throws IOException { assumeTrue("TransportVersion introduced in 8.8.0", UPGRADE_FROM_VERSION.before(Version.V_8_8_0)); - assumeTrue("This only has visible effects when upgrading beyond 8.8.0", TransportVersion.current().after(TransportVersion.V_8_8_0)); + assumeTrue("This only has visible effects when upgrading beyond 8.8.0", TransportVersion.current().after(TransportVersions.V_8_8_0)); assumeTrue("Only runs on the upgraded cluster", CLUSTER_TYPE == ClusterType.UPGRADED); // once everything is upgraded, the master should fill in the real transport versions