Class: Fluent::RedshiftOutput::MaintenanceMonitor
- Inherits:
-
Object
- Object
- Fluent::RedshiftOutput::MaintenanceMonitor
- Defined in:
- lib/fluent/plugin/out_redshift-out.rb
Instance Method Summary collapse
- #check_maintenance! ⇒ Object
- #in_maintenance? ⇒ Boolean
-
#initialize(maintenance_file_path) ⇒ MaintenanceMonitor
constructor
A new instance of MaintenanceMonitor.
Constructor Details
#initialize(maintenance_file_path) ⇒ MaintenanceMonitor
Returns a new instance of MaintenanceMonitor.
380 381 382 |
# File 'lib/fluent/plugin/out_redshift-out.rb', line 380 def initialize(maintenance_file_path) @file_path = maintenance_file_path end |
Instance Method Details
#check_maintenance! ⇒ Object
388 389 390 391 392 |
# File 'lib/fluent/plugin/out_redshift-out.rb', line 388 def check_maintenance! if in_maintenance? raise MaintenanceError.new("Service is in maintenance mode - maintenance_file_path:#{@file_path}") end end |
#in_maintenance? ⇒ Boolean
384 385 386 |
# File 'lib/fluent/plugin/out_redshift-out.rb', line 384 def in_maintenance? !!(@file_path && File.exists?(@file_path)) end |