Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility layers for v0.12 plugins #912

Merged
merged 22 commits into from
May 17, 2016
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0c50578
fix test with added (missing) error definition
tagomoris Apr 27, 2016
51a1a24
Add Base#inspect to show this object in simple/short way
tagomoris Apr 21, 2016
e5769f7
add fluent/compat/filter and make Fluent::Filter with it
tagomoris Apr 21, 2016
a1d6754
add fluent/compat/input and make Fluent::Input with it
tagomoris Apr 21, 2016
bf3dbcc
add comments about time handling
tagomoris Apr 25, 2016
d5e90de
fix to extend chunk to add method for event iteration
tagomoris Apr 25, 2016
9714328
remove fileutils
tagomoris Apr 27, 2016
d096726
add optimization
tagomoris Apr 27, 2016
8c07b0c
take care about NaN & Inf
tagomoris Apr 27, 2016
0688ba0
add buffer path pattern only for suffix
tagomoris Apr 27, 2016
a5a6b98
initialize minimal internal things as early as possible for tests
tagomoris Apr 27, 2016
5e93092
Add compatibility layers for output plugin
tagomoris Apr 27, 2016
33264de
fix tests for core modules/classes with newer API
tagomoris Apr 27, 2016
a52e4d1
fix to use test driver for buffered output
tagomoris Apr 27, 2016
b70b508
re-implement symlink_path feature on v0.14 buffer APIs
tagomoris Apr 27, 2016
fc2c76d
add break condition to wait checks to run
tagomoris Apr 28, 2016
903f4c2
update comments for correctness
tagomoris May 9, 2016
403cf5f
add deprecation warning for "type" in secondary section
tagomoris May 9, 2016
e0afba5
fix to use more explicit name
tagomoris May 9, 2016
dc9fe04
fix tests for exponential_backoff
tagomoris May 9, 2016
0785ec5
for readability
tagomoris May 9, 2016
a424505
remove/merge dup code
tagomoris May 9, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
initialize minimal internal things as early as possible for tests
  • Loading branch information
tagomoris committed May 13, 2016
commit a5a6b983d9cbc8c0245ec78f52c3dc02c86af7fe
29 changes: 21 additions & 8 deletions lib/fluent/plugin/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,30 @@ def expired?

def initialize
super
@counters_monitor = Monitor.new
@buffering = false
@delayed_commit = false
@as_secondary = false
@primary_instance = nil

# TODO: well organized counters
@num_errors = 0
@emit_count = 0
@emit_records = 0
@write_count = 0
@rollback_count = 0

# 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)
end

def acts_as_secondary(primary)
Expand Down Expand Up @@ -268,13 +288,6 @@ def configure(conf)

def start
super
# TODO: well organized counters
@counters_monitor = Monitor.new
@num_errors = 0
@emit_count = 0
@emit_records = 0
@write_count = 0
@rollback_count = 0

if @buffering.nil?
@buffering = prefer_buffered_processing
Expand All @@ -296,7 +309,7 @@ def start
implement?(:delayed_commit)
end
@delayed_commit_timeout = @buffer_config.delayed_commit_timeout
else # !@buffered
else # !@buffering
m = method(:emit_sync)
(class << self; self; end).module_eval do
define_method(:emit, m)
Expand Down