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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49c889d135818d8057d7770bd00363f07e6dc2a8
4
- data.tar.gz: c0c110dfcfad6ae0a5d1c65bfd14ab36eb2931c8
3
+ metadata.gz: 1cd9ea46a0ed3003580d1b7d558d63768fa5d0ed
4
+ data.tar.gz: 4e3a5bbb02ec2a3e4ea645dd307d488acf33da65
5
5
  SHA512:
6
- metadata.gz: 43cf761e50854f8322a829c4e646360609e9e15db444bc404ae3137a232ddc4f3dc84704faec733c8edbb9f28826a133e71a11b5450b7e5003aa147d18bf6125
7
- data.tar.gz: 464f7ff77c6030ac924fcee2f2856ea0fb3e3c6d842e0706c11a5e912438f10a4eb3aaf6172d9702155d4ca2fdc4cbebf0be4a510eda291d31f70b3b7410c17e
6
+ metadata.gz: 928b43c13c6a56bddeb247d9caad1fa2906a0fb14d32ad15f5db436f0ca5fcb82df454acfa40550c678d93c85f182697981604ff95aecc7c147423a89831c04a
7
+ data.tar.gz: e69b113999bf5e8d82c656ec296a04931f1ee4004936b692efed6a0e67e2c515d7b8edb96bc98c3d33549668aa720fc0cbec0ebf86ae16a219799021c359c67f
@@ -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
- This plugin uses HTTP/REST Client and haven't be implemented AWS authentication.
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
@@ -20,21 +20,21 @@ configurations {
20
20
  }
21
21
 
22
22
  group = "org.embulk.output.elasticsearch"
23
- version = "0.4.6"
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.8.36"
31
- provided "org.embulk:embulk-core:0.8.36"
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.8.36:tests"
37
- testCompile "org.embulk:embulk-standards:0.8.36"
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().orNull();
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
- throw new ConfigException("This plugin does't support AWS Elasticsearch Service.");
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().orNull(), task) && !client.isAliasExisting(task.getAlias().orNull(), task)) {
217
- throw new ConfigException(String.format("Invalid alias name [%s], an index exists with the same name as the alias", task.getAlias().orNull()));
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 = new TimestampFormatter(
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().orNull(), task.getIndex(), task);
272
+ client.reassignAlias(task.getAlias().orElse(null), task.getIndex(), task);
272
273
  }
273
274
 
274
275
  return Exec.newConfigDiff();
@@ -98,7 +98,7 @@ public class TestElasticsearchOutputPlugin
98
98
  }
99
99
  catch (Throwable t) {
100
100
  if (t instanceof RuntimeException) {
101
- assertTrue(t.getCause().getCause() instanceof ConfigException);
101
+ assertTrue(t instanceof ConfigException);
102
102
  }
103
103
  }
104
104
  }
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.6
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-08-01 00:00:00.000000000 Z
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