Method: Fluent::Plugin::Output#initialize

Defined in:
lib/fluent/plugin/output.rb

#initializeOutput

Returns a new instance of Output.



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/fluent/plugin/output.rb', line 198

def initialize
  super
  @counter_mutex = Mutex.new
  @flush_thread_mutex = Mutex.new
  @buffering = false
  @delayed_commit = false
  @as_secondary = false
  @primary_instance = nil

  # TODO: well organized counters
  @num_errors_metrics = nil
  @emit_count_metrics = nil
  @emit_records_metrics = nil
  @emit_size_metrics = nil
  @write_count_metrics = nil
  @rollback_count_metrics = nil
  @flush_time_count_metrics = nil
  @slow_flush_count_metrics = nil
  @enable_size_metrics = false

  # How to process events is decided here at once, but it will be decided in delayed way on #configure & #start
  if implement?(:synchronous)
    if implement?(:buffered) || implement?(:delayed_commit)
      @buffering = nil # do #configure or #start to determine this for full-featured plugins
    else
      @buffering = false
    end
  else
    @buffering = true
  end
  @custom_format = implement?(:custom_format)
  @enable_msgpack_streamer = false # decided later

  @buffer = nil
  @secondary = nil
  @retry = nil
  @dequeued_chunks = nil
  @dequeued_chunks_mutex = nil
  @output_enqueue_thread = nil
  @output_flush_threads = nil
  @output_flush_thread_current_position = 0

  @simple_chunking = nil
  @chunk_keys = @chunk_key_accessors = @chunk_key_time = @chunk_key_tag = nil
  @flush_mode = nil
  @timekey_zone = nil

  @retry_for_error_chunk = false
end