Class: LogStash::Outputs::Application_insights::Shutdown_recovery

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/outputs/application_insights/shutdown_recovery.rb

Constant Summary collapse

@@instance =
Shutdown_recovery.new

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeShutdown_recovery

Returns a new instance of Shutdown_recovery.



26
27
28
29
30
31
32
33
34
# File 'lib/logstash/outputs/application_insights/shutdown_recovery.rb', line 26

def initialize
  configuration = Config.current
  @logger = configuration[:logger]
  @storage_account_name_key = configuration[:storage_account_name_key]
  @partition_key_prefix =configuration[:partition_key_prefix]

  @closing = nil
  @threads = []
end

Class Method Details

.instanceObject



134
135
136
# File 'lib/logstash/outputs/application_insights/shutdown_recovery.rb', line 134

def self.instance
  @@instance
end

Instance Method Details

#closeObject



45
46
47
48
49
50
# File 'lib/logstash/outputs/application_insights/shutdown_recovery.rb', line 45

def close
  @closing = true
  @threads.each do |thread|
    thread.join
  end
end

#startObject



36
37
38
39
40
41
42
43
# File 'lib/logstash/outputs/application_insights/shutdown_recovery.rb', line 36

def start
  @storage_recovery = Storage_recovery.instance
  @notification_recovery = Notification_recovery.instance
  @storage_account_name_key.each do |, |
    @threads << recovery_thread( , :uploading)
    @threads << recovery_thread( , :committed)
  end
end