embulk-input-elasticsearch 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e50e12402a605f80964ad84cf29c555d6526671
4
- data.tar.gz: a69bf91656bd9a569e68ee437efecf69cd03db57
3
+ metadata.gz: 6fe4375a3aa307d250dea7ecb85b3205d5bea8f0
4
+ data.tar.gz: 40122cde69c0ee271ca6f10b1dc06aea45870e27
5
5
  SHA512:
6
- metadata.gz: 2400cf1b6273097d67d2a71f65f2984bbf3b1a79c03b1070c02aff0e1913d99be37af80e2a6d3eba0a65ef9462cee6b53d3df23ce70c6579694f4a3c278eda3e
7
- data.tar.gz: a21f701e1b9695e170858ebdb16c3042cb38f6557573d03f1142b1764b2771b9c75d27056acb47e78f2a469953cecff65d2c73a2b8addd69834dc5c51b6d1eee
6
+ metadata.gz: 64c5d668c9edf83b90b72911a12ccb8169cc6eba9d6c8cddc2dc06e3963c970edadcb24ffc04b8ad9b81c9a9f1549e3cc0ceefb88fcfe73862e4067ff6782319
7
+ data.tar.gz: fbf04ec4f70e7608222150567f88c263118b4db7dc06a469f665dab423844aeb6990348eb480e55850b260d57097af9a60049ddae0e601c2b443e0dffa889f57
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Elasticsearch input plugin for Embulk [![Build Status](https://secure.travis-ci.org/toyama0919/embulk-input-elasticsearch.png?branch=master)](http://travis-ci.org/toyama0919/embulk-input-elasticsearch)
1
+ # Elasticsearch input plugin for Embulk [![Build Status](https://secure.travis-ci.org/toyama0919/embulk-input-elasticsearch.png?branch=master)](http://travis-ci.org/toyama0919/embulk-input-elasticsearch) [![Gem Version](https://badge.fury.io/rb/embulk-input-elasticsearch.svg)](http://badge.fury.io/rb/embulk-input-elasticsearch)
2
2
 
3
3
  ## Overview
4
4
 
@@ -11,18 +11,19 @@
11
11
  - **nodes**: nodes (array, required)
12
12
  - **host**: host (string, required)
13
13
  - **port**: port (integer, required)
14
- - **queries**: query (array, required)
14
+ - **queries**: lucene query array. (array, required)
15
15
  - **index**: index (string, required)
16
16
  - **index_type**: index_type (string)
17
- - **request_timeout**: request_timeout (integer)
18
- - **per_size**: per_size (integer, required, default: `1000`)
19
- - **limit_size**: limit_size (integer, default: unlimit)
17
+ - **request_timeout**: request timeout (integer)
18
+ - **per_size**: per size query. (integer, required, default: `1000`)
19
+ - **limit_size**: limit size unit query. (integer, default: unlimit)
20
20
  - **num_threads**: number of threads for queries. (integer, default: 1)
21
+ - **retry_on_failure**: retry on failure. set 0 is retry forever. (integer, default: 5)
21
22
  - **fields**: fields (array, required)
22
23
  - **name**: name (string, required)
23
24
  - **type**: type (string, required)
24
25
  - **metadata**: metadata (boolean, default: false)
25
- - **time_format**: time_format (string, required)
26
+ - **time_format**: time_format (string)
26
27
 
27
28
  ## Example
28
29
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = "embulk-input-elasticsearch"
4
- spec.version = "0.3.3"
4
+ spec.version = "0.3.4"
5
5
  spec.authors = ["toyama0919"]
6
6
  spec.summary = "Elasticsearch input plugin for Embulk"
7
7
  spec.description = "Loads records from Elasticsearch. parallel query support."
@@ -59,12 +59,14 @@ module Embulk
59
59
  end
60
60
  end
61
61
 
62
+ private
63
+
62
64
  def search_with_retry
63
65
  retries = 0
64
66
  begin
65
67
  yield if block_given?
66
68
  rescue => e
67
- if retries < @retry_on_failure
69
+ if (@retry_on_failure == 0 || retries < @retry_on_failure)
68
70
  retries += 1
69
71
  Embulk.logger.warn "Could not search to Elasticsearch, resetting connection and trying again. #{e.message}"
70
72
  sleep 2**retries
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - toyama0919
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-17 00:00:00.000000000 Z
11
+ date: 2017-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement