diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2021-01-14 21:18:47 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2021-01-14 21:18:47 +0100 |
commit | 998cee45777d01b23aa8cacefb29f0a8f424edc6 (patch) | |
tree | c04177fa778b03eb06c7ccfd91f67868477b2322 /controller-api | |
parent | 1e57b906a0ed44a8d745030842a482f2347fe1b5 (diff) |
Update reindexing status clients in controller, and trigger only for indexed
Diffstat (limited to 'controller-api')
2 files changed, 6 insertions, 24 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 e143cdd6d9e..f94a91dc0c6 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 @@ -6,8 +6,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import static java.util.Objects.requireNonNull; - /** * Reindexing status for a single Vespa application. * @@ -16,12 +14,10 @@ import static java.util.Objects.requireNonNull; public class ApplicationReindexing { private final boolean enabled; - private final Status common; private final Map<String, Cluster> clusters; - public ApplicationReindexing(boolean enabled, Status common, Map<String, Cluster> clusters) { + public ApplicationReindexing(boolean enabled, Map<String, Cluster> clusters) { this.enabled = enabled; - this.common = requireNonNull(common); this.clusters = Map.copyOf(clusters); } @@ -29,10 +25,6 @@ public class ApplicationReindexing { return enabled; } - public Status common() { - return common; - } - public Map<String, Cluster> clusters() { return clusters; } @@ -43,20 +35,18 @@ public class ApplicationReindexing { if (o == null || getClass() != o.getClass()) return false; ApplicationReindexing that = (ApplicationReindexing) o; return enabled == that.enabled && - common.equals(that.common) && clusters.equals(that.clusters); } @Override public int hashCode() { - return Objects.hash(enabled, common, clusters); + return Objects.hash(enabled, clusters); } @Override public String toString() { return "ApplicationReindexing{" + "enabled=" + enabled + - ", common=" + common + ", clusters=" + clusters + '}'; } @@ -64,20 +54,14 @@ public class ApplicationReindexing { public static class Cluster { - 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 = Optional.ofNullable(common); + public Cluster(Map<String, Long> pending, Map<String, Status> ready) { this.pending = Map.copyOf(pending); this.ready = Map.copyOf(ready); } - public Optional<Status> common() { - return common; - } - public Map<String, Long> pending() { return pending; } @@ -91,20 +75,18 @@ public class ApplicationReindexing { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Cluster cluster = (Cluster) o; - return common.equals(cluster.common) && - pending.equals(cluster.pending) && + return pending.equals(cluster.pending) && ready.equals(cluster.ready); } @Override public int hashCode() { - return Objects.hash(common, pending, ready); + return Objects.hash(pending, ready); } @Override public String toString() { return "Cluster{" + - "common=" + common + ", pending=" + pending + ", ready=" + ready + '}'; diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java index 11940b30ac1..a90155d4e3e 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java @@ -35,7 +35,7 @@ public interface ConfigServer { PreparedApplication deploy(DeploymentData deployment); - void reindex(DeploymentId deployment, List<String> clusterNames, List<String> documentTypes); + void reindex(DeploymentId deployment, List<String> clusterNames, List<String> documentTypes, boolean indexedOnly); Optional<ApplicationReindexing> getReindexing(DeploymentId deployment); |