Class: LogStash::Outputs::S3::SizeAndTimeRotationPolicy
- Inherits:
-
Object
- Object
- LogStash::Outputs::S3::SizeAndTimeRotationPolicy
- Defined in:
- lib/logstash/outputs/s3/size_and_time_rotation_policy.rb
Instance Method Summary collapse
-
#initialize(file_size, time_file) ⇒ SizeAndTimeRotationPolicy
constructor
A new instance of SizeAndTimeRotationPolicy.
- #needs_periodic? ⇒ Boolean
- #rotate?(file) ⇒ Boolean
Constructor Details
#initialize(file_size, time_file) ⇒ SizeAndTimeRotationPolicy
Returns a new instance of SizeAndTimeRotationPolicy.
9 10 11 12 |
# File 'lib/logstash/outputs/s3/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
18 19 20 |
# File 'lib/logstash/outputs/s3/size_and_time_rotation_policy.rb', line 18 def needs_periodic? true end |
#rotate?(file) ⇒ Boolean
14 15 16 |
# File 'lib/logstash/outputs/s3/size_and_time_rotation_policy.rb', line 14 def rotate?(file) @size_strategy.rotate?(file) || @time_strategy.rotate?(file) end |