diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2018-07-06 12:22:56 +0200 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2018-07-06 12:22:56 +0200 |
commit | 6a5c2167977fd99ed0502f732fff9e20cf3e0900 (patch) | |
tree | d9ffcb7a95370ac3ee290324219344918b09b89c /controller-api | |
parent | 95540cadc561a0d286d9439602d5ecb396e9f8db (diff) |
Expand Node interface and check for pending re[boot|start|s
Diffstat (limited to 'controller-api')
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java | 53 |
1 files changed, 50 insertions, 3 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java index d75f0e90d63..90864730a15 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java @@ -5,6 +5,7 @@ import com.yahoo.component.Version; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.HostName; import com.yahoo.config.provision.NodeType; +import org.jetbrains.annotations.TestOnly; import java.util.Objects; import java.util.Optional; @@ -13,24 +14,43 @@ import java.util.Optional; * A node in hosted Vespa. * * @author mpolden + * @author jonmv */ public class Node { private final HostName hostname; private final State state; - private final Optional<ApplicationId> owner; private final NodeType type; + private final Optional<ApplicationId> owner; private final Version currentVersion; private final Version wantedVersion; + private final ServiceState serviceState; + private final long restartGeneration; + private final long wantedRestartGeneration; + private final long rebootGeneration; + private final long wantedRebootGeneration; - public Node(HostName hostname, State state, NodeType type, Optional<ApplicationId> owner, Version currentVersion, - Version wantedVersion) { + public Node(HostName hostname, State state, NodeType type, Optional<ApplicationId> owner, + Version currentVersion, Version wantedVersion, ServiceState serviceState, + long restartGeneration, long wantedRestartGeneration, long rebootGeneration, long wantedRebootGeneration) { this.hostname = hostname; this.state = state; this.type = type; this.owner = owner; this.currentVersion = currentVersion; this.wantedVersion = wantedVersion; + this.serviceState = serviceState; + this.restartGeneration = restartGeneration; + this.wantedRestartGeneration = wantedRestartGeneration; + this.rebootGeneration = rebootGeneration; + this.wantedRebootGeneration = wantedRebootGeneration; + } + + @TestOnly + public Node(HostName hostname, State state, NodeType type, Optional<ApplicationId> owner, + Version currentVersion, Version wantedVersion) { + this(hostname, state, type, owner, currentVersion, wantedVersion, + ServiceState.unorchestrated, 0, 0, 0, 0); } public HostName hostname() { @@ -55,6 +75,26 @@ public class Node { return wantedVersion; } + public ServiceState serviceState() { + return serviceState; + } + + public long restartGeneration() { + return restartGeneration; + } + + public long wantedRestartGeneration() { + return wantedRestartGeneration; + } + + public long rebootGeneration() { + return rebootGeneration; + } + + public long wantedRebootGeneration() { + return wantedRebootGeneration; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -80,4 +120,11 @@ public class Node { parked } + /** Known node states with regards to service orchestration */ + public enum ServiceState { + expectedUp, + allowedDown, + unorchestrated + } + } |