Class: Fluent::Plugin::GroongaOutput::CommandClient
- Inherits:
-
BaseClient
- Object
- BaseClient
- Fluent::Plugin::GroongaOutput::CommandClient
- Includes:
- Configurable
- Defined in:
- lib/fluent/plugin/out_groonga.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #execute(name, arguments = {}) ⇒ Object
-
#initialize(output_plugin) ⇒ CommandClient
constructor
A new instance of CommandClient.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(output_plugin) ⇒ CommandClient
Returns a new instance of CommandClient.
679 680 681 682 |
# File 'lib/fluent/plugin/out_groonga.rb', line 679 def initialize(output_plugin) super() @output_plugin = output_plugin end |
Instance Method Details
#configure(conf) ⇒ Object
684 685 686 |
# File 'lib/fluent/plugin/out_groonga.rb', line 684 def configure(conf) super end |
#execute(name, arguments = {}) ⇒ Object
700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 |
# File 'lib/fluent/plugin/out_groonga.rb', line 700 def execute(name, arguments={}) command = build_command(name, arguments) body = nil if command.name == "load" body = command.arguments.delete(:values) end uri = command.to_uri_format @input.write("#{uri}\n") if body body.each_line do |line| @input.write("#{line}\n") end end @input.flush read_output(uri) end |
#shutdown ⇒ Object
692 693 694 695 696 697 698 |
# File 'lib/fluent/plugin/out_groonga.rb', line 692 def shutdown @input.close read_output("shutdown") @output.close @error.close Process.waitpid(@pid) end |
#start ⇒ Object
688 689 690 |
# File 'lib/fluent/plugin/out_groonga.rb', line 688 def start run_groonga end |