Sha256: 2b45c7f62a4df101bdf2c7f0a7f41c65711ed8c32c88644159a31b3de87dcf4c

Contents?: true

Size: 494 Bytes

Versions: 13

Compression:

Stored size: 494 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 greater 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

13 entries across 13 versions & 3 rubygems

Version Path
logstash-integration-aws-7.1.8-java lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-integration-aws-7.1.7-java lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-zst-1.1.0 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-zst-1.0.0 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-integration-aws-7.1.6-java lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-integration-aws-7.1.5-java lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-integration-aws-7.1.4-java lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-integration-aws-7.1.3-java lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-integration-aws-7.1.2-java lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-integration-aws-7.1.1-java lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-integration-aws-7.1.0 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.4.1 lib/logstash/outputs/s3/size_rotation_policy.rb
logstash-output-s3-4.4.0 lib/logstash/outputs/s3/size_rotation_policy.rb