Sha256: 6a114f50c795c53f2b1330c3f19eb769287fa5bffca5a408eb570411314a3139

Contents?: true

Size: 1.5 KB

Versions: 15

Compression:

Stored size: 1.5 KB

Contents

#
# 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/output'

module Fluent::Plugin
  class NullOutput < Output
    # This plugin is for tests of non-buffered/buffered plugins
    Fluent::Plugin.register_output('null', self)

    config_section :buffer do
      config_set_default :chunk_keys, ['tag']
      config_set_default :flush_at_shutdown, true
      config_set_default :chunk_limit_size, 10 * 1024
    end

    def prefer_buffered_processing
      false
    end

    def prefer_delayed_commit
      @delayed
    end

    attr_accessor :feed_proc, :delayed

    def initialize
      super
      @delayed = false
      @feed_proc = nil
    end

    def process(tag, es)
      # Do nothing
    end

    def write(chunk)
      if @feed_proc
        @feed_proc.call(chunk)
      end
    end

    def try_write(chunk)
      if @feed_proc
        @feed_proc.call(chunk)
      end
      # not to commit chunks for testing
      # commit_write(chunk.unique_id)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
fluentd-0.14.11-x64-mingw32 lib/fluent/plugin/out_null.rb
fluentd-0.14.11-x86-mingw32 lib/fluent/plugin/out_null.rb
fluentd-0.14.11 lib/fluent/plugin/out_null.rb
fluentd-0.14.10-x64-mingw32 lib/fluent/plugin/out_null.rb
fluentd-0.14.10-x86-mingw32 lib/fluent/plugin/out_null.rb
fluentd-0.14.10 lib/fluent/plugin/out_null.rb
fluentd-0.14.9 lib/fluent/plugin/out_null.rb
fluentd-0.14.8 lib/fluent/plugin/out_null.rb
fluentd-0.14.7-x64-mingw32 lib/fluent/plugin/out_null.rb
fluentd-0.14.7-x86-mingw32 lib/fluent/plugin/out_null.rb
fluentd-0.14.7 lib/fluent/plugin/out_null.rb
fluentd-0.14.6 lib/fluent/plugin/out_null.rb
fluentd-0.14.5-x64-mingw32 lib/fluent/plugin/out_null.rb
fluentd-0.14.5-x86-mingw32 lib/fluent/plugin/out_null.rb
fluentd-0.14.5 lib/fluent/plugin/out_null.rb