Class: LogStash::Outputs::S3::SizeRotationPolicy
- Inherits:
-
Object
- Object
- LogStash::Outputs::S3::SizeRotationPolicy
- Defined in:
- lib/logstash/outputs/s3/size_rotation_policy.rb
Instance Attribute Summary collapse
-
#size_file ⇒ Object
readonly
Returns the value of attribute size_file.
Instance Method Summary collapse
-
#initialize(size_file) ⇒ SizeRotationPolicy
constructor
A new instance of SizeRotationPolicy.
- #needs_periodic? ⇒ Boolean
- #rotate?(file) ⇒ Boolean
Constructor Details
#initialize(size_file) ⇒ SizeRotationPolicy
Returns a new instance of SizeRotationPolicy.
8 9 10 11 12 13 14 |
# File 'lib/logstash/outputs/s3/size_rotation_policy.rb', line 8 def initialize(size_file) if size_file <= 0 raise LogStash::ConfigurationError, "`size_file` need to be greater than 0" end @size_file = size_file end |
Instance Attribute Details
#size_file ⇒ Object (readonly)
Returns the value of attribute size_file.
6 7 8 |
# File 'lib/logstash/outputs/s3/size_rotation_policy.rb', line 6 def size_file @size_file end |
Instance Method Details
#needs_periodic? ⇒ Boolean
20 21 22 |
# File 'lib/logstash/outputs/s3/size_rotation_policy.rb', line 20 def needs_periodic? false end |
#rotate?(file) ⇒ Boolean
16 17 18 |
# File 'lib/logstash/outputs/s3/size_rotation_policy.rb', line 16 def rotate?(file) file.size >= size_file end |