Class: Fluent::GroongaOutput::CommandClient

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

Instance Method Summary (collapse)

Constructor Details

- (CommandClient) initialize

Returns a new instance of CommandClient



368
369
370
# File 'lib/fluent/plugin/out_groonga.rb', line 368

def initialize
  super
end

Instance Method Details

- (Object) configure(conf)



372
373
374
# File 'lib/fluent/plugin/out_groonga.rb', line 372

def configure(conf)
  super
end

- (Object) execute(name, arguments = {})



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/fluent/plugin/out_groonga.rb', line 388

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

- (Object) shutdown



380
381
382
383
384
385
386
# File 'lib/fluent/plugin/out_groonga.rb', line 380

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

- (Object) start



376
377
378
# File 'lib/fluent/plugin/out_groonga.rb', line 376

def start
  run_groonga
end