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



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

def disabled
  @disabled
end

#jobsObject

Returns the value of attribute jobs

Returns:

  • (Object)

    the current value of jobs



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

def jobs
  @jobs
end

#object_urlsObject

Returns the value of attribute object_urls

Returns:

  • (Object)

    the current value of object_urls



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

def object_urls
  @object_urls
end

#schema_nameObject

Returns the value of attribute schema_name

Returns:

  • (Object)

    the current value of schema_name



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

def schema_name
  @schema_name
end

#table_nameObject

Returns the value of attribute table_name

Returns:

  • (Object)

    the current value of table_name



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

def table_name
  @table_name
end

#task_classObject

Returns the value of attribute task_class

Returns:

  • (Object)

    the current value of task_class



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

def task_class
  @task_class
end

#task_idObject

Returns the value of attribute task_id

Returns:

  • (Object)

    the current value of task_id



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

def task_id
  @task_id
end

Instance Method Details

#failure_countObject



308
309
310
311
312
313
314
315
316
# File 'lib/bricolage/streamingload/job.rb', line 308

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



304
305
306
# File 'lib/bricolage/streamingload/job.rb', line 304

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

#last_job_idObject



299
300
301
302
# File 'lib/bricolage/streamingload/job.rb', line 299

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

#unknown_state?Boolean

Returns:

  • (Boolean)


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

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