Class: Elasticrawl::Job
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Elasticrawl::Job
- Defined in:
- lib/elasticrawl/job.rb
Overview
The base job class that is extended by ParseJob and CombineJob.
Direct Known Subclasses
Instance Method Summary collapse
-
#confirm_message ⇒ Object
Displays a confirmation message showing the configuration of the Elastic MapReduce job flow and cluster.
-
#history ⇒ Object
Displays the history of the current job.
-
#result_message ⇒ Object
Displays the Job Name and Elastic MapReduce Job Flow ID if the job was launched successfully.
Instance Method Details
#confirm_message ⇒ Object
Displays a confirmation message showing the configuration of the Elastic MapReduce job flow and cluster.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/elasticrawl/job.rb', line 8 def cluster = Cluster.new case self.type when 'Elasticrawl::ParseJob' = segment_list else = [] end .push('Job configuration') .push(self.job_desc) .push('') .push(cluster.cluster_desc) .join("\n") end |
#history ⇒ Object
Displays the history of the current job. Called by the status command.
33 34 35 36 |
# File 'lib/elasticrawl/job.rb', line 33 def history launch_time = "Launched: #{self.created_at.strftime('%Y-%m-%d %H:%M:%S')}" "#{self.job_name} #{launch_time} #{self.job_desc}" end |
#result_message ⇒ Object
Displays the Job Name and Elastic MapReduce Job Flow ID if the job was launched successfully.
28 29 30 |
# File 'lib/elasticrawl/job.rb', line 28 def "\nJob: #{self.job_name} Job Flow ID: #{self.job_flow_id}" end |