Module: Fluent::Plugin::FeatureAvailabilityChecker

Defined in:
lib/fluent/plugin.rb

Instance Method Summary collapse

Instance Method Details

#configure(conf) ⇒ Object



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/fluent/plugin.rb', line 186

def configure(conf)
  super

  # extend plugin instance by this module
  # to run this check after all #configure methods of plugins and plugin helpers
  sysconf = if self.respond_to?(:owner) && owner.respond_to?(:system_config)
              owner.system_config
            elsif self.respond_to?(:system_config)
              self.system_config
            else
              nil
            end

  if sysconf && sysconf.workers > 1 && !self.multi_workers_ready?
    type = Fluent::Plugin.lookup_type_from_class(self.class)
    raise Fluent::ConfigError, "Plugin '#{type}' does not support multi workers configuration (#{self.class})"
  end
end