Class: Bosh::Director::DeploymentPlan::BatchMultiJobUpdater

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/deployment_plan/multi_job_updater.rb

Instance Method Summary collapse

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