diff options
author | Harald Musum <musum@verizonmedia.com> | 2019-08-27 13:36:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-27 13:36:53 +0200 |
commit | d67186bc14ac89c2247de1343a27fefcc0c301da (patch) | |
tree | 5b7587405c5ecfa9cbdf471dff0baa8c7840ec6c /configserver | |
parent | bc44cc9c03079a202be62ecd323ef07ef4b3e09b (diff) |
Revert " Upgrade to zookeeper 3.4.14, take 4"
Diffstat (limited to 'configserver')
3 files changed, 29 insertions, 15 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/serviceview/Cluster.java b/configserver/src/main/java/com/yahoo/vespa/serviceview/Cluster.java index d7005de5b07..3b39a85c6b1 100644 --- a/configserver/src/main/java/com/yahoo/vespa/serviceview/Cluster.java +++ b/configserver/src/main/java/com/yahoo/vespa/serviceview/Cluster.java @@ -6,18 +6,22 @@ import java.util.List; import com.google.common.collect.ImmutableList; +import edu.umd.cs.findbugs.annotations.NonNull; + /** * Model a single cluster of services in the Vespa model. * - * @author Steinar Knutsen + * @author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a> */ public final class Cluster implements Comparable<Cluster> { - + @NonNull public final String name; + @NonNull public final String type; /** * An ordered list of the service instances in this cluster. */ + @NonNull public final ImmutableList<Service> services; public Cluster(String name, String type, List<Service> services) { diff --git a/configserver/src/main/java/com/yahoo/vespa/serviceview/Service.java b/configserver/src/main/java/com/yahoo/vespa/serviceview/Service.java index f10e2afa046..b5d18bdbb1f 100644 --- a/configserver/src/main/java/com/yahoo/vespa/serviceview/Service.java +++ b/configserver/src/main/java/com/yahoo/vespa/serviceview/Service.java @@ -1,31 +1,37 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.serviceview; -import com.google.common.collect.ImmutableList; -import com.yahoo.text.Utf8; - import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.List; +import com.google.common.collect.ImmutableList; +import com.yahoo.text.Utf8; + +import edu.umd.cs.findbugs.annotations.NonNull; + /** * Model a single service instance as a sortable object. * - * @author Steinar Knutsen + * @author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a> */ public final class Service implements Comparable<Service> { - + @NonNull public final String serviceType; + @NonNull public final String host; public final int statePort; + @NonNull public final String configId; + @NonNull public final List<Integer> ports; + @NonNull public final String name; public Service(String serviceType, String host, int statePort, String clusterName, String clusterType, - String configId, List<Integer> ports, String name) { + String configId, List<Integer> ports, String name) { this.serviceType = serviceType; this.host = host.toLowerCase(); this.statePort = statePort; @@ -53,7 +59,8 @@ public final class Service implements Comparable<Service> { * Generate an identifier string for one of the ports of this service * suitable for using in an URL. * - * @param port port which this identifier pertains to + * @param port + * port which this identifier pertains to * @return an opaque identifier string for this service */ public String getIdentifier(int port) { diff --git a/configserver/src/main/java/com/yahoo/vespa/serviceview/ServiceModel.java b/configserver/src/main/java/com/yahoo/vespa/serviceview/ServiceModel.java index dc6fbb7ebd3..c9574ffaa7e 100644 --- a/configserver/src/main/java/com/yahoo/vespa/serviceview/ServiceModel.java +++ b/configserver/src/main/java/com/yahoo/vespa/serviceview/ServiceModel.java @@ -1,6 +1,12 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.serviceview; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import com.google.common.collect.HashBasedTable; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -13,11 +19,7 @@ import com.yahoo.vespa.serviceview.bindings.ModelResponse; import com.yahoo.vespa.serviceview.bindings.ServicePort; import com.yahoo.vespa.serviceview.bindings.ServiceView; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import edu.umd.cs.findbugs.annotations.NonNull; import static com.yahoo.config.model.api.container.ContainerServiceType.CLUSTERCONTROLLER_CONTAINER; @@ -35,6 +37,7 @@ public final class ServiceModel { /** * An ordered list of the clusters in this config model. */ + @NonNull public final ImmutableList<Cluster> clusters; ServiceModel(ModelResponse modelConfig) { @@ -152,7 +155,7 @@ public final class ServiceModel { } } - private Service getFirstServiceInstanceByType(String typeName) { + private Service getFirstServiceInstanceByType(@NonNull String typeName) { for (Cluster c : clusters) { for (Service s : c.services) { if (typeName.equals(s.serviceType)) { |