diff options
author | Leandro Alves <leandroalves@yahooinc.com> | 2022-05-05 11:30:04 +0200 |
---|---|---|
committer | Leandro Alves <leandroalves@yahooinc.com> | 2022-05-05 11:30:04 +0200 |
commit | 3c7541db0e8ab81e37c5d9e4fa6de37767f6bf21 (patch) | |
tree | 388c62bf171977da8742d5c5b504c32823eb6757 /controller-api | |
parent | a6f4bcefc08cb924b179cc1eadd9b2f95f2ffab1 (diff) |
Add membership index to nodes
Diffstat (limited to 'controller-api')
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java | 26 |
1 files changed, 17 insertions, 9 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 bb97349e5dd..590ce53c7b9 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 @@ -57,6 +57,7 @@ public class Node { private final String clusterId; private final ClusterType clusterType; private final String group; + private final String index; private final boolean retired; private final boolean wantToRetire; private final boolean wantToDeprovision; @@ -79,7 +80,7 @@ public class Node { Optional<Instant> wantedFirmwareCheck, ServiceState serviceState, Optional<Instant> suspendedSince, long restartGeneration, long wantedRestartGeneration, long rebootGeneration, long wantedRebootGeneration, int cost, int failCount, Optional<String> flavor, String clusterId, - ClusterType clusterType, String group, boolean retired, boolean wantToRetire, boolean wantToDeprovision, + ClusterType clusterType, String group, String index, boolean retired, boolean wantToRetire, boolean wantToDeprovision, boolean wantToRebuild, boolean down, Optional<TenantName> reservedTo, Optional<ApplicationId> exclusiveTo, DockerImage wantedDockerImage, DockerImage currentDockerImage, Map<String, String> reports, List<Event> history, Set<String> ipAddresses, Set<String> additionalIpAddresses, @@ -111,6 +112,7 @@ public class Node { this.clusterType = Objects.requireNonNull(clusterType, "clusterType must be non-null"); this.retired = retired; this.group = Objects.requireNonNull(group, "group must be non-null"); + this.index = index; this.wantToRetire = wantToRetire; this.wantToDeprovision = wantToDeprovision; this.reservedTo = Objects.requireNonNull(reservedTo, "reservedTo must be non-null"); @@ -263,9 +265,10 @@ public class Node { } /** The group of this node, empty string if unallocated */ - public String group() { - return group; - } + public String group() {return group; } + + /** The membership index of this node */ + public String index() {return index; } /** Whether this node has been requested to retire */ public boolean wantToRetire() { @@ -283,9 +286,7 @@ public class Node { } /** Whether this node is currently down */ - public boolean down() { - return down; - } + public boolean down() { return down; } /** The tenant this has been reserved to, if any */ public Optional<TenantName> reservedTo() { return reservedTo; } @@ -376,7 +377,7 @@ public class Node { combined, unknown } - + /** Known nope environments */ public enum Environment { bareMetal, @@ -470,6 +471,7 @@ public class Node { private String clusterId = ""; private ClusterType clusterType = ClusterType.unknown; private String group = ""; + private String index = ""; private boolean retired = false; private boolean wantToRetire = false; private boolean wantToDeprovision = false; @@ -516,6 +518,7 @@ public class Node { this.clusterId = node.clusterId; this.clusterType = node.clusterType; this.group = node.group; + this.index = node.index; this.retired = node.retired; this.wantToRetire = node.wantToRetire; this.wantToDeprovision = node.wantToDeprovision; @@ -676,6 +679,11 @@ public class Node { return this; } + public Builder index(String index) { + this.index = index; + return this; + } + public Builder retired(boolean retired) { this.retired = retired; return this; @@ -755,7 +763,7 @@ public class Node { return new Node(id, hostname, parentHostname, state, type, resources, owner, currentVersion, wantedVersion, currentOsVersion, wantedOsVersion, currentFirmwareCheck, wantedFirmwareCheck, serviceState, suspendedSince, restartGeneration, wantedRestartGeneration, rebootGeneration, - wantedRebootGeneration, cost, failCount, flavor, clusterId, clusterType, group, retired, + wantedRebootGeneration, cost, failCount, flavor, clusterId, clusterType, group, index, retired, wantToRetire, wantToDeprovision, wantToRebuild, down, reservedTo, exclusiveTo, wantedDockerImage, currentDockerImage, reports, history, ipAddresses, additionalIpAddresses, additionalHostnames, switchHostname, modelName, environment); |