Class: LogStash::Outputs::Application_insights::Shutdown_recovery
- Inherits:
-
Object
- Object
- LogStash::Outputs::Application_insights::Shutdown_recovery
- 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
- #close ⇒ Object
-
#initialize ⇒ Shutdown_recovery
constructor
A new instance of Shutdown_recovery.
- #start ⇒ Object
Constructor Details
#initialize ⇒ Shutdown_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
.instance ⇒ Object
134 135 136 |
# File 'lib/logstash/outputs/application_insights/shutdown_recovery.rb', line 134 def self.instance @@instance end |
Instance Method Details
#close ⇒ Object
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 |
#start ⇒ Object
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 |storage_account_name, storage_account_keys| @threads << recovery_thread( storage_account_name, :uploading) @threads << recovery_thread( storage_account_name, :committed) end end |