summaryrefslogtreecommitdiffstats
path: root/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2023-02-15 19:31:32 +0100
committerJon Bratseth <bratseth@gmail.com>2023-02-15 19:31:32 +0100
commit288af4201cdd7e00d6a0f0242c1295b333bd44ab (patch)
tree64ec820cde183f4f9da13a5119e20dac706a91e9 /controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java
parent4c9206d8119d1131e248419c7e1ba669c396b89b (diff)
Maintain deploymentInfo
Diffstat (limited to 'controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java
index d053106fcee..a4bded314d9 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java
@@ -93,6 +93,7 @@ import java.util.Optional;
import java.util.OptionalInt;
import java.util.Set;
import java.util.TreeMap;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Consumer;
import java.util.function.Predicate;
@@ -144,6 +145,7 @@ public class ApplicationController {
private final ListFlag<String> incompatibleVersions;
private final BillingController billingController;
private final ListFlag<String> cloudAccountsFlag;
+ private final Map<DeploymentId, com.yahoo.vespa.hosted.controller.api.integration.configserver.Application> deploymentInfo = new ConcurrentHashMap<>();
ApplicationController(Controller controller, CuratorDb curator, AccessControl accessControl, Clock clock,
FlagSource flagSource, BillingController billingController) {
@@ -206,6 +208,15 @@ public class ApplicationController {
}
/**
+ * Returns in-memory info for the given deployment pulled from the node repo.
+ * Info on any existing deployment can be missing if it has not yet been fetched since this instance was started.
+ * This is kept up to date by DeploymentInfoMaintainer.
+ * Accessing this is thread safe.
+ */
+ // TODO: Replace the wire level Application by a DeploymentInfo class in the model
+ public Map<DeploymentId, com.yahoo.vespa.hosted.controller.api.integration.configserver.Application> deploymentInfo() { return deploymentInfo; }
+
+ /**
* Triggers reindexing for the given document types in the given clusters, for the given application.
* <p>
* If no clusters are given, reindexing is triggered for the entire application; otherwise