Sha256: 92f5106ce6b044ec7ff1c5644575e8db753d7b42559e474a1b82df233e54dc97

Contents?: true

Size: 612 Bytes

Versions: 11

Compression:

Stored size: 612 Bytes

Contents

module Embulk
  module Input
    class Elasticsearch < InputPlugin
      class InputThread
        def self.get_slice_from_num_threads(array, define_num_threads)
          num_threads = array.size < define_num_threads ? array.size : define_num_threads
          per_queries = if (array.size % num_threads) == 0
            (array.size / num_threads)
          else
            (array.size / num_threads) + 1
          end
          sliced = array.each_slice(per_queries).to_a
          Embulk.logger.info("calculate num threads => #{sliced.size}")
          return sliced
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
embulk-input-elasticsearch-nosslverify-0.3.9 lib/embulk/input/elasticsearch/input_thread.rb
embulk-input-elasticsearch-nosslverify-0.3.8 lib/embulk/input/elasticsearch/input_thread.rb
embulk-input-elasticsearch-nosslverify-0.3.7 lib/embulk/input/elasticsearch/input_thread.rb
embulk-input-elasticsearch-nosslverify-0.3.6 lib/embulk/input/elasticsearch/input_thread.rb
embulk-input-elasticsearch-0.3.6 lib/embulk/input/elasticsearch/input_thread.rb
embulk-input-elasticsearch-0.3.5 lib/embulk/input/elasticsearch/input_thread.rb
embulk-input-elasticsearch-0.3.4 lib/embulk/input/elasticsearch/input_thread.rb
embulk-input-elasticsearch-0.3.3 lib/embulk/input/elasticsearch/input_thread.rb
embulk-input-elasticsearch-0.3.2 lib/embulk/input/elasticsearch/input_thread.rb
embulk-input-elasticsearch-0.3.1 lib/embulk/input/elasticsearch/input_thread.rb
embulk-input-elasticsearch-0.3.0 lib/embulk/input/elasticsearch/input_thread.rb