From 56c22b52d00b402daf9f93d1dc8925b73ec7b33a Mon Sep 17 00:00:00 2001 From: William Brafford Date: Thu, 16 Nov 2023 16:24:29 -0500 Subject: [PATCH] Remove deprecated CLusterState.Builder methods --- .../java/org/elasticsearch/cluster/ClusterState.java | 10 ---------- .../create/TransportCreateIndexActionTests.java | 2 +- .../org/elasticsearch/cluster/ClusterStateTests.java | 6 +++--- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/ClusterState.java b/server/src/main/java/org/elasticsearch/cluster/ClusterState.java index 884441aa41798..86a43b260d564 100644 --- a/server/src/main/java/org/elasticsearch/cluster/ClusterState.java +++ b/server/src/main/java/org/elasticsearch/cluster/ClusterState.java @@ -818,12 +818,6 @@ public DiscoveryNodes nodes() { return nodes; } - // Deprecate to keep downstream projects compiling - @Deprecated(forRemoval = true) - public Builder putTransportVersion(String nodeId, TransportVersion transportVersion) { - return putCompatibilityVersions(nodeId, transportVersion, Map.of()); - } - public Builder putCompatibilityVersions( String nodeId, TransportVersion transportVersion, @@ -841,10 +835,6 @@ public Builder putCompatibilityVersions(String nodeId, CompatibilityVersions ver } // Deprecate to keep downstream projects compiling - @Deprecated(forRemoval = true) - public Builder compatibilityVersions(Map versions) { - return nodeIdsToCompatibilityVersions(versions); - } public Builder nodeIdsToCompatibilityVersions(Map versions) { versions.forEach((key, value) -> Objects.requireNonNull(value, key)); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/create/TransportCreateIndexActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/create/TransportCreateIndexActionTests.java index c5639d5989d01..966ac50dfab37 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/create/TransportCreateIndexActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/create/TransportCreateIndexActionTests.java @@ -67,7 +67,7 @@ public class TransportCreateIndexActionTests extends ESTestCase { ) .build() ) - .compatibilityVersions( + .nodeIdsToCompatibilityVersions( Map.of( "node-1", new CompatibilityVersions( diff --git a/server/src/test/java/org/elasticsearch/cluster/ClusterStateTests.java b/server/src/test/java/org/elasticsearch/cluster/ClusterStateTests.java index 56c82ae12dc45..e0538603573f7 100644 --- a/server/src/test/java/org/elasticsearch/cluster/ClusterStateTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/ClusterStateTests.java @@ -1248,7 +1248,7 @@ public void testHasMixedSystemIndexVersions() throws IOException { // equal mappings versions { var builder = ClusterState.builder(buildClusterState()); - builder.compatibilityVersions( + builder.nodeIdsToCompatibilityVersions( Map.of( "node1", new CompatibilityVersions( @@ -1268,7 +1268,7 @@ public void testHasMixedSystemIndexVersions() throws IOException { // unequal mappings versions { var builder = ClusterState.builder(buildClusterState()); - builder.compatibilityVersions( + builder.nodeIdsToCompatibilityVersions( Map.of( "node1", new CompatibilityVersions( @@ -1288,7 +1288,7 @@ public void testHasMixedSystemIndexVersions() throws IOException { // one node has a mappings version that the other is missing { var builder = ClusterState.builder(buildClusterState()); - builder.compatibilityVersions( + builder.nodeIdsToCompatibilityVersions( Map.of( "node1", new CompatibilityVersions(