Skip to content

Commit

Permalink
Compatibility layers for v0.12 plugins (#912)
Browse files Browse the repository at this point in the history
* Add Base#inspect to show this object in simple/short way

* add fluent/compat/filter and make Fluent::Filter with it

* add fluent/compat/input and make Fluent::Input with it

* add comments about time handling

* fix to extend chunk to add method for event iteration

* fix test with added (missing) error definition

* remove fileutils

* add optimization

* take care about NaN & Inf

* add buffer path pattern only for suffix

* initialize minimal internal things as early as possible for tests

* Add compatibility layers for output plugin
* change internal APIs to emit events to plugins/routers with newer one
* remove all output chains from cores

* fix tests for core modules/classes with newer API

* fix to use test driver for buffered output

* re-implement symlink_path feature on v0.14 buffer APIs

* add break condition to wait checks to run

* update comments for correctness

* add deprecation warning for "type" in secondary section

* fix to use more explicit name

* fix tests for exponential_backoff

* for readability

* remove/merge dup code
  • Loading branch information
tagomoris committed May 17, 2016
1 parent 483e46f commit 719dff4
Show file tree
Hide file tree
Showing 28 changed files with 948 additions and 855 deletions.
2 changes: 1 addition & 1 deletion lib/fluent/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def initialize(log)
@count = 0
end

def emit(tag, es, chain)
def emit_events(tag, es)
# TODO use time instead of num of records
c = (@count += 1)
if c < 512
Expand Down
26 changes: 26 additions & 0 deletions lib/fluent/compat/filter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Fluentd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require 'fluent/plugin'
require 'fluent/plugin/filter'

module Fluent
module Compat
class Filter < Fluent::Plugin::Filter
# TODO: warn when deprecated
end
end
end
26 changes: 26 additions & 0 deletions lib/fluent/compat/input.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Fluentd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require 'fluent/plugin'
require 'fluent/plugin/input'

module Fluent
module Compat
class Input < Fluent::Plugin::Input
# TODO: warn when deprecated
end
end
end
Loading

0 comments on commit 719dff4

Please sign in to comment.