Sha256: e76a7b9e782af786c0ff0faf060d390b264703bc08267fe912a278fcfa61374b

Contents?: true

Size: 498 Bytes

Versions: 1

Compression:

Stored size: 498 Bytes

Contents

# encoding: utf-8
module LogStash
  module Outputs
    class Swift
      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

1 entries across 1 versions & 1 rubygems

Version Path
logstash-output-swift-0.1 lib/logstash/outputs/swift/size_rotation_policy.rb