Class: Azkaban::JobFile
- Inherits:
-
Object
- Object
- Azkaban::JobFile
- Defined in:
- lib/azkaban-rb/tasks.rb
Direct Known Subclasses
Class Attribute Summary collapse
-
.output_dir ⇒ Object
Returns the value of attribute output_dir.
Instance Attribute Summary collapse
-
#read_locks ⇒ Object
readonly
Returns the value of attribute read_locks.
-
#task ⇒ Object
readonly
Returns the value of attribute task.
-
#uses ⇒ Object
readonly
Returns the value of attribute uses.
-
#write_locks ⇒ Object
readonly
Returns the value of attribute write_locks.
Instance Method Summary collapse
-
#initialize(task, ext) ⇒ JobFile
constructor
A new instance of JobFile.
- #reads(name, *options) ⇒ Object
- #set(params) ⇒ Object
- #write ⇒ Object
- #writes(name, *options) ⇒ Object
Constructor Details
#initialize(task, ext) ⇒ JobFile
Returns a new instance of JobFile.
70 71 72 73 74 75 76 77 |
# File 'lib/azkaban-rb/tasks.rb', line 70 def initialize(task, ext) task.job = self @task = task @ext = ext @args = {} @read_locks = [] @write_locks = [] end |
Class Attribute Details
.output_dir ⇒ Object
Returns the value of attribute output_dir.
80 81 82 |
# File 'lib/azkaban-rb/tasks.rb', line 80 def output_dir @output_dir end |
Instance Attribute Details
#read_locks ⇒ Object (readonly)
Returns the value of attribute read_locks.
66 67 68 |
# File 'lib/azkaban-rb/tasks.rb', line 66 def read_locks @read_locks end |
#task ⇒ Object (readonly)
Returns the value of attribute task.
66 67 68 |
# File 'lib/azkaban-rb/tasks.rb', line 66 def task @task end |
#uses ⇒ Object (readonly)
Returns the value of attribute uses.
66 67 68 |
# File 'lib/azkaban-rb/tasks.rb', line 66 def uses @uses end |
#write_locks ⇒ Object (readonly)
Returns the value of attribute write_locks.
66 67 68 |
# File 'lib/azkaban-rb/tasks.rb', line 66 def write_locks @write_locks end |
Instance Method Details
#reads(name, *options) ⇒ Object
89 90 91 92 |
# File 'lib/azkaban-rb/tasks.rb', line 89 def reads(name, *) @read_locks << name (, name) end |
#set(params) ⇒ Object
83 84 85 86 87 |
# File 'lib/azkaban-rb/tasks.rb', line 83 def set(params) params.each do |k,v| @args[k] = v end end |
#write ⇒ Object
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/azkaban-rb/tasks.rb', line 99 def write if @args.size > 0 file_name = @task.name.gsub(":", "-") + @ext if @task.prerequisites.size > 0 scope = @task.scope.map { |s| s.to_s }.join("-") @args["dependencies"] = @task.prerequisites.map{ |p| # look up the prerequisite in the scope of its task prereq_task = Rake.application.lookup(p, @task.scope) prereq_task.name.gsub(":", "-") }.join(",") end create_properties_file(file_name, @args) puts "Created #{file_name}" end end |
#writes(name, *options) ⇒ Object
94 95 96 97 |
# File 'lib/azkaban-rb/tasks.rb', line 94 def writes(name, *) @write_locks << name (, name) end |