Sha256: 377dda2278c5a44a7ed0493b986be930fdba674cce9c061fc9f6f5a84e810465

Contents?: true

Size: 495 Bytes

Versions: 36

Compression:

Stored size: 495 Bytes

Contents

# encoding: utf-8
module LogStash
  module Outputs
    class S3
      class SizeRotationPolicy
        attr_reader :size_file

        def initialize(size_file)
          if size_file <= 0
            raise LogStash::ConfigurationError, "`size_file` need to be greather than 0"
          end

          @size_file = size_file
        end

        def rotate?(file)
          file.size >= size_file
        end

        def needs_periodic?
          false
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
logstash-output-s3-4.1.2 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.1.1 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.1.0 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.0.13 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.0.12 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.0.11 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.0.10 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.0.9 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.0.8 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.0.7 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.0.6 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.0.5 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.0.3 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.0.2 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.0.1 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.0.0 lib/logstash/outputs/s3/size_rotation_policy.rb