Class: LogStash::Outputs::LogstashAzureBlobOutput::SizeAndTimeRotationPolicy
- Inherits:
-
Object
- Object
- LogStash::Outputs::LogstashAzureBlobOutput::SizeAndTimeRotationPolicy
- Defined in:
- lib/logstash/outputs/blob/size_and_time_rotation_policy.rb
Overview
a sub class of LogstashAzureBlobOutput
sets the rotation policy
Instance Method Summary collapse
-
#initialize(file_size, time_file) ⇒ SizeAndTimeRotationPolicy
constructor
initialize the class.
-
#needs_periodic? ⇒ Boolean
boolean method.
-
#rotate?(file) ⇒ Boolean
check if it is time to rotate.
Constructor Details
#initialize(file_size, time_file) ⇒ SizeAndTimeRotationPolicy
initialize the class
11 12 13 14 |
# File 'lib/logstash/outputs/blob/size_and_time_rotation_policy.rb', line 11 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
boolean method
22 23 24 |
# File 'lib/logstash/outputs/blob/size_and_time_rotation_policy.rb', line 22 def needs_periodic? true end |
#rotate?(file) ⇒ Boolean
check if it is time to rotate
17 18 19 |
# File 'lib/logstash/outputs/blob/size_and_time_rotation_policy.rb', line 17 def rotate?(file) @size_strategy.rotate?(file) || @time_strategy.rotate?(file) end |