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-integration-aws-7.0.1 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-integration-aws-7.0.0 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.3.7 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.3.6 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-integration-aws-0.1.0.pre lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.3.5 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.3.4 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.3.3 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.3.2 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.3.1 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.3.0 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.2.0 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.1.10 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.1.9 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.1.8 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.1.7 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.1.6 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.1.5 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.1.4 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.1.3 lib/logstash/outputs/s3/size_rotation_policy.rb