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.
605 606 607 |
# File 'lib/fluent/plugin/out_groonga.rb', line 605 def initialize super end |
Instance Method Details
#configure(conf) ⇒ Object
609 610 611 |
# File 'lib/fluent/plugin/out_groonga.rb', line 609 def configure(conf) super end |
#execute(name, arguments = {}) ⇒ Object
625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 |
# File 'lib/fluent/plugin/out_groonga.rb', line 625 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
617 618 619 620 621 622 623 |
# File 'lib/fluent/plugin/out_groonga.rb', line 617 def shutdown @input.close read_output("shutdown") @output.close @error.close Process.waitpid(@pid) end |
#start ⇒ Object
613 614 615 |
# File 'lib/fluent/plugin/out_groonga.rb', line 613 def start run_groonga end |