Class: Fluent::NorikraInput

Inherits:
Input
  • Object
show all
Includes:
Fluent::NorikraPlugin::InputMixin
Defined in:
lib/fluent/plugin/in_norikra.rb

Instance Method Summary collapse

Methods included from Fluent::NorikraPlugin::InputMixin

#fetch_worker, #insert_fetch_queue, #setup_input, #shutdown_input, #start_input, #stop_input

Instance Method Details

#client(opts = {}) ⇒ Object



59
60
61
62
63
64
65
# File 'lib/fluent/plugin/in_norikra.rb', line 59

def client(opts={})
  Norikra::Client.new(@host, @port, {
      :connect_timeout => opts[:connect_timeout] || @connect_timeout,
      :send_timeout    => opts[:send_timeout]    || @send_timeout,
      :receive_timeout => opts[:receive_timeout] || @receive_timeout,
    })
end

#configure(conf) ⇒ Object



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

def configure(conf)
  super

  @host,@port = @norikra.split(':', 2)
  @port = @port.to_i

  conf.elements.each do |element|
    case element.name
    when 'fetch'
      # ignore: processed in InputMixin, and set @fetch_queue
    else
      raise Fluent::ConfigError, "unknown configuration section name for this plugin: #{element.name}"
    end
  end

  setup_input(conf)
end

#fetchable?Boolean

Returns:

  • (Boolean)


77
78
79
# File 'lib/fluent/plugin/in_norikra.rb', line 77

def fetchable?
  true
end

#shutdownObject



72
73
74
75
# File 'lib/fluent/plugin/in_norikra.rb', line 72

def shutdown
  stop_input
  shutdown_input
end

#startObject



67
68
69
70
# File 'lib/fluent/plugin/in_norikra.rb', line 67

def start
  super
  start_input
end