Class: LogStash::Filters::Jdbc::SingleLoadRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/filters/jdbc/single_load_runner.rb

Direct Known Subclasses

RepeatingLoadRunner

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#loadersObject (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

#localObject (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

#preloadersObject (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_loadObject



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_countObject



29
30
31
# File 'lib/logstash/filters/jdbc/single_load_runner.rb', line 29

def reload_count
  @reload_counter.value
end

#repeated_loadObject



26
27
# File 'lib/logstash/filters/jdbc/single_load_runner.rb', line 26

def repeated_load
end