Class: Fluent::Plugin::DebugAgentInput

Inherits:
Input
  • Object
show all
Defined in:
lib/fluent/plugin/in_debug_agent.rb

Constant Summary

Constants included from Configurable

Configurable::CONFIG_TYPE_REGISTRY

Instance Attribute Summary

Attributes included from Fluent::PluginLoggerMixin

#log

Attributes inherited from Base

#under_plugin_development

Instance Method Summary collapse

Methods inherited from Input

#multi_workers_ready?

Methods included from Fluent::PluginHelper::Mixin

included

Methods included from Fluent::PluginLoggerMixin

included, #terminate

Methods included from Fluent::PluginId

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

Methods inherited from Base

#after_shutdown, #after_shutdown?, #after_start, #after_started?, #before_shutdown, #before_shutdown?, #close, #closed?, #configured?, #context_router, #context_router=, #fluentd_worker_id, #has_router?, #inspect, #multi_workers_ready?, #plugin_root_dir, #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

#initializeDebugAgentInput

Returns a new instance of DebugAgentInput.



23
24
25
26
27
# File 'lib/fluent/plugin/in_debug_agent.rb', line 23

def initialize
  require 'drb/drb'
  require 'fluent/plugin/file_util'
  super
end

Instance Method Details

#configure(conf) ⇒ Object



35
36
37
38
39
40
41
42
# File 'lib/fluent/plugin/in_debug_agent.rb', line 35

def configure(conf)
  super
  if @unix_path
    unless ::Fluent::FileUtil.writable?(@unix_path)
      raise Fluent::ConfigError, "in_debug_agent: `#{@unix_path}` is not writable"
    end
  end
end

#shutdownObject



58
59
60
61
62
# File 'lib/fluent/plugin/in_debug_agent.rb', line 58

def shutdown
  @server.stop_service if @server

  super
end

#startObject



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/fluent/plugin/in_debug_agent.rb', line 44

def start
  super

  if @unix_path
    require 'drb/unix'
    uri = "drbunix:#{@unix_path}"
  else
    uri = "druby://#{@bind}:#{@port}"
  end
  log.info "listening dRuby", uri: uri, object: @object
  obj = eval(@object)
  @server = DRb::DRbServer.new(uri, obj)
end