Class: LogStash::Outputs::OSS::HybridRotation
- Inherits:
-
Object
- Object
- LogStash::Outputs::OSS::HybridRotation
- Defined in:
- lib/logstash/outputs/oss/rotations/hybrid_rotation.rb
Instance Method Summary collapse
-
#initialize(size_rotate, time_rotate) ⇒ HybridRotation
constructor
A new instance of HybridRotation.
- #needs_periodic_check? ⇒ Boolean
- #rotate?(file) ⇒ Boolean
Constructor Details
#initialize(size_rotate, time_rotate) ⇒ HybridRotation
Returns a new instance of HybridRotation.
9 10 11 12 |
# File 'lib/logstash/outputs/oss/rotations/hybrid_rotation.rb', line 9 def initialize(size_rotate, time_rotate) @size_strategy = SizeBasedRotation.new(size_rotate) @time_strategy = TimeBasedRotation.new(time_rotate) end |
Instance Method Details
#needs_periodic_check? ⇒ Boolean
18 19 20 |
# File 'lib/logstash/outputs/oss/rotations/hybrid_rotation.rb', line 18 def needs_periodic_check? true end |
#rotate?(file) ⇒ Boolean
14 15 16 |
# File 'lib/logstash/outputs/oss/rotations/hybrid_rotation.rb', line 14 def rotate?(file) @size_strategy.rotate?(file) || @time_strategy.rotate?(file) end |