Class: Fluent::MongoOutputReplset

Inherits:
MongoOutput
  • Object
show all
Defined in:
lib/fluent/plugin/out_mongo_replset.rb

Instance Attribute Summary

Attributes inherited from MongoOutput

#collection_options

Instance Method Summary collapse

Methods inherited from MongoOutput

#emit, #format, format_nocache, #initialize, #shutdown, #start, #write

Methods included from MongoUtil

#authenticate, included

Constructor Details

This class inherits a constructor from Fluent::MongoOutput

Instance Method Details

#configure(conf) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/fluent/plugin/out_mongo_replset.rb', line 20

def configure(conf)
  super

  @nodes = parse_nodes(conf['nodes'])
  if name = conf['name']
    @connection_options[:name] = conf['name']
  end
  if read = conf['read']
    @connection_options[:read] = read.to_sym
  end
  if refresh_mode = conf['refresh_mode']
    @connection_options[:refresh_mode] = refresh_mode.to_sym
  end
  if refresh_interval = conf['refresh_interval']
    @connection_options[:refresh_interval] = refresh_interval
  end

  $log.debug "Setup replica set configuration: nodes = #{conf['nodes']}"
end