Class: OozieJob
- Inherits:
-
OozieObject
- Object
- OpenStruct
- OozieObject
- OozieJob
- Defined in:
- lib/oozie_objects.rb
Instance Attribute Summary
Attributes inherited from OozieObject
Instance Method Summary collapse
- #actions ⇒ Object
- #console_url ⇒ Object
- #created_at ⇒ Object
- #definition ⇒ Object
- #ended_at ⇒ Object
- #external_id ⇒ Object
- #failed? ⇒ Boolean
- #finished? ⇒ Boolean
- #kill ⇒ Object
- #log ⇒ Object
- #name ⇒ Object
- #path ⇒ Object
- #reload ⇒ Object
- #resume ⇒ Object
- #start ⇒ Object
- #started_at ⇒ Object
- #suspend ⇒ Object
Instance Method Details
#actions ⇒ Object
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_url ⇒ Object
48 |
# File 'lib/oozie_objects.rb', line 48 def console_url; consoleUrl; end |
#created_at ⇒ Object
49 |
# File 'lib/oozie_objects.rb', line 49 def created_at; Time.parse(createdTime) if createdTime; end |
#definition ⇒ Object
18 19 20 |
# File 'lib/oozie_objects.rb', line 18 def definition OozieApi.definition(self.id) end |
#ended_at ⇒ Object
51 |
# File 'lib/oozie_objects.rb', line 51 def ended_at; Time.parse(endTime) if endTime; end |
#external_id ⇒ Object
52 |
# File 'lib/oozie_objects.rb', line 52 def external_id; externalId; end |
#failed? ⇒ Boolean
42 43 44 |
# File 'lib/oozie_objects.rb', line 42 def failed? ['SUSPENDED', 'KILLED', 'FAILED'].include?(self.status) end |
#finished? ⇒ Boolean
38 39 40 |
# File 'lib/oozie_objects.rb', line 38 def finished? !['RUNNING','PREP'].include?(self.status) end |
#kill ⇒ Object
34 35 36 |
# File 'lib/oozie_objects.rb', line 34 def kill OozieApi.kill_job(self.id) end |
#name ⇒ Object
46 |
# File 'lib/oozie_objects.rb', line 46 def name; appName; end |
#path ⇒ Object
47 |
# File 'lib/oozie_objects.rb', line 47 def path; appPath; end |
#reload ⇒ Object
14 15 16 |
# File 'lib/oozie_objects.rb', line 14 def reload OozieApi.info(self.id) end |
#resume ⇒ Object
30 31 32 |
# File 'lib/oozie_objects.rb', line 30 def resume OozieApi.resume_job(self.id) end |
#start ⇒ Object
22 23 24 |
# File 'lib/oozie_objects.rb', line 22 def start OozieApi.start_job(self.id) end |
#started_at ⇒ Object
50 |
# File 'lib/oozie_objects.rb', line 50 def started_at; Time.parse(startTime) if startTime; end |
#suspend ⇒ Object
26 27 28 |
# File 'lib/oozie_objects.rb', line 26 def suspend OozieApi.suspend_job(self.id) end |