Class: Rubydoop::Context
- Inherits:
-
Object
- Object
- Rubydoop::Context
- Defined in:
- lib/rubydoop/dsl.rb
Defined Under Namespace
Classes: Jobs
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
Instance Method Summary collapse
- #create_job(name) ⇒ Object
-
#initialize(conf, arguments) ⇒ Context
constructor
A new instance of Context.
- #parallel ⇒ Object
- #pop ⇒ Object
- #push(job_list) ⇒ Object
- #sequence ⇒ Object
- #wait_for_completion(verbose) ⇒ Object
Constructor Details
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
374 375 376 |
# File 'lib/rubydoop/dsl.rb', line 374 def arguments @arguments end |
Instance Method Details
#create_job(name) ⇒ Object
382 383 384 385 386 |
# File 'lib/rubydoop/dsl.rb', line 382 def create_job(name) hadoop_job = Hadoop::Mapreduce::Job.new(@conf, name) @job_stack.last.add(hadoop_job) hadoop_job end |
#parallel ⇒ Object
392 393 394 395 396 397 398 |
# File 'lib/rubydoop/dsl.rb', line 392 def parallel push(Jobs::Parallel.new) if block_given? yield pop end end |
#pop ⇒ Object
413 414 415 |
# File 'lib/rubydoop/dsl.rb', line 413 def pop @job_stack.pop end |
#push(job_list) ⇒ Object
408 409 410 411 |
# File 'lib/rubydoop/dsl.rb', line 408 def push(job_list) @job_stack.last.add(job_list) @job_stack.push(job_list) end |
#sequence ⇒ Object
400 401 402 403 404 405 406 |
# File 'lib/rubydoop/dsl.rb', line 400 def sequence push(Jobs::Sequence.new) if block_given? yield pop end end |
#wait_for_completion(verbose) ⇒ Object
388 389 390 |
# File 'lib/rubydoop/dsl.rb', line 388 def wait_for_completion(verbose) @job_stack.first.wait_for_completion(verbose) end |