Class: AppEngine::MapReduce::Job
- Inherits:
-
Object
- Object
- AppEngine::MapReduce::Job
- Defined in:
- lib/appengine-mapreduce/job.rb
Instance Attribute Summary collapse
-
#input_class ⇒ Object
Returns the value of attribute input_class.
-
#input_kind ⇒ Object
Returns the value of attribute input_kind.
-
#map(&block) ⇒ Object
Returns the value of attribute map.
-
#output_kind ⇒ Object
Returns the value of attribute output_kind.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#reduce ⇒ Object
Returns the value of attribute reduce.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Job
constructor
A new instance of Job.
- #run ⇒ Object
- #use_blobstore_input_class ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Job
Returns a new instance of Job.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/appengine-mapreduce/job.rb', line 25 def initialize = {} @properties = {} %w(map reduce input_class input_kind output_kind).each do |attr_n| key = (attr_n.to_sym rescue attr_n) || attr_n self.send("#{attr_n}=", .delete(key)) if [key] end @properties["mapreduce.map.class"] = JRUBY_PROXY_MAPPER_CLASS end |
Instance Attribute Details
#input_class ⇒ Object
Returns the value of attribute input_class.
23 24 25 |
# File 'lib/appengine-mapreduce/job.rb', line 23 def input_class @input_class end |
#input_kind ⇒ Object
Returns the value of attribute input_kind.
23 24 25 |
# File 'lib/appengine-mapreduce/job.rb', line 23 def input_kind @input_kind end |
#map(&block) ⇒ Object
Returns the value of attribute map.
23 24 25 |
# File 'lib/appengine-mapreduce/job.rb', line 23 def map @map end |
#output_kind ⇒ Object
Returns the value of attribute output_kind.
23 24 25 |
# File 'lib/appengine-mapreduce/job.rb', line 23 def output_kind @output_kind end |
#properties ⇒ Object
Returns the value of attribute properties.
23 24 25 |
# File 'lib/appengine-mapreduce/job.rb', line 23 def properties @properties end |
#reduce ⇒ Object
Returns the value of attribute reduce.
23 24 25 |
# File 'lib/appengine-mapreduce/job.rb', line 23 def reduce @reduce end |
Class Method Details
Instance Method Details
#run ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/appengine-mapreduce/job.rb', line 37 def run queue = AppEngine::Labs::TaskQueue queue.add({:method => 'POST', :params => {'configuration' => conf_as_string}, :url => "/mapreduce/start"}) end |
#use_blobstore_input_class ⇒ Object
73 74 75 |
# File 'lib/appengine-mapreduce/job.rb', line 73 def use_blobstore_input_class self.input_class = BLOBSTORE_INPUT_FORMAT end |