Class: Fluent::EventRouter::Pipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/event_router.rb

Defined Under Namespace

Classes: FilterOptimizer, OutputError

Instance Method Summary collapse

Constructor Details

#initializePipeline

Returns a new instance of Pipeline.



177
178
179
180
181
# File 'lib/fluent/event_router.rb', line 177

def initialize
  @filters = []
  @output = nil
  @optimizer = FilterOptimizer.new
end

Instance Method Details

#add_filter(filter) ⇒ Object



183
184
185
186
# File 'lib/fluent/event_router.rb', line 183

def add_filter(filter)
  @filters << filter
  @optimizer.filters = @filters
end

#emit_events(tag, es) ⇒ Object



192
193
194
195
196
197
198
199
200
# File 'lib/fluent/event_router.rb', line 192

def emit_events(tag, es)
  processed = @optimizer.filter_stream(tag, es)

  begin
    @output.emit_events(tag, processed)
  rescue => e
    raise OutputError.new(e, processed)
  end
end

#set_output(output) ⇒ Object



188
189
190
# File 'lib/fluent/event_router.rb', line 188

def set_output(output)
  @output = output
end