Sha256: a5e930ce215061555993c735f818311887d84cdbd746f5007f76b8575869a4d3

Contents?: true

Size: 841 Bytes

Versions: 30

Compression:

Stored size: 841 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 call
      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

30 entries across 30 versions & 2 rubygems

Version Path
logstash-integration-jdbc-5.2.3 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.2.2 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.2.1 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.2.0 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.1.10 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.1.8 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.1.7 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.1.6 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.1.5 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.1.4 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.1.3 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.1.2 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.1.1 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.1.0 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.0.7 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.0.6 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.0.5 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.0.4 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.0.3 lib/logstash/filters/jdbc/single_load_runner.rb
logstash-integration-jdbc-5.0.2 lib/logstash/filters/jdbc/single_load_runner.rb