Class/Module Index [+]

Quicksearch

Fluent::RoundRobinOutput

Attributes

outputs[R]
rand_seed[RW]
weights[R]

Public Class Methods

new() click to toggle source
# File lib/fluent/plugin/out_roundrobin.rb, line 21
def initialize
  super

  @outputs = []
  @weights = []
end

Public Instance Methods

configure(conf) click to toggle source
# File lib/fluent/plugin/out_roundrobin.rb, line 31
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

    weight = e['weight']
    weight = weight ? weight.to_i : 1
    log.debug "adding store type=#{type.dump}, weight=#{weight}"

    output = Plugin.new_output(type)
    output.router = router
    output.configure(e)
    @outputs << output
    @weights << weight
  }
  @rr = -1  # starts from @output[0]
  @rand_seed = Random.new.seed
end
emit(tag, es, chain) click to toggle source
# File lib/fluent/plugin/out_roundrobin.rb, line 70
def emit(tag, es, chain)
  next_output.emit(tag, es, chain)
end
shutdown() click to toggle source
# File lib/fluent/plugin/out_roundrobin.rb, line 64
def shutdown
  @outputs.each {|o|
    o.shutdown
  }
end
start() click to toggle source
# File lib/fluent/plugin/out_roundrobin.rb, line 56
def start
  rebuild_weight_array

  @outputs.each {|o|
    o.start
  }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.