Sha256: 99875d02dbc5b8a7b771271952b96ac580122bd6151a0029775c1b68a819f78e

Contents?: true

Size: 661 Bytes

Versions: 13

Compression:

Stored size: 661 Bytes

Contents

module Mandy
  class HadoopJobFailure < StandardError
    attr_reader :output
    
    def initialize(job, output)
      @job, @output = job, output
    end
    
    def job_name
      @job.name
    end
    
    def tracking_url
      line = @output.split("\n").find {|line| line =~ /Tracking URL/ }
      return nil unless line
      line.split('Tracking URL: ').last
    end
    
    def hadoop_error
      @output
    end
    
    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
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mandy-0.5.28 lib/mandy/errors.rb
mandy-0.5.27 lib/mandy/errors.rb
mandy-0.5.26 lib/mandy/errors.rb
mandy-0.5.25 lib/mandy/errors.rb
mandy-0.5.24 lib/mandy/errors.rb
mandy-0.5.23 lib/mandy/errors.rb
mandy-0.5.22 lib/mandy/errors.rb
mandy-0.5.21 lib/mandy/errors.rb
mandy-0.5.20 lib/mandy/errors.rb
mandy-0.5.19 lib/mandy/errors.rb
mandy-0.5.17 lib/mandy/errors.rb
mandy-0.5.14 lib/mandy/errors.rb
mandy-0.5.13 lib/mandy/errors.rb