class Fluent::CopyOutput

Attributes

outputs[R]

Public Class Methods

new() click to toggle source
Calls superclass method Fluent::Output.new
# File lib/fluent/plugin/out_copy.rb, line 28
def initialize
  super
  @outputs = []
end

Public Instance Methods

configure(conf) click to toggle source
Calls superclass method Fluent::Output#configure
# File lib/fluent/plugin/out_copy.rb, line 35
def configure(conf)
  super
  conf.elements.select {|e|
    e.name == 'store'
  }.each {|e|
    type = e['@type'] || e['type']
    unless type
      raise ConfigError, "Missing 'type' parameter on <store> directive"
    end
    log.debug "adding store type=#{type.dump}"

    output = Plugin.new_output(type)
    output.router = router
    output.configure(e)
    @outputs << output
  }
end
emit(tag, es, chain) click to toggle source
# File lib/fluent/plugin/out_copy.rb, line 65
def emit(tag, es, chain)
  unless es.repeatable?
    m = MultiEventStream.new
    es.each {|time,record|
      m.add(time, record)
    }
    es = m
  end
  if @deep_copy
    chain = CopyOutputChain.new(@outputs, tag, es, chain)
  else
    chain = OutputChain.new(@outputs, tag, es, chain)
  end
  chain.next
end
shutdown() click to toggle source
# File lib/fluent/plugin/out_copy.rb, line 59
def shutdown
  @outputs.each {|o|
    o.shutdown
  }
end
start() click to toggle source
# File lib/fluent/plugin/out_copy.rb, line 53
def start
  @outputs.each {|o|
    o.start
  }
end