Class: ElephantDriver::Task
- Inherits:
-
Object
- Object
- ElephantDriver::Task
- Defined in:
- lib/elephant-driver/task.rb
Instance Method Summary collapse
- #completed? ⇒ Boolean
- #counters ⇒ Object
- #exec_finish_time ⇒ Object
- #exec_start_time ⇒ Object
- #failed? ⇒ Boolean
-
#initialize(cln, thrift_task) ⇒ Task
constructor
A new instance of Task.
- #progress ⇒ Object
- #start_time ⇒ Object
Constructor Details
#initialize(cln, thrift_task) ⇒ Task
Returns a new instance of Task.
6 7 8 9 |
# File 'lib/elephant-driver/task.rb', line 6 def initialize(cln, thrift_task) @cln = cln @thrift_task = thrift_task end |
Instance Method Details
#completed? ⇒ Boolean
31 32 33 |
# File 'lib/elephant-driver/task.rb', line 31 def completed? @thrift_task.complete end |
#counters ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/elephant-driver/task.rb', line 35 def counters counters = {} @thrift_task.counters.groups.each { |g| h = {} g.counters.each { |name, c| h[name] = c.value } counters[g.name] = h } counters end |
#exec_finish_time ⇒ Object
19 20 21 |
# File 'lib/elephant-driver/task.rb', line 19 def exec_finish_time @thrift_task.execFinishTime end |
#exec_start_time ⇒ Object
15 16 17 |
# File 'lib/elephant-driver/task.rb', line 15 def exec_start_time @thrift_task.execStartTime end |
#failed? ⇒ Boolean
27 28 29 |
# File 'lib/elephant-driver/task.rb', line 27 def failed? @thrift_task.failed end |
#progress ⇒ Object
23 24 25 |
# File 'lib/elephant-driver/task.rb', line 23 def progress @thrift_task.progress end |
#start_time ⇒ Object
11 12 13 |
# File 'lib/elephant-driver/task.rb', line 11 def start_time @thrift_task.startTime end |