Class: Fluent::RedshiftOutput::MaintenanceMonitor

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/out_redshift.rb

Instance Method Summary collapse

Constructor Details

#initialize(maintenance_file_path) ⇒ MaintenanceMonitor

Returns a new instance of MaintenanceMonitor.



369
370
371
# File 'lib/fluent/plugin/out_redshift.rb', line 369

def initialize(maintenance_file_path)
  @file_path = maintenance_file_path
end

Instance Method Details

#check_maintenance!Object



377
378
379
380
381
# File 'lib/fluent/plugin/out_redshift.rb', line 377

def check_maintenance!
  if in_maintenance?
    raise MaintenanceError.new("Service is in maintenance mode - maintenance_file_path:#{@file_path}")
  end
end

#in_maintenance?Boolean

Returns:

  • (Boolean)


373
374
375
# File 'lib/fluent/plugin/out_redshift.rb', line 373

def in_maintenance?
  !!(@file_path && File.exists?(@file_path))
end