Sha256: 361a0c8c89421e8a8a47ee0f076a96cf874a4e4151586b7c720248991618e870

Contents?: true

Size: 799 Bytes

Versions: 16

Compression:

Stored size: 799 Bytes

Contents

# encoding: utf-8
require_relative 'db_object'

module LogStash module Filters module Jdbc
  class SingleLoadRunner

    attr_reader :local, :loaders, :preloaders

    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

    def initial_load
      do_preload
      local.populate_all(loaders)
      @reload_counter.increment
    end

    def repeated_load
    end

    def reload_count
      @reload_counter.value
    end

    private

    def do_preload
      preloaders.each do |db_object|
        local.build_db_object(db_object)
      end
    end
  end

end end end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
logstash-integration-jdbc-5.5.1 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.5.0 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.4.9 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.4.8 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.4.7 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.4.6 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.4.5 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.4.4 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.4.3 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.4.2 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.4.1 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.4.0 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.3.0 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.2.6 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.2.5 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.2.4 lib/logstash/filters/jdbc/single_load_runner.rb