Class: Fluent::Plugin::GroongaOutput

Inherits:
Output
  • 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.



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

def initialize
  super
end

Instance Method Details

#configure(conf) ⇒ Object



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

def configure(conf)
  compat_parameters_convert(conf, :buffer)
  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



107
108
109
# File 'lib/fluent/plugin/out_groonga.rb', line 107

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

#formatted_to_msgpack_binary?Boolean

Returns:

  • (Boolean)


111
112
113
# File 'lib/fluent/plugin/out_groonga.rb', line 111

def formatted_to_msgpack_binary?
  true
end

#multi_workers_ready?Boolean

Returns:

  • (Boolean)


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

def multi_workers_ready?
  true
end

#shutdownObject



97
98
99
100
101
# File 'lib/fluent/plugin/out_groonga.rb', line 97

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

#startObject



89
90
91
92
93
94
95
# File 'lib/fluent/plugin/out_groonga.rb', line 89

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

#write(chunk) ⇒ Object



115
116
117
# File 'lib/fluent/plugin/out_groonga.rb', line 115

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