embulk-input-elasticsearch 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +14 -10
- data/README.md +17 -0
- data/embulk-input-elasticsearch.gemspec +1 -1
- data/lib/embulk/input/elasticsearch.rb +1 -0
- data/lib/embulk/input/elasticsearch/connection.rb +2 -2
- data/lib/embulk/input/elasticsearch/converter.rb +1 -1
- data/lib/embulk/input/elasticsearch/error.rb +39 -0
- data/test/helper.rb +7 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ec0ae29517a8e4b843226eb79c9353a8e2a5a8a
|
4
|
+
data.tar.gz: 126f307337464bb350737e6aef30b920dacdbb8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58b66876e8accac787fefa4d621759ef216f2b87f31eaffaf2deb45386012e519ab1d269cc1307626a522783a30cb959335c5de0d1da20d5a0840af088105a9e
|
7
|
+
data.tar.gz: e92bf4881d21d53471cddc12faef687a81a9ab9453f1ed64ef4c329d548dca57076da415b46b34db32d1106de49a083bdf1eea5226d1abb70d87e6db49910eea
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
language: ruby
|
2
|
-
|
3
|
-
rvm:
|
4
|
-
- jruby-9.0.5.0
|
5
|
-
- jruby-9.1.5.0
|
6
|
-
- jruby-head
|
7
|
-
jdk:
|
8
|
-
- openjdk7
|
9
|
-
before_install:
|
10
|
-
- gem install bundler
|
2
|
+
install: ./embulk.jar bundle install --path vendor/bundle
|
11
3
|
matrix:
|
4
|
+
include:
|
5
|
+
- env: EMBULK_VERSION=0.9.15
|
6
|
+
rvm: jruby-9.1.5.0 # bundled jruby version
|
7
|
+
jdk: openjdk8 # embulk 0.9.x uses jdk8
|
8
|
+
- env: EMBULK_VERSION=latest
|
9
|
+
rvm: jruby-9.1.5.0 # ?
|
10
|
+
jdk: openjdk8 # ?
|
12
11
|
allow_failures:
|
13
|
-
-
|
12
|
+
- env: EMBULK_VERSION=latest
|
13
|
+
before_install:
|
14
|
+
- curl -o embulk.jar --create-dirs -L "http://dl.embulk.org/embulk-${EMBULK_VERSION}.jar"
|
15
|
+
- chmod +x embulk.jar
|
16
|
+
- ./embulk.jar gem install bundler
|
17
|
+
script: ./embulk.jar bundle exec rake test
|
data/README.md
CHANGED
@@ -72,6 +72,23 @@ in:
|
|
72
72
|
* json
|
73
73
|
* boolean
|
74
74
|
|
75
|
+
## test
|
76
|
+
|
77
|
+
### setup
|
78
|
+
|
79
|
+
```
|
80
|
+
curl -o embulk.jar --create-dirs -L "http://dl.embulk.org/embulk-latest.jar"
|
81
|
+
chmod +x embulk.jar
|
82
|
+
./embulk.jar gem install bundler
|
83
|
+
./embulk.jar bundle install --path vendor/bundle
|
84
|
+
```
|
85
|
+
|
86
|
+
### run test
|
87
|
+
|
88
|
+
```
|
89
|
+
./embulk.jar bundle exec rake test
|
90
|
+
```
|
91
|
+
|
75
92
|
## Build
|
76
93
|
|
77
94
|
```
|
@@ -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.
|
4
|
+
spec.version = "0.3.6"
|
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."
|
@@ -73,8 +73,8 @@ module Embulk
|
|
73
73
|
sleep 2**retries
|
74
74
|
retry
|
75
75
|
end
|
76
|
-
|
77
|
-
|
76
|
+
msg = "Could not search to Elasticsearch after #{retries} retries. #{e.message}"
|
77
|
+
raise Elasticsearch::ConnectionError.new e, msg
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Embulk
|
2
|
+
module Input
|
3
|
+
|
4
|
+
class Elasticsearch < InputPlugin
|
5
|
+
|
6
|
+
module Traceable
|
7
|
+
def initialize(e, more_msg = nil)
|
8
|
+
message = e.is_a?(String) ? '' : "(#{e.class}) "
|
9
|
+
message << "#{e}#{more_msg}\n"
|
10
|
+
message << "\tat #{e.backtrace.join("\n\tat ")}\n" if e.respond_to?(:backtrace)
|
11
|
+
|
12
|
+
while e.respond_to?(:cause) and e.cause
|
13
|
+
# Java Exception cannot follow the JRuby causes.
|
14
|
+
message << "Caused by (#{e.cause.class}) #{e.cause}\n"
|
15
|
+
message << "\tat #{e.cause.backtrace.join("\n\tat ")}\n" if e.cause.respond_to?(:backtrace)
|
16
|
+
e = e.cause
|
17
|
+
end
|
18
|
+
|
19
|
+
super(message)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class ConfigError < ::Embulk::ConfigError
|
24
|
+
include Traceable
|
25
|
+
end
|
26
|
+
|
27
|
+
class ConnectionError < ConfigError
|
28
|
+
end
|
29
|
+
|
30
|
+
class DataError < ::Embulk::DataError
|
31
|
+
include Traceable
|
32
|
+
end
|
33
|
+
|
34
|
+
class TypecastError < DataError
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/test/helper.rb
CHANGED
@@ -4,7 +4,13 @@ require 'test/unit'
|
|
4
4
|
|
5
5
|
# require 'embulk/java/bootstrap'
|
6
6
|
require 'embulk'
|
7
|
-
|
7
|
+
begin
|
8
|
+
# Embulk ~> 0.8.x
|
9
|
+
Embulk.setup
|
10
|
+
rescue NotImplementedError
|
11
|
+
# Embulk ~> 0.9.x
|
12
|
+
require 'embulk/java/bootstrap'
|
13
|
+
end
|
8
14
|
Embulk.logger = Embulk::Logger.new('/dev/null')
|
9
15
|
|
10
16
|
APP_ROOT = File.expand_path('../', __dir__)
|
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.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- toyama0919
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- lib/embulk/input/elasticsearch.rb
|
113
113
|
- lib/embulk/input/elasticsearch/connection.rb
|
114
114
|
- lib/embulk/input/elasticsearch/converter.rb
|
115
|
+
- lib/embulk/input/elasticsearch/error.rb
|
115
116
|
- lib/embulk/input/elasticsearch/input_thread.rb
|
116
117
|
- test/helper.rb
|
117
118
|
- test/test_converter.rb
|