Class: Bosh::Director::DeploymentPlan::BatchMultiJobUpdater
- Defined in:
- lib/bosh/director/deployment_plan/multi_job_updater.rb
Instance Method Summary collapse
-
#initialize(job_updater_factory) ⇒ BatchMultiJobUpdater
constructor
A new instance of BatchMultiJobUpdater.
- #run(base_job, deployment_plan, jobs) ⇒ Object
Constructor Details
#initialize(job_updater_factory) ⇒ BatchMultiJobUpdater
Returns a new instance of BatchMultiJobUpdater.
42 43 44 |
# File 'lib/bosh/director/deployment_plan/multi_job_updater.rb', line 42 def initialize(job_updater_factory) @job_updater_factory = job_updater_factory end |
Instance Method Details
#run(base_job, deployment_plan, jobs) ⇒ Object
46 47 48 49 50 51 52 53 54 |
# File 'lib/bosh/director/deployment_plan/multi_job_updater.rb', line 46 def run(base_job, deployment_plan, jobs) serial_updater = SerialMultiJobUpdater.new(@job_updater_factory) parallel_updater = ParallelMultiJobUpdater.new(@job_updater_factory) partition_jobs_by_serial(jobs).each do |jp| updater = jp.first.update.serial? ? serial_updater : parallel_updater updater.run(base_job, deployment_plan, jp) end end |