Class: LogStash::Outputs::LogstashAzureBlobOutput::SizeAndTimeRotationPolicy

Inherits:
Object
  • Object
show all
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

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

Returns:

  • (Boolean)


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

Returns:

  • (Boolean)


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