Class: Fluent::GroongaOutput::CommandClient
- Inherits:
-
BaseClient
- Object
- BaseClient
- Fluent::GroongaOutput::CommandClient
- Includes:
- Configurable
- Defined in:
- lib/fluent/plugin/out_groonga.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #execute(name, arguments = {}) ⇒ Object
-
#initialize ⇒ CommandClient
constructor
A new instance of CommandClient.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ CommandClient
Returns a new instance of CommandClient.
651 652 653 |
# File 'lib/fluent/plugin/out_groonga.rb', line 651 def initialize super end |
Instance Method Details
#configure(conf) ⇒ Object
655 656 657 |
# File 'lib/fluent/plugin/out_groonga.rb', line 655 def configure(conf) super end |
#execute(name, arguments = {}) ⇒ Object
671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 |
# File 'lib/fluent/plugin/out_groonga.rb', line 671 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
663 664 665 666 667 668 669 |
# File 'lib/fluent/plugin/out_groonga.rb', line 663 def shutdown @input.close read_output("shutdown") @output.close @error.close Process.waitpid(@pid) end |
#start ⇒ Object
659 660 661 |
# File 'lib/fluent/plugin/out_groonga.rb', line 659 def start run_groonga end |