aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server/src
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2022-04-10 20:39:07 +0200
committerjonmv <venstad@gmail.com>2022-04-11 13:42:26 +0200
commit7d5a72fe03ed4fa97ae87a73da92a2156345c3d3 (patch)
tree1af9b2d39aa9507b1c377f9137c200bbaa8725aa /controller-server/src
parent4496a556fb74d1fe38cb27261b5955f9f5ae6b79 (diff)
Remove unused code
Diffstat (limited to 'controller-server/src')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/ApplicationList.java50
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java2
2 files changed, 1 insertions, 51 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/ApplicationList.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/ApplicationList.java
index 5c0669ad543..411c2c133f5 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/ApplicationList.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/ApplicationList.java
@@ -39,13 +39,6 @@ public class ApplicationList extends AbstractFilteringList<Application, Applicat
.collect(Collectors.toUnmodifiableList()));
}
- // ----------------------------------- Accessors
-
- /** Returns the ids of the applications in this as an immutable list */
- public List<TenantAndApplicationId> idList() {
- return mapToList(Application::id);
- }
-
// ----------------------------------- Filters
/** Returns the subset of applications which have at least one production deployment */
@@ -54,13 +47,6 @@ public class ApplicationList extends AbstractFilteringList<Application, Applicat
.anyMatch(instance -> instance.productionDeployments().size() > 0));
}
- /** Returns the subset of applications which have at least one deployment on a lower version than the given one */
- public ApplicationList onLowerVersionThan(Version version) {
- return matching(application -> application.instances().values().stream()
- .flatMap(instance -> instance.productionDeployments().values().stream())
- .anyMatch(deployment -> deployment.version().isBefore(version)));
- }
-
/** Returns the subset of applications with at least one declared job in deployment spec. */
public ApplicationList withJobs() {
return matching(application -> application.deploymentSpec().steps().stream()
@@ -72,45 +58,9 @@ public class ApplicationList extends AbstractFilteringList<Application, Applicat
return matching(application -> application.projectId().isPresent());
}
- /** Returns the subset of applications that are allowed to upgrade at the given time */
- public ApplicationList canUpgradeAt(Instant instant) {
- return matching(application -> application.deploymentSpec().instances().stream()
- .allMatch(instance -> instance.canUpgradeAt(instant)));
- }
-
- /** Returns the subset of applications that have at least one assigned rotation */
- public ApplicationList hasRotation() {
- return matching(application -> application.instances().values().stream()
- .anyMatch(instance -> ! instance.rotations().isEmpty()));
- }
-
- /**
- * Returns the subset of applications that hasn't pinned to an an earlier major version than the given one.
- *
- * @param targetMajorVersion the target major version which applications returned allows upgrading to
- * @param defaultMajorVersion the default major version to assume for applications not specifying one
- */
- public ApplicationList allowMajorVersion(int targetMajorVersion, int defaultMajorVersion) {
- return matching(application -> targetMajorVersion <= application.deploymentSpec().majorVersion()
- .orElse(application.majorVersion()
- .orElse(defaultMajorVersion)));
- }
-
/** Returns the subset of application which have submitted a non-empty deployment spec. */
public ApplicationList withDeploymentSpec() {
return matching(application -> ! DeploymentSpec.empty.equals(application.deploymentSpec()));
}
- // ----------------------------------- Sorting
-
- /**
- * Returns this list sorted by increasing deployed version.
- * If multiple versions are deployed the oldest is used.
- * Applications without any deployments are ordered first.
- */
- public ApplicationList byIncreasingDeployedVersion() {
- return sortedBy(Comparator.comparing(application -> application.oldestDeployedPlatform()
- .orElse(Version.emptyVersion)));
- }
-
}
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java
index ae180ec1192..889ac6a6de4 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java
@@ -354,7 +354,7 @@ public class DeploymentTrigger {
/** Returns the set of all jobs which have changes to propagate from the upstream steps. */
private List<Job> computeReadyJobs() {
return jobs.deploymentStatuses(ApplicationList.from(applications().readable())
- .withProjectId() // Need to keep this, as we have applications with deployment spec that shouldn't be orchestrated.
+ .withProjectId() // Need to keep this, as we have applications with deployment spec that shouldn't be orchestrated. // Maybe not any longer?
.withDeploymentSpec())
.withChanges()
.asList().stream()