Class: LogStash::Filters::Jdbc::SingleLoadRunner
- Inherits:
-
Object
- Object
- LogStash::Filters::Jdbc::SingleLoadRunner
- Defined in:
- lib/logstash/filters/jdbc/single_load_runner.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#loaders ⇒ Object
readonly
Returns the value of attribute loaders.
-
#local ⇒ Object
readonly
Returns the value of attribute local.
-
#preloaders ⇒ Object
readonly
Returns the value of attribute preloaders.
Instance Method Summary collapse
- #initial_load ⇒ Object
-
#initialize(local, loaders, preloaders) ⇒ SingleLoadRunner
constructor
A new instance of SingleLoadRunner.
- #reload_count ⇒ Object
- #repeated_load ⇒ Object
Constructor Details
#initialize(local, loaders, preloaders) ⇒ SingleLoadRunner
Returns a new instance of SingleLoadRunner.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/logstash/filters/jdbc/single_load_runner.rb', line 9 def initialize(local, loaders, preloaders) @local = local @loaders = loaders @preloaders = [] @reload_counter = Concurrent::AtomicFixnum.new(0) preloaders.map do |pre| @preloaders << DbObject.new(pre) end @preloaders.sort! end |
Instance Attribute Details
#loaders ⇒ Object (readonly)
Returns the value of attribute loaders.
7 8 9 |
# File 'lib/logstash/filters/jdbc/single_load_runner.rb', line 7 def loaders @loaders end |
#local ⇒ Object (readonly)
Returns the value of attribute local.
7 8 9 |
# File 'lib/logstash/filters/jdbc/single_load_runner.rb', line 7 def local @local end |
#preloaders ⇒ Object (readonly)
Returns the value of attribute preloaders.
7 8 9 |
# File 'lib/logstash/filters/jdbc/single_load_runner.rb', line 7 def preloaders @preloaders end |
Instance Method Details
#initial_load ⇒ Object
20 21 22 23 24 |
# File 'lib/logstash/filters/jdbc/single_load_runner.rb', line 20 def initial_load do_preload local.populate_all(loaders) @reload_counter.increment end |
#reload_count ⇒ Object
29 30 31 |
# File 'lib/logstash/filters/jdbc/single_load_runner.rb', line 29 def reload_count @reload_counter.value end |
#repeated_load ⇒ Object
26 27 |
# File 'lib/logstash/filters/jdbc/single_load_runner.rb', line 26 def repeated_load end |