Module: Fluent::Plugin::TailInput::Compatibility

Included in:
Fluent::Plugin::TailInput
Defined in:
lib/fluent/plugin/in_tail/compatibility.rb

Instance Method Summary collapse

Instance Method Details

#convert_line_to_event(line, es, tail_watcher) ⇒ Object



44
45
46
# File 'lib/fluent/plugin/in_tail/compatibility.rb', line 44

def convert_line_to_event(line, es, tail_watcher)
  @line_feeder.convert_line_to_event(line, es, tail_watcher)
end

#flush_buffer(tw, buf) ⇒ Object

Keep these methods as compatibility entry points for plugins which inherit TailInput and override line processing methods. TailInput is a built-in plugin, not a public inheritance API, and these methods may be removed in a future release.



27
28
29
# File 'lib/fluent/plugin/in_tail/compatibility.rb', line 27

def flush_buffer(tw, buf)
  @line_feeder.flush_buffer(tw, buf)
end

#parse_multilines(lines, tail_watcher) ⇒ Object

TailInput's default #parse_multilines path starts the flush timer before parsing. An override that skips super must call tail_watcher.line_buffer_timer_flusher.reset_timer when needed.



55
56
57
# File 'lib/fluent/plugin/in_tail/compatibility.rb', line 55

def parse_multilines(lines, tail_watcher)
  @line_feeder.parse_multilines(lines, tail_watcher)
end

#parse_singleline(lines, tail_watcher) ⇒ Object



48
49
50
# File 'lib/fluent/plugin/in_tail/compatibility.rb', line 48

def parse_singleline(lines, tail_watcher)
  @line_feeder.parse_singleline(lines, tail_watcher)
end

#receive_lines(lines, tail_watcher) ⇒ Object

Feeds lines through the per-file feed, or through LineFeeder for watchers created by plugins using the deprecated LineBufferTimerFlusher.

Returns:

  • true if no error or unrecoverable error happens in emit action. false if got BufferOverflowError



35
36
37
38
39
40
41
42
# File 'lib/fluent/plugin/in_tail/compatibility.rb', line 35

def receive_lines(lines, tail_watcher)
  return async_receive_lines(lines, tail_watcher) if @worker_pool

  file_feed = tail_watcher.file_feed
  return file_feed.feed_lines(lines, tail_watcher) if file_feed.respond_to?(:feed_lines)

  @line_feeder.feed_lines(lines, tail_watcher)
end