diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-03-13 14:04:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-13 14:04:06 +0100 |
commit | d059db1e0f1cd0db208d723e75996fd5243219a7 (patch) | |
tree | 9292f9b7757c9750eae2cc3de4141d663806ab48 | |
parent | ca045dcff848acb1558584c63419dc745b5e4d59 (diff) | |
parent | feb43f484b8cd1f20b0a7e415817c49131297fe1 (diff) |
Merge pull request #12559 from vespa-engine/hmusum/remove-unused-methods-2
Remove unused methods
8 files changed, 24 insertions, 30 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/HostResourceTest.java b/config-model/src/test/java/com/yahoo/vespa/model/HostResourceTest.java index 234841f2b6c..4d8d8e52e0e 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/HostResourceTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/HostResourceTest.java @@ -9,17 +9,12 @@ import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.HostSpec; import org.junit.Test; -import java.util.Arrays; import java.util.Optional; -import static com.yahoo.config.provision.ClusterSpec.Type.admin; import static com.yahoo.config.provision.ClusterSpec.Type.container; -import static com.yahoo.config.provision.ClusterSpec.Type.content; import static org.hamcrest.Matchers.endsWith; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; /** * @author gjoranv @@ -54,7 +49,8 @@ public class HostResourceTest { } private static ClusterSpec clusterSpec(ClusterSpec.Type type, String id) { - return ClusterSpec.from(type, ClusterSpec.Id.from(id), ClusterSpec.Group.from(0), Version.fromString("6.42"), false); + return ClusterSpec.from(type, ClusterSpec.Id.from(id), ClusterSpec.Group.from(0), + Version.fromString("6.42"), false, Optional.empty()); } private static HostResource hostResourceWithMemberships(ClusterMembership membership) { diff --git a/config-model/src/test/java/com/yahoo/vespa/model/VespaModelFactoryTest.java b/config-model/src/test/java/com/yahoo/vespa/model/VespaModelFactoryTest.java index 90ec1779f39..5e3f337b2d7 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/VespaModelFactoryTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/VespaModelFactoryTest.java @@ -109,7 +109,9 @@ public class VespaModelFactoryTest { ClusterMembership.from(ClusterSpec.from(ClusterSpec.Type.admin, new ClusterSpec.Id(routingClusterName), ClusterSpec.Group.from(0), - Version.fromString("6.42"), false), + Version.fromString("6.42"), + false, + Optional.empty()), 0)); } @@ -120,7 +122,9 @@ public class VespaModelFactoryTest { ClusterMembership.from(ClusterSpec.from(ClusterSpec.Type.container, new ClusterSpec.Id(routingClusterName), ClusterSpec.Group.from(0), - Version.fromString("6.42"), false), + Version.fromString("6.42"), + false, + Optional.empty()), 0))); } }; diff --git a/config-provisioning/abi-spec.json b/config-provisioning/abi-spec.json index fa7773a54f1..9d09ea10c2c 100644 --- a/config-provisioning/abi-spec.json +++ b/config-provisioning/abi-spec.json @@ -275,9 +275,7 @@ "public boolean isExclusive()", "public com.yahoo.config.provision.ClusterSpec with(java.util.Optional)", "public com.yahoo.config.provision.ClusterSpec exclusive(boolean)", - "public static com.yahoo.config.provision.ClusterSpec request(com.yahoo.config.provision.ClusterSpec$Type, com.yahoo.config.provision.ClusterSpec$Id, com.yahoo.component.Version, boolean)", "public static com.yahoo.config.provision.ClusterSpec request(com.yahoo.config.provision.ClusterSpec$Type, com.yahoo.config.provision.ClusterSpec$Id, com.yahoo.component.Version, boolean, java.util.Optional)", - "public static com.yahoo.config.provision.ClusterSpec from(com.yahoo.config.provision.ClusterSpec$Type, com.yahoo.config.provision.ClusterSpec$Id, com.yahoo.config.provision.ClusterSpec$Group, com.yahoo.component.Version, boolean)", "public static com.yahoo.config.provision.ClusterSpec from(com.yahoo.config.provision.ClusterSpec$Type, com.yahoo.config.provision.ClusterSpec$Id, com.yahoo.config.provision.ClusterSpec$Group, com.yahoo.component.Version, boolean, java.util.Optional)", "public java.lang.String toString()", "public int hashCode()", diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java b/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java index ea4411c03ab..afdae0023bc 100644 --- a/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java +++ b/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java @@ -68,20 +68,10 @@ public final class ClusterSpec { return new ClusterSpec(type, id, groupId, vespaVersion, exclusive, combinedId); } - // TODO(mpolden): Remove after April 2020 - public static ClusterSpec request(Type type, Id id, Version vespaVersion, boolean exclusive) { - return request(type, id, vespaVersion, exclusive, Optional.empty()); - } - public static ClusterSpec request(Type type, Id id, Version vespaVersion, boolean exclusive, Optional<Id> combinedId) { return new ClusterSpec(type, id, Optional.empty(), vespaVersion, exclusive, combinedId); } - // TODO(mpolden): Remove after April 2020 - public static ClusterSpec from(Type type, Id id, Group groupId, Version vespaVersion, boolean exclusive) { - return new ClusterSpec(type, id, Optional.of(groupId), vespaVersion, exclusive, Optional.empty()); - } - public static ClusterSpec from(Type type, Id id, Group groupId, Version vespaVersion, boolean exclusive, Optional<Id> combinedId) { return new ClusterSpec(type, id, Optional.of(groupId), vespaVersion, exclusive, combinedId); } diff --git a/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterMembershipTest.java b/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterMembershipTest.java index aa22747c165..4418b5c85ca 100644 --- a/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterMembershipTest.java +++ b/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterMembershipTest.java @@ -59,7 +59,7 @@ public class ClusterMembershipTest { @Test public void testServiceInstanceWithGroup() { ClusterSpec cluster = ClusterSpec.from(ClusterSpec.Type.content, ClusterSpec.Id.from("id1"), - ClusterSpec.Group.from(4), Version.fromString("6.42"), false); + ClusterSpec.Group.from(4), Version.fromString("6.42"), false, Optional.empty()); assertContentServiceWithGroup(ClusterMembership.from(cluster, 37)); } @@ -77,7 +77,7 @@ public class ClusterMembershipTest { @Test public void testServiceInstanceWithGroupAndRetire() { ClusterSpec cluster = ClusterSpec.from(ClusterSpec.Type.content, ClusterSpec.Id.from("id1"), - ClusterSpec.Group.from(4), Version.fromString("6.42"), false); + ClusterSpec.Group.from(4), Version.fromString("6.42"), false, Optional.empty()); assertContentServiceWithGroupAndRetire(ClusterMembership.retiredFrom(cluster, 37)); } diff --git a/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java b/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java index db90b0ebff9..7f8e41116a6 100644 --- a/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java +++ b/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java @@ -7,6 +7,7 @@ import org.junit.Test; import java.util.List; import java.util.Map; +import java.util.Optional; import static org.junit.Assert.assertEquals; @@ -52,7 +53,8 @@ public class ClusterSpecTest { } private static ClusterSpec spec(ClusterSpec.Type type, String id) { - return ClusterSpec.from(type, ClusterSpec.Id.from(id), ClusterSpec.Group.from(1), Version.emptyVersion, false); + return ClusterSpec.from(type, ClusterSpec.Id.from(id), ClusterSpec.Group.from(1), Version.emptyVersion, + false, Optional.empty()); } } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/AllocationSimulator.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/AllocationSimulator.java index 2c01cdde932..68c68a849b1 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/AllocationSimulator.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/AllocationSimulator.java @@ -110,7 +110,8 @@ public class AllocationSimulator { } private ClusterSpec cluster() { - return ClusterSpec.from(ClusterSpec.Type.container, ClusterSpec.Id.from("test"), ClusterSpec.Group.from(1), Version.fromString("6.41"), false); + return ClusterSpec.from(ClusterSpec.Type.container, ClusterSpec.Id.from("test"), ClusterSpec.Group.from(1), + Version.fromString("6.41"), false, Optional.empty()); } /* ------------ Methods to add events to the system ----------------*/ diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java index a0f0cd26f59..d831ab038db 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java @@ -682,8 +682,9 @@ public class ProvisioningTest { ClusterSpec cluster = ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("music"), Version.fromString("1.2.3"), - false); - var initalNodes = tester.activate(application, tester.prepare(application, cluster, + false, + Optional.empty()); + var initialNodes = tester.activate(application, tester.prepare(application, cluster, Capacity.fromCount(2, defaultResources, false, false), 1)); @@ -691,12 +692,13 @@ public class ProvisioningTest { cluster = ClusterSpec.request(ClusterSpec.Type.combined, ClusterSpec.Id.from("music"), Version.fromString("1.2.3"), - false); + false, + Optional.empty()); var newNodes = tester.activate(application, tester.prepare(application, cluster, Capacity.fromCount(2, defaultResources, false, false), 1)); - assertEquals("Node allocation remains the same", initalNodes, newNodes); + assertEquals("Node allocation remains the same", initialNodes, newNodes); assertEquals("Cluster type is updated", Set.of(ClusterSpec.Type.combined), newNodes.stream().map(n -> n.membership().get().cluster().type()).collect(Collectors.toSet())); @@ -705,11 +707,12 @@ public class ProvisioningTest { cluster = ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("music"), Version.fromString("1.2.3"), - false); + false, + Optional.empty()); newNodes = tester.activate(application, tester.prepare(application, cluster, Capacity.fromCount(2, defaultResources, false, false), 1)); - assertEquals("Node allocation remains the same", initalNodes, newNodes); + assertEquals("Node allocation remains the same", initialNodes, newNodes); assertEquals("Cluster type is updated", Set.of(ClusterSpec.Type.content), newNodes.stream().map(n -> n.membership().get().cluster().type()).collect(Collectors.toSet())); |