summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValerij Fredriksen <valerijf@yahooinc.com>2022-05-05 11:37:08 +0200
committerValerij Fredriksen <valerijf@yahooinc.com>2022-05-05 11:55:55 +0200
commitc765ca65c8895194b023103e5b1706c395db845d (patch)
tree7430ca027a7b4160e3c9a3d99a162519f56298d3
parent3c7541db0e8ab81e37c5d9e4fa6de37767f6bf21 (diff)
Change node index type
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java12
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java4
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-nodes.json3
3 files changed, 10 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 590ce53c7b9..a381bcd5bed 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,7 +57,7 @@ public class Node {
private final String clusterId;
private final ClusterType clusterType;
private final String group;
- private final String index;
+ private final int index;
private final boolean retired;
private final boolean wantToRetire;
private final boolean wantToDeprovision;
@@ -80,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, String index, boolean retired, boolean wantToRetire, boolean wantToDeprovision,
+ ClusterType clusterType, String group, int 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,
@@ -265,10 +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; }
+ public int index() { return index; }
/** Whether this node has been requested to retire */
public boolean wantToRetire() {
@@ -471,7 +471,7 @@ public class Node {
private String clusterId = "";
private ClusterType clusterType = ClusterType.unknown;
private String group = "";
- private String index = "";
+ private int index = 0;
private boolean retired = false;
private boolean wantToRetire = false;
private boolean wantToDeprovision = false;
@@ -679,7 +679,7 @@ public class Node {
return this;
}
- public Builder index(String index) {
+ public Builder index(int index) {
this.index = index;
return this;
}
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
index b3d18252bf5..609776c0c8e 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
@@ -29,6 +29,7 @@ import com.yahoo.container.jdisc.HttpRequest;
import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.container.jdisc.ThreadedHttpRequestHandler;
import com.yahoo.io.IOUtils;
+import com.yahoo.jdisc.http.filter.security.misc.User;
import com.yahoo.restapi.ByteArrayResponse;
import com.yahoo.restapi.ErrorResponse;
import com.yahoo.restapi.MessageResponse;
@@ -72,7 +73,6 @@ import com.yahoo.vespa.hosted.controller.api.integration.deployment.RunId;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.SourceRevision;
import com.yahoo.vespa.hosted.controller.api.integration.noderepository.RestartFilter;
import com.yahoo.vespa.hosted.controller.api.integration.secrets.TenantSecretStore;
-import com.yahoo.jdisc.http.filter.security.misc.User;
import com.yahoo.vespa.hosted.controller.api.role.Role;
import com.yahoo.vespa.hosted.controller.api.role.RoleDefinition;
import com.yahoo.vespa.hosted.controller.api.role.SecurityContext;
@@ -1120,7 +1120,7 @@ public class ApplicationApiHandler extends AuditLoggingRequestHandler {
nodeObject.setBool("restarting", node.wantedRestartGeneration() > node.restartGeneration());
nodeObject.setBool("rebooting", node.wantedRebootGeneration() > node.rebootGeneration());
nodeObject.setString("group", node.group());
- nodeObject.setString("index", node.index());
+ nodeObject.setLong("index", node.index());
}
return new SlimeJsonResponse(slime);
}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-nodes.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-nodes.json
index 88a92bf7810..34d2f054e0f 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-nodes.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-nodes.json
@@ -18,7 +18,8 @@
"retired": false,
"restarting": false,
"rebooting": false,
- "group": ""
+ "group": "",
+ "index": 0
}
]
}