Exception: Mandy::HadoopJobFailure
- Inherits:
-
StandardError
- Object
- StandardError
- Mandy::HadoopJobFailure
- Defined in:
- lib/mandy/errors.rb
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #hadoop_error ⇒ Object
-
#initialize(job, output) ⇒ HadoopJobFailure
constructor
A new instance of HadoopJobFailure.
- #job_name ⇒ Object
- #to_s ⇒ Object
- #tracking_url ⇒ Object
Constructor Details
#initialize(job, output) ⇒ HadoopJobFailure
Returns a new instance of HadoopJobFailure.
5 6 7 |
# File 'lib/mandy/errors.rb', line 5 def initialize(job, output) @job, @output = job, output end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
3 4 5 |
# File 'lib/mandy/errors.rb', line 3 def output @output end |
Instance Method Details
#hadoop_error ⇒ Object
19 20 21 |
# File 'lib/mandy/errors.rb', line 19 def hadoop_error @output end |
#job_name ⇒ Object
9 10 11 |
# File 'lib/mandy/errors.rb', line 9 def job_name @job.name end |
#to_s ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/mandy/errors.rb', line 23 def to_s output = [] output << %(Mandy Job Name: #{job_name}) output << %(Hadoop ERROR: #{hadoop_error}) output << %(Tracking URL: #{tracking_url}) if tracking_url output*"\n" end |
#tracking_url ⇒ Object
13 14 15 16 17 |
# File 'lib/mandy/errors.rb', line 13 def tracking_url line = @output.split("\n").find {|line| line =~ /Tracking URL/ } return nil unless line line.split('Tracking URL: ').last end |