Class: Rubydoop::Context
- Inherits:
-
Object
- Object
- Rubydoop::Context
- Defined in:
- lib/rubydoop/dsl.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#jobs ⇒ Object
readonly
Returns the value of attribute jobs.
Instance Method Summary collapse
- #create_job(name) ⇒ Object
-
#initialize(conf, proxy_classes, arguments) ⇒ Context
constructor
A new instance of Context.
- #proxy_class(type) ⇒ Object
Constructor Details
#initialize(conf, proxy_classes, arguments) ⇒ Context
Returns a new instance of Context.
348 349 350 351 352 353 |
# File 'lib/rubydoop/dsl.rb', line 348 def initialize(conf, proxy_classes, arguments) @conf = conf @proxy_classes = proxy_classes @arguments = arguments.to_a @jobs = [] end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
346 347 348 |
# File 'lib/rubydoop/dsl.rb', line 346 def arguments @arguments end |
#jobs ⇒ Object (readonly)
Returns the value of attribute jobs.
346 347 348 |
# File 'lib/rubydoop/dsl.rb', line 346 def jobs @jobs end |
Instance Method Details
#create_job(name) ⇒ Object
355 356 357 358 359 |
# File 'lib/rubydoop/dsl.rb', line 355 def create_job(name) hadoop_job = Hadoop::Mapreduce::Job.new(@conf, name) @jobs << hadoop_job hadoop_job end |
#proxy_class(type) ⇒ Object
361 362 363 |
# File 'lib/rubydoop/dsl.rb', line 361 def proxy_class(type) @proxy_classes[type.to_s] end |