diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2018-01-05 11:39:16 +0100 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2018-01-05 11:39:16 +0100 |
commit | 1122a0a8945c41703af2d746d927f30273c3f678 (patch) | |
tree | 9630e942dc9718156de3d3df0d5d7efcf8733027 | |
parent | e3991f998029c59918dcaf19de2de3c5309bcf04 (diff) |
Added some doc and removed unused methods
2 files changed, 10 insertions, 8 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentQueue.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentQueue.java index 4453175e91e..06d7d72a2f3 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentQueue.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentQueue.java @@ -31,15 +31,19 @@ public class DeploymentQueue { this.curator = curator; } + /** Add the given application to the queue of the given job type -- in front if first, at the back otherwise. */ public void addJob(ApplicationId applicationId, JobType jobType, boolean first) { locked(jobType, queue -> { - if (first) - queue.addFirst(applicationId); - else - queue.addLast(applicationId); + if ( ! queue.contains(applicationId)) { + if (first) + queue.addFirst(applicationId); + else + queue.addLast(applicationId); + } }); } + /** List all jobs currently enqueued. */ public List<BuildJob> jobs() { ImmutableList.Builder<BuildJob> builder = ImmutableList.builder(); for (JobType jobType : JobType.values()) @@ -49,6 +53,7 @@ public class DeploymentQueue { return builder.build(); } + /** Remove and return a set of jobs to run. This set will contain only one of each job type for capacity constrained zones. */ public List<BuildJob> takeJobsToRun() { ImmutableList.Builder<BuildJob> builder = ImmutableList.builder(); for (JobType jobType : JobType.values()) @@ -61,6 +66,7 @@ public class DeploymentQueue { return builder.build(); } + /** Remove all enqueued jobs for the given application. */ public void removeJobs(ApplicationId applicationId) { for (JobType jobType : JobType.values()) locked(jobType, queue -> { diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/Maintainer.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/Maintainer.java index 5d55a0f71f0..40563c4cf95 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/Maintainer.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/Maintainer.java @@ -41,10 +41,6 @@ public abstract class Maintainer extends AbstractComponent implements Runnable { protected Controller controller() { return controller; } - protected CuratorDb curator() { return jobControl.curator(); } - - protected JobControl jobControl() { return jobControl; } - @Override public void run() { try { |