embulk-output-elasticsearch 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +4 -2
- data/build.gradle +5 -5
- data/src/main/java/org/embulk/output/elasticsearch/ElasticsearchHttpClient.java +1 -1
- data/src/main/java/org/embulk/output/elasticsearch/ElasticsearchOutputPluginDelegate.java +8 -7
- data/src/test/java/org/embulk/output/elasticsearch/TestElasticsearchOutputPlugin.java +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cd9ea46a0ed3003580d1b7d558d63768fa5d0ed
|
4
|
+
data.tar.gz: 4e3a5bbb02ec2a3e4ea645dd307d488acf33da65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 928b43c13c6a56bddeb247d9caad1fa2906a0fb14d32ad15f5db436f0ca5fcb82df454acfa40550c678d93c85f182697981604ff95aecc7c147423a89831c04a
|
7
|
+
data.tar.gz: e69b113999bf5e8d82c656ec296a04931f1ee4004936b692efed6a0e67e2c515d7b8edb96bc98c3d33549668aa720fc0cbec0ebf86ae16a219799021c359c67f
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 0.4.7 - 2018-12-14
|
2
|
+
* [maintenance] Show warning logs instead of throwing ConfigException for AWS ES [#49](https://github.com/embulk/embulk-output-elasticsearch/pull/49)
|
3
|
+
* [maintenance] Updated Embulk version v0.8.36 to v0.9.11 [#55](https://github.com/embulk/embulk-output-elasticsearch/pull/55)
|
1
4
|
## 0.4.6 - 2018-08-01
|
2
5
|
* [new feature] Add "connect_timeout_millis" option [#53](https://github.com/embulk/embulk-output-elasticsearch/pull/53)
|
3
6
|
* [new feature] Only build with Java8 [#52](https://github.com/embulk/embulk-output-elasticsearch/pull/52)
|
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# Elasticsearch output plugin for Embulk
|
2
2
|
|
3
|
-
**Notice** This plugin doesn't support [Amazon(AWS) Elasticsearch Service](https://aws.amazon.com/elasticsearch-service/).
|
4
|
-
|
3
|
+
**Notice** This plugin doesn't positively support [Amazon(AWS) Elasticsearch Service](https://aws.amazon.com/elasticsearch-service/).
|
4
|
+
Actually, AWS Elasticsearch Service supported AWS VPC at Oct 2017 and user is able to access to Es from EC2 instances in VPC subnet without any authentication.
|
5
|
+
You can use this plugin for AWS ES at your own risk.
|
6
|
+
|
5
7
|
- *[Amazon Elasticsearch Service Limits](http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/aes-limits.html)*
|
6
8
|
|
7
9
|
## Overview
|
data/build.gradle
CHANGED
@@ -20,21 +20,21 @@ configurations {
|
|
20
20
|
}
|
21
21
|
|
22
22
|
group = "org.embulk.output.elasticsearch"
|
23
|
-
version = "0.4.
|
23
|
+
version = "0.4.7"
|
24
24
|
|
25
25
|
compileJava.options.encoding = 'UTF-8' // source encoding
|
26
26
|
sourceCompatibility = 1.8
|
27
27
|
targetCompatibility = 1.8
|
28
28
|
|
29
29
|
dependencies {
|
30
|
-
compile "org.embulk:embulk-core:0.
|
31
|
-
provided "org.embulk:embulk-core:0.
|
30
|
+
compile "org.embulk:embulk-core:0.9.11"
|
31
|
+
provided "org.embulk:embulk-core:0.9.11"
|
32
32
|
compile "org.embulk.base.restclient:embulk-base-restclient:0.5.5"
|
33
33
|
compile "org.embulk.base.restclient:embulk-util-retryhelper-jetty92:0.5.3"
|
34
34
|
|
35
35
|
testCompile "junit:junit:4.+"
|
36
|
-
testCompile "org.embulk:embulk-core:0.
|
37
|
-
testCompile "org.embulk:embulk-standards:0.
|
36
|
+
testCompile "org.embulk:embulk-core:0.9.11:tests"
|
37
|
+
testCompile "org.embulk:embulk-standards:0.9.11"
|
38
38
|
}
|
39
39
|
|
40
40
|
javadoc {
|
@@ -70,7 +70,7 @@ public class ElasticsearchHttpClient
|
|
70
70
|
try {
|
71
71
|
String path = String.format("/%s/%s/_bulk", task.getIndex(), task.getType());
|
72
72
|
int recordSize = records.size();
|
73
|
-
String idColumn = task.getId().
|
73
|
+
String idColumn = task.getId().orElse(null);
|
74
74
|
if (recordSize > 0) {
|
75
75
|
StringBuilder sb = new StringBuilder();
|
76
76
|
for (JsonNode record : records) {
|
@@ -2,7 +2,6 @@ package org.embulk.output.elasticsearch;
|
|
2
2
|
|
3
3
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
4
4
|
import com.fasterxml.jackson.annotation.JsonValue;
|
5
|
-
import com.google.common.base.Optional;
|
6
5
|
import org.embulk.base.restclient.RestClientOutputPluginDelegate;
|
7
6
|
import org.embulk.base.restclient.RestClientOutputTaskBase;
|
8
7
|
import org.embulk.base.restclient.jackson.JacksonServiceRequestMapper;
|
@@ -24,6 +23,7 @@ import org.slf4j.Logger;
|
|
24
23
|
|
25
24
|
import java.util.List;
|
26
25
|
import java.util.Locale;
|
26
|
+
import java.util.Optional;
|
27
27
|
|
28
28
|
public class ElasticsearchOutputPluginDelegate
|
29
29
|
implements RestClientOutputPluginDelegate<ElasticsearchOutputPluginDelegate.PluginTask>
|
@@ -197,7 +197,7 @@ public class ElasticsearchOutputPluginDelegate
|
|
197
197
|
if (task.getNodes().size() > 0) {
|
198
198
|
for (NodeAddressTask node : task.getNodes()) {
|
199
199
|
if (node.getHost().endsWith("es.amazonaws.com")) {
|
200
|
-
|
200
|
+
log.warn("This plugin does't support AWS Elasticsearch Service. See README https://github.com/embulk/embulk-output-elasticsearch/blob/master/README.md");
|
201
201
|
}
|
202
202
|
if (node.getPort() == 9300) {
|
203
203
|
log.warn("Port:9300 is usually used by TransportClient. HTTP/Rest Client uses 9200.");
|
@@ -213,8 +213,8 @@ public class ElasticsearchOutputPluginDelegate
|
|
213
213
|
if (task.getMode().equals(Mode.REPLACE)) {
|
214
214
|
task.setAlias(Optional.of(task.getIndex()));
|
215
215
|
task.setIndex(client.generateNewIndexName(task.getIndex()));
|
216
|
-
if (client.isIndexExisting(task.getAlias().
|
217
|
-
throw new ConfigException(String.format("Invalid alias name [%s], an index exists with the same name as the alias", task.getAlias().
|
216
|
+
if (client.isIndexExisting(task.getAlias().orElse(null), task) && !client.isAliasExisting(task.getAlias().orElse(null), task)) {
|
217
|
+
throw new ConfigException(String.format("Invalid alias name [%s], an index exists with the same name as the alias", task.getAlias().orElse(null)));
|
218
218
|
}
|
219
219
|
}
|
220
220
|
log.info(String.format("Inserting data into index[%s]", task.getIndex()));
|
@@ -237,9 +237,10 @@ public class ElasticsearchOutputPluginDelegate
|
|
237
237
|
final ConfigSource configSource = Exec.newConfigSource();
|
238
238
|
configSource.set("format", "%Y-%m-%dT%H:%M:%S.%3N%z");
|
239
239
|
configSource.set("timezone", DateTimeZone.forID(task.getTimeZone()));
|
240
|
-
TimestampFormatter formatter =
|
240
|
+
TimestampFormatter formatter = TimestampFormatter.of(
|
241
241
|
Exec.newConfigSource().loadConfig(FormatterIntlTask.class),
|
242
|
-
Optional.fromNullable(configSource.loadConfig(FormatterIntlColumnOption.class))
|
242
|
+
com.google.common.base.Optional.fromNullable(configSource.loadConfig(FormatterIntlColumnOption.class))
|
243
|
+
);
|
243
244
|
|
244
245
|
return JacksonServiceRequestMapper.builder()
|
245
246
|
.add(new JacksonAllInObjectScope(formatter, task.getFillNullForEmptyColumn()), new JacksonTopLevelValueLocator("record"))
|
@@ -268,7 +269,7 @@ public class ElasticsearchOutputPluginDelegate
|
|
268
269
|
log.info("Insert completed. {} records", totalInserted);
|
269
270
|
// Re assign alias only when repale mode
|
270
271
|
if (task.getMode().equals(Mode.REPLACE)) {
|
271
|
-
client.reassignAlias(task.getAlias().
|
272
|
+
client.reassignAlias(task.getAlias().orElse(null), task.getIndex(), task);
|
272
273
|
}
|
273
274
|
|
274
275
|
return Exec.newConfigDiff();
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-output-elasticsearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Muga Nishizawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,8 +89,8 @@ files:
|
|
89
89
|
- classpath/jetty-http-9.2.14.v20151106.jar
|
90
90
|
- classpath/embulk-base-restclient-0.5.5.jar
|
91
91
|
- classpath/jetty-client-9.2.14.v20151106.jar
|
92
|
+
- classpath/embulk-output-elasticsearch-0.4.7.jar
|
92
93
|
- classpath/embulk-util-retryhelper-jetty92-0.5.3.jar
|
93
|
-
- classpath/embulk-output-elasticsearch-0.4.6.jar
|
94
94
|
homepage: https://github.com/embulk/embulk-output-elasticsearch
|
95
95
|
licenses:
|
96
96
|
- Apache 2.0
|