Class: HadoopDsl::LogAnalysis::LogAnalysisReducerModel

Inherits:
BaseReducerModel show all
Defined in:
lib/log_analysis.rb

Defined Under Namespace

Classes: Topic

Instance Attribute Summary collapse

Attributes inherited from BaseReducerModel

#key, #values

Attributes inherited from BaseModel

#controller

Instance Method Summary collapse

Methods included from DslElement

#method_missing

Constructor Details

#initialize(key, values) ⇒ LogAnalysisReducerModel

Returns a new instance of LogAnalysisReducerModel.



192
193
194
195
196
197
# File 'lib/log_analysis.rb', line 192

def initialize(key, values)
  super(key, values)
  if key =~ /(\w*)#{KEY_SEP}?(.*)/
    @topic = Topic.new($1, values)
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class HadoopDsl::DslElement

Instance Attribute Details

#current_topicObject (readonly)

Returns the value of attribute current_topic.



190
191
192
# File 'lib/log_analysis.rb', line 190

def current_topic
  @current_topic
end

#topicObject (readonly)

Returns the value of attribute topic.



190
191
192
# File 'lib/log_analysis.rb', line 190

def topic
  @topic
end

Instance Method Details

#create_topic(desc, options) ⇒ Object



199
200
201
# File 'lib/log_analysis.rb', line 199

def create_topic(desc, options)
  @current_topic = Topic.new(options[:label] || desc.gsub(/\s/, '_'), nil)
end