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



80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/fluent/plugin/out_groonga.rb', line 80

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



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

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

#formatted_to_msgpack_binaryObject



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

def formatted_to_msgpack_binary
  true
end

#multi_workers_ready?Boolean

Returns:

  • (Boolean)


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

def multi_workers_ready?
  true
end

#shutdownObject



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

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

#startObject



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

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

#write(chunk) ⇒ Object



120
121
122
# File 'lib/fluent/plugin/out_groonga.rb', line 120

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