Class: Fluent::GroongaOutput

Inherits:
BufferedOutput
  • Object
show all
Defined in:
lib/fluent/plugin/out_groonga.rb

Defined Under Namespace

Modules: DefinitionParseMethods Classes: BaseClient, CommandClient, Emitter, NetworkClient, Schema, TableDefinition, TablesCreator

Instance Method Summary collapse

Constructor Details

#initializeGroongaOutput

Returns a new instance of GroongaOutput.



29
30
31
# File 'lib/fluent/plugin/out_groonga.rb', line 29

def initialize
  super
end

Instance Method Details

#configure(conf) ⇒ Object



73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/fluent/plugin/out_groonga.rb', line 73

def configure(conf)
  super
  @client = create_client(@protocol)
  @client.configure(conf)

  @schema = Schema.new(@client, @store_table, @mappings)
  @emitter = Emitter.new(@client, @store_table, @schema)

  @tables = @tables.collect do |table|
    TableDefinition.new(table)
  end
end

#format(tag, time, record) ⇒ Object



100
101
102
# File 'lib/fluent/plugin/out_groonga.rb', line 100

def format(tag, time, record)
  [tag, time, record].to_msgpack
end

#shutdownObject



94
95
96
97
98
# File 'lib/fluent/plugin/out_groonga.rb', line 94

def shutdown
  super
  @emitter.shutdown
  @client.shutdown
end

#startObject



86
87
88
89
90
91
92
# File 'lib/fluent/plugin/out_groonga.rb', line 86

def start
  super
  @client.start
  @emitter.start
  tables_creator = TablesCreator.new(@client, @tables)
  tables_creator.create
end

#write(chunk) ⇒ Object



104
105
106
# File 'lib/fluent/plugin/out_groonga.rb', line 104

def write(chunk)
  @emitter.emit(chunk)
end