Sha256: 197631388862d96b5b40c6a84fb5d252a8da0eb9f3ef0795c3512868ccc1b1c3

Contents?: true

Size: 579 Bytes

Versions: 49

Compression:

Stored size: 579 Bytes

Contents

# encoding: utf-8
require "logstash/outputs/s3/size_rotation_policy"
require "logstash/outputs/s3/time_rotation_policy"

module LogStash
  module Outputs
    class S3
      class SizeAndTimeRotationPolicy
        def initialize(file_size, time_file)
          @size_strategy = SizeRotationPolicy.new(file_size)
          @time_strategy = TimeRotationPolicy.new(time_file)
        end

        def rotate?(file)
          @size_strategy.rotate?(file) || @time_strategy.rotate?(file)
        end 

        def needs_periodic?
          true
        end
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 3 rubygems

Version Path
logstash-integration-aws-7.1.8-java lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-integration-aws-7.1.7-java lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-output-s3-zst-1.1.0 lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-output-s3-zst-1.0.0 lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-integration-aws-7.1.6-java lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-integration-aws-7.1.5-java lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-integration-aws-7.1.4-java lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-integration-aws-7.1.3-java lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-integration-aws-7.1.2-java lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-integration-aws-7.1.1-java lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-integration-aws-7.1.0 lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-integration-aws-7.0.1 lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-output-s3-4.4.1 lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-integration-aws-7.0.0 lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-output-s3-4.4.0 lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-output-s3-4.3.7 lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-output-s3-4.3.6 lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-integration-aws-0.1.0.pre lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-output-s3-4.3.5 lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
logstash-output-s3-4.3.4 lib/logstash/outputs/s3/size_and_time_rotation_policy.rb