Class: Bricolage::StreamingLoad::Job::ControlConnection::TaskInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/bricolage/streamingload/job.rb,
lib/bricolage/streamingload/job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#disabledObject

Returns the value of attribute disabled

Returns:

  • (Object)

    the current value of disabled



281
282
283
# File 'lib/bricolage/streamingload/job.rb', line 281

def disabled
  @disabled
end

#jobsObject

Returns the value of attribute jobs

Returns:

  • (Object)

    the current value of jobs



281
282
283
# File 'lib/bricolage/streamingload/job.rb', line 281

def jobs
  @jobs
end

#object_urlsObject

Returns the value of attribute object_urls

Returns:

  • (Object)

    the current value of object_urls



281
282
283
# File 'lib/bricolage/streamingload/job.rb', line 281

def object_urls
  @object_urls
end

#schema_nameObject

Returns the value of attribute schema_name

Returns:

  • (Object)

    the current value of schema_name



281
282
283
# File 'lib/bricolage/streamingload/job.rb', line 281

def schema_name
  @schema_name
end

#table_nameObject

Returns the value of attribute table_name

Returns:

  • (Object)

    the current value of table_name



281
282
283
# File 'lib/bricolage/streamingload/job.rb', line 281

def table_name
  @table_name
end

#task_classObject

Returns the value of attribute task_class

Returns:

  • (Object)

    the current value of task_class



281
282
283
# File 'lib/bricolage/streamingload/job.rb', line 281

def task_class
  @task_class
end

#task_idObject

Returns the value of attribute task_id

Returns:

  • (Object)

    the current value of task_id



281
282
283
# File 'lib/bricolage/streamingload/job.rb', line 281

def task_id
  @task_id
end

Instance Method Details

#failure_countObject



297
298
299
300
301
302
303
304
305
# File 'lib/bricolage/streamingload/job.rb', line 297

def failure_count
  @failure_count ||= begin
    statuses = jobs.map(&:status)
    statuses.delete('duplicated')
    last_succ = statuses.rindex('success')
    statuses[0..last_succ] = [] if last_succ
    statuses.size
  end
end

#fix_last_job_status(st) ⇒ Object



293
294
295
# File 'lib/bricolage/streamingload/job.rb', line 293

def fix_last_job_status(st)
  jobs.last.status = st unless jobs.empty?
end

#last_job_idObject



288
289
290
291
# File 'lib/bricolage/streamingload/job.rb', line 288

def last_job_id
  return nil if jobs.empty?
  jobs.last.job_id
end

#unknown_state?Boolean

Returns:

  • (Boolean)


283
284
285
286
# File 'lib/bricolage/streamingload/job.rb', line 283

def unknown_state?
  return false if jobs.empty?
  jobs.last.status == 'unknown'
end