diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2018-09-04 12:28:58 +0200 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2018-09-04 12:28:58 +0200 |
commit | 504067e489aae639e52042d72da2d861880414e1 (patch) | |
tree | 6338fbd1ccebe2c8ea441f25cad3756502b6b504 /controller-api | |
parent | 7ee8a275f147330bb5540eeffc60d7005f71581a (diff) |
Parse and expose config generation details
Diffstat (limited to 'controller-api')
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ServiceConvergence.java | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ServiceConvergence.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ServiceConvergence.java index 8a90224083b..6cfdc9fadc8 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ServiceConvergence.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ServiceConvergence.java @@ -1,35 +1,63 @@ // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.integration.configserver; +import com.google.common.collect.ImmutableList; import com.yahoo.config.provision.ApplicationId; +import com.yahoo.config.provision.HostName; import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneId; +import java.util.List; +import java.util.OptionalLong; + /** * Service convergence status for an application. * * @author mpolden + * @author jonmv */ public class ServiceConvergence { private final ApplicationId application; private final ZoneId zone; private final boolean converged; + private final long wantedGeneration; + private final List<Status> services; - public ServiceConvergence(ApplicationId application, ZoneId zone, boolean converged) { + public ServiceConvergence(ApplicationId application, ZoneId zone, boolean converged, + long wantedGeneration, List<Status> services) { this.application = application; this.zone = zone; this.converged = converged; + this.wantedGeneration = wantedGeneration; + this.services = ImmutableList.copyOf(services); } - public ApplicationId application() { - return application; - } + public ApplicationId application() { return application; } + public ZoneId zone() { return zone; } + public boolean converged() { return converged; } + public long wantedGeneration() { return wantedGeneration; } + public List<Status> services() { return services; } - public ZoneId zone() { - return zone; - } - public boolean converged() { - return converged; + /** Immutable class detailing the config status of a particular service for an application. */ + public static class Status { + private final HostName host; + private final long port; + private final String type; + private final long currentGeneration; + + public Status(HostName host, long port, String type, long currentGeneration) { + this.host = host; + this.port = port; + this.type = type; + this.currentGeneration = currentGeneration; + } + + public HostName host() { return host; } + public long port() { return port; } + public String type() { return type; } + public long currentGeneration() { return currentGeneration; } + } + } |