Class: LogStash::Outputs::LogstashAzureBlobOutput::SizeRotationPolicy
- Inherits:
-
Object
- Object
- LogStash::Outputs::LogstashAzureBlobOutput::SizeRotationPolicy
- Defined in:
- lib/logstash/outputs/blob/size_rotation_policy.rb
Overview
a sub class of LogstashAzureBlobOutput
sets the rotation policy by size
Instance Attribute Summary collapse
-
#size_file ⇒ Object
readonly
Returns the value of attribute size_file.
Instance Method Summary collapse
-
#initialize(size_file) ⇒ SizeRotationPolicy
constructor
initialize the class.
-
#needs_periodic? ⇒ Boolean
boolean method.
-
#rotate?(file) ⇒ Boolean
boolean method to check if it is time to rotate.
Constructor Details
#initialize(size_file) ⇒ SizeRotationPolicy
initialize the class
9 10 11 12 13 14 15 |
# File 'lib/logstash/outputs/blob/size_rotation_policy.rb', line 9 def initialize(size_file) if size_file <= 0 raise LogStash::ConfigurationError.new('`size_file` need to be greather than 0') end @size_file = size_file end |
Instance Attribute Details
#size_file ⇒ Object (readonly)
Returns the value of attribute size_file.
7 8 9 |
# File 'lib/logstash/outputs/blob/size_rotation_policy.rb', line 7 def size_file @size_file end |
Instance Method Details
#needs_periodic? ⇒ Boolean
boolean method
23 24 25 |
# File 'lib/logstash/outputs/blob/size_rotation_policy.rb', line 23 def needs_periodic? false end |
#rotate?(file) ⇒ Boolean
boolean method to check if it is time to rotate
18 19 20 |
# File 'lib/logstash/outputs/blob/size_rotation_policy.rb', line 18 def rotate?(file) file.size >= size_file end |