Class: LogStash::Outputs::Swift::SizeAndTimeRotationPolicy

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/outputs/swift/size_and_time_rotation_policy.rb

Instance Method Summary collapse

Constructor Details

#initialize(file_size, time_file) ⇒ SizeAndTimeRotationPolicy

Returns a new instance of SizeAndTimeRotationPolicy.



9
10
11
12
# File 'lib/logstash/outputs/swift/size_and_time_rotation_policy.rb', line 9

def initialize(file_size, time_file)
  @size_strategy = SizeRotationPolicy.new(file_size)
  @time_strategy = TimeRotationPolicy.new(time_file)
end

Instance Method Details

#needs_periodic?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/logstash/outputs/swift/size_and_time_rotation_policy.rb', line 18

def needs_periodic?
  true
end

#rotate?(file) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/logstash/outputs/swift/size_and_time_rotation_policy.rb', line 14

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