Class: Azkaban::PigJob

Inherits:
JobFile show all
Defined in:
lib/azkaban-rb/tasks.rb

Instance Attribute Summary collapse

Attributes inherited from JobFile

#read_locks, #task, #uses_arg, #write_locks

Instance Method Summary collapse

Methods inherited from JobFile

#[], #[]=, #reads, #set, #write, #writes

Constructor Details

#initialize(task, ext) ⇒ PigJob

Returns a new instance of PigJob.



150
151
152
153
154
# File 'lib/azkaban-rb/tasks.rb', line 150

def initialize(task, ext)
  super(task,ext)
  set "type"=>"pig"
  @parameters = {}
end

Instance Attribute Details

#parametersObject (readonly)

Returns the value of attribute parameters.



148
149
150
# File 'lib/azkaban-rb/tasks.rb', line 148

def parameters
  @parameters
end

Instance Method Details

#handle_read_write_options(options, name) ⇒ Object



161
162
163
164
165
166
167
168
# File 'lib/azkaban-rb/tasks.rb', line 161

def handle_read_write_options(options, name)
  options = options[0] if options.size > 0
  if options && options.instance_of?(Hash) && options[:as]
    # set the pig parameter
    set "param.#{options[:as]}" => name
    @parameters[options[:as]] = name
  end
end

#uses(name) ⇒ Object



156
157
158
159
# File 'lib/azkaban-rb/tasks.rb', line 156

def uses(name)
  @uses_arg = name
  set "pig.script"=>name
end