Class: Fluent::Plugin::RoundRobinOutput
- Inherits:
-
MultiOutput
- Object
- Base
- MultiOutput
- Fluent::Plugin::RoundRobinOutput
- Defined in:
- lib/fluent/plugin/out_roundrobin.rb
Constant Summary
Constants included from Configurable
Configurable::CONFIG_TYPE_REGISTRY
Instance Attribute Summary collapse
-
#weights ⇒ Object
readonly
Returns the value of attribute weights.
Attributes inherited from MultiOutput
#outputs, #outputs_statically_created
Attributes included from Fluent::PluginLoggerMixin
Attributes inherited from Base
Instance Method Summary collapse
- #configure(conf) ⇒ Object
-
#initialize ⇒ RoundRobinOutput
constructor
A new instance of RoundRobinOutput.
- #multi_workers_ready? ⇒ Boolean
- #process(tag, es) ⇒ Object
- #start ⇒ Object
Methods inherited from MultiOutput
#after_shutdown, #after_start, #before_shutdown, #call_lifecycle_method, #close, #emit_count, #emit_records, #emit_size, #emit_sync, #multi_output?, #num_errors, #shutdown, #static_outputs, #statistics, #stop, #terminate
Methods included from Fluent::PluginHelper::Mixin
Methods included from Fluent::PluginLoggerMixin
Methods included from Fluent::PluginId
#plugin_id, #plugin_id_configured?, #plugin_id_for_test?, #plugin_root_dir, #stop
Methods inherited from Base
#acquire_worker_lock, #after_shutdown, #after_shutdown?, #after_start, #after_started?, #before_shutdown, #before_shutdown?, #called_in_test?, #close, #closed?, #configured?, #context_router, #context_router=, #fluentd_worker_id, #get_lock_path, #has_router?, #inspect, #plugin_root_dir, #reloadable_plugin?, #shutdown, #shutdown?, #started?, #stop, #stopped?, #string_safe_encoding, #terminate, #terminated?
Methods included from SystemConfig::Mixin
#system_config, #system_config_override
Methods included from Configurable
#config, #configure_proxy_generate, #configured_section_create, included, lookup_type, register_type
Constructor Details
#initialize ⇒ RoundRobinOutput
Returns a new instance of RoundRobinOutput.
28 29 30 31 |
# File 'lib/fluent/plugin/out_roundrobin.rb', line 28 def initialize super @weights = [] end |
Instance Attribute Details
#weights ⇒ Object (readonly)
Returns the value of attribute weights.
33 34 35 |
# File 'lib/fluent/plugin/out_roundrobin.rb', line 33 def weights @weights end |
Instance Method Details
#configure(conf) ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/fluent/plugin/out_roundrobin.rb', line 35 def configure(conf) super @stores.each do |store| @weights << store.weight end @rr = -1 # starts from @output[0] @rand_seed = Random.new.seed end |
#multi_workers_ready? ⇒ Boolean
45 46 47 |
# File 'lib/fluent/plugin/out_roundrobin.rb', line 45 def multi_workers_ready? true end |
#process(tag, es) ⇒ Object
54 55 56 |
# File 'lib/fluent/plugin/out_roundrobin.rb', line 54 def process(tag, es) next_output.emit_events(tag, es) end |
#start ⇒ Object
49 50 51 52 |
# File 'lib/fluent/plugin/out_roundrobin.rb', line 49 def start super rebuild_weight_array end |