Class: LogStash::Outputs::Application_insights::Storage_recovery
- Inherits:
-
Object
- Object
- LogStash::Outputs::Application_insights::Storage_recovery
- Defined in:
- lib/logstash/outputs/application_insights/storage_recovery.rb
Constant Summary collapse
- @@instance =
Storage_recovery.new
Class Method Summary collapse
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize ⇒ Storage_recovery
constructor
A new instance of Storage_recovery.
- #recover_later(tuple, action, storage_account_name) ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ Storage_recovery
Returns a new instance of Storage_recovery.
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/logstash/outputs/application_insights/storage_recovery.rb', line 26 def initialize configuration = Config.current @logger = configuration[:logger] @storage_account_name_key = configuration[:storage_account_name_key] @queues = { :commit => {}, :notify => {}, :state_table_update => {} } init_queues( @storage_account_name_key, @queues ) @closing = nil @threads = [] end |
Class Method Details
.instance ⇒ Object
118 119 120 |
# File 'lib/logstash/outputs/application_insights/storage_recovery.rb', line 118 def self.instance @@instance end |
Instance Method Details
#close ⇒ Object
60 61 62 63 64 65 |
# File 'lib/logstash/outputs/application_insights/storage_recovery.rb', line 60 def close @closing = true # @threads.each do |thread| # thread.join # end end |
#recover_later(tuple, action, storage_account_name) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/logstash/outputs/application_insights/storage_recovery.rb', line 47 def recover_later ( tuple, action , storage_account_name ) if stopped? if :commit == action @state ||= State.instance @state.dec_pending_commits @shutdown ||= Shutdown.instance @shutdown.display_msg("!!! commit won't recover in this session due to shutdown") end else @queues[action][storage_account_name] << tuple end end |
#start ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/logstash/outputs/application_insights/storage_recovery.rb', line 38 def start @storage_account_name_key.each do |storage_account_name, storage_account_keys| # a threads, per storage account name @queues.each_key do |action| @threads << recovery_thread( storage_account_name, action ) end end end |