diff options
2 files changed, 4 insertions, 4 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ApplicationReindexing.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ApplicationReindexing.java index b6c7899aef1..868d251d7ee 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ApplicationReindexing.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ApplicationReindexing.java @@ -64,17 +64,17 @@ public class ApplicationReindexing { public static class Cluster { - private final Status common; + private final Optional<Status> common; private final Map<String, Long> pending; private final Map<String, Status> ready; public Cluster(Status common, Map<String, Long> pending, Map<String, Status> ready) { - this.common = requireNonNull(common); + this.common = Optional.ofNullable(common); this.pending = Map.copyOf(pending); this.ready = Map.copyOf(ready); } - public Status common() { + public Optional<Status> common() { return common; } 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 4a6d6e2e72d..cbf6307f5e6 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 @@ -1576,7 +1576,7 @@ public class ApplicationApiHandler extends LoggingRequestHandler { .forEach(cluster -> { Cursor clusterObject = clustersArray.addObject(); clusterObject.setString("name", cluster.getKey()); - setStatus(clusterObject.setObject("status"), cluster.getValue().common()); + cluster.getValue().common().ifPresent(common -> setStatus(clusterObject.setObject("status"), common)); Cursor pendingArray = clusterObject.setArray("pending"); cluster.getValue().pending().entrySet().stream().sorted(comparingByKey()) |