Class: Fluent::GroongaOutput::CommandClient

Inherits:
BaseClient
  • Object
show all
Includes:
Configurable
Defined in:
lib/fluent/plugin/out_groonga.rb

Instance Method Summary collapse

Constructor Details

#initializeCommandClient

Returns a new instance of CommandClient.



669
670
671
# File 'lib/fluent/plugin/out_groonga.rb', line 669

def initialize
  super
end

Instance Method Details

#configure(conf) ⇒ Object



673
674
675
# File 'lib/fluent/plugin/out_groonga.rb', line 673

def configure(conf)
  super
end

#execute(name, arguments = {}) ⇒ Object



689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
# File 'lib/fluent/plugin/out_groonga.rb', line 689

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

#shutdownObject



681
682
683
684
685
686
687
# File 'lib/fluent/plugin/out_groonga.rb', line 681

def shutdown
  @input.close
  read_output("shutdown")
  @output.close
  @error.close
  Process.waitpid(@pid)
end

#startObject



677
678
679
# File 'lib/fluent/plugin/out_groonga.rb', line 677

def start
  run_groonga
end