Class: OozieJob

Inherits:
OozieObject show all
Defined in:
lib/oozie_objects.rb

Instance Attribute Summary

Attributes inherited from OozieObject

#table

Instance Method Summary collapse

Instance Method Details

#actionsObject



53
54
55
56
57
# File 'lib/oozie_objects.rb', line 53

def actions
  @table[:actions] ||= []
  @actions = @table[:actions].map {|a| OozieAction.new(a)} unless @actions
  @actions
end

#console_urlObject



48
# File 'lib/oozie_objects.rb', line 48

def console_url; consoleUrl; end

#created_atObject



49
# File 'lib/oozie_objects.rb', line 49

def created_at; Time.parse(createdTime) if createdTime; end

#definitionObject



18
19
20
# File 'lib/oozie_objects.rb', line 18

def definition
  OozieApi.definition(self.id)
end

#ended_atObject



51
# File 'lib/oozie_objects.rb', line 51

def ended_at; Time.parse(endTime) if endTime; end

#external_idObject



52
# File 'lib/oozie_objects.rb', line 52

def external_id; externalId; end

#failed?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/oozie_objects.rb', line 42

def failed?
  ['SUSPENDED', 'KILLED', 'FAILED'].include?(self.status)
end

#finished?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/oozie_objects.rb', line 38

def finished?
  !['RUNNING','PREP'].include?(self.status)
end

#killObject



34
35
36
# File 'lib/oozie_objects.rb', line 34

def kill
  OozieApi.kill_job(self.id)
end

#logObject



10
11
12
# File 'lib/oozie_objects.rb', line 10

def log
  OozieApi.log(self.id)
end

#nameObject



46
# File 'lib/oozie_objects.rb', line 46

def name; appName; end

#pathObject



47
# File 'lib/oozie_objects.rb', line 47

def path; appPath; end

#reloadObject



14
15
16
# File 'lib/oozie_objects.rb', line 14

def reload
  OozieApi.info(self.id)
end

#resumeObject



30
31
32
# File 'lib/oozie_objects.rb', line 30

def resume
  OozieApi.resume_job(self.id)
end

#startObject



22
23
24
# File 'lib/oozie_objects.rb', line 22

def start
  OozieApi.start_job(self.id)
end

#started_atObject



50
# File 'lib/oozie_objects.rb', line 50

def started_at; Time.parse(startTime) if startTime; end

#suspendObject



26
27
28
# File 'lib/oozie_objects.rb', line 26

def suspend
  OozieApi.suspend_job(self.id)
end