Class: Fluent::Compat::Filter

Inherits:
Plugin::Filter show all
Defined in:
lib/fluent/compat/filter.rb

Constant Summary

Constants included from Fluent::Configurable

Fluent::Configurable::CONFIG_TYPE_REGISTRY

Instance Attribute Summary

Attributes inherited from Plugin::Filter

#has_filter_with_time

Attributes included from PluginLoggerMixin

#log

Attributes inherited from Plugin::Base

#under_plugin_development

Instance Method Summary collapse

Methods inherited from Plugin::Filter

#emit_records, #emit_size, #filter, #filter_stream, #filter_with_time, #measure_metrics, #statistics

Methods included from PluginHelper::Mixin

included

Methods included from PluginLoggerMixin

included, #terminate

Methods included from PluginId

#plugin_id, #plugin_id_configured?, #plugin_id_for_test?, #plugin_root_dir, #stop

Methods inherited from Plugin::Base

#acquire_worker_lock, #after_shutdown, #after_shutdown?, #after_start, #after_started?, #before_shutdown?, #called_in_test?, #close, #closed?, #configured?, #context_router, #context_router=, #fluentd_worker_id, #get_lock_path, #has_router?, #inspect, #multi_workers_ready?, #plugin_root_dir, #reloadable_plugin?, #shutdown?, #started?, #stop, #stopped?, #string_safe_encoding, #terminate, #terminated?

Methods included from SystemConfig::Mixin

#system_config, #system_config_override

Methods included from Fluent::Configurable

#config, #configure_proxy_generate, #configured_section_create, included, lookup_type, register_type

Constructor Details

#initializeFilter

Returns a new instance of Filter.



30
31
32
33
34
35
# File 'lib/fluent/compat/filter.rb', line 30

def initialize
  super
  unless self.class.ancestors.include?(Fluent::Compat::CallSuperMixin)
    self.class.prepend Fluent::Compat::CallSuperMixin
  end
end

Instance Method Details

#before_shutdownObject



59
60
61
# File 'lib/fluent/compat/filter.rb', line 59

def before_shutdown
  super
end

#configure(conf) ⇒ Object



37
38
39
40
41
42
# File 'lib/fluent/compat/filter.rb', line 37

def configure(conf)
  ParserUtils.convert_parser_conf(conf)
  FormatterUtils.convert_formatter_conf(conf)

  super
end

#shutdownObject



63
64
65
# File 'lib/fluent/compat/filter.rb', line 63

def shutdown
  super
end

#startObject

These definitions are to get instance methods of superclass of 3rd party plugins to make it sure to call super



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/fluent/compat/filter.rb', line 46

def start
  super

  if instance_variable_defined?(:@formatter) && @inject_config
    unless @formatter.class.ancestors.include?(Fluent::Compat::HandleTagAndTimeMixin)
      if @formatter.respond_to?(:owner) && !@formatter.owner
        @formatter.owner = self
        @formatter.singleton_class.prepend FormatterUtils::InjectMixin
      end
    end
  end
end