embulk-output-elasticsearch 0.1.4 → 0.1.5

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: 035179327a377d9871fab2c41e3d5e58e9ae1c8a
4
- data.tar.gz: 782610c5af444153a9b4d0d2d5252d0c9f0e5616
3
+ metadata.gz: 17a43eb01895594c2923a7390d4e8d09a1700cf9
4
+ data.tar.gz: c7c96752d024bc7db265dbbae1f6f512f0f040d4
5
5
  SHA512:
6
- metadata.gz: 5e8938dfd6551445c5b814a9facbba97eba8b1ac459f0977d2866d6db97f45238bd6b12c2226d4713d4ebc9f72f31d411e2ce97df5896065b227e4052b095a0b
7
- data.tar.gz: b05bded4e3bc2eaff9c1d1fd06806dc076cf7ae113f8e966e1a37b269c83b9b1cb669e7570c4ad23f5763c83638e7364c80af4070f9d79060612e6ba02908f5f
6
+ metadata.gz: 087a8375db096a288f1bab97ce21e3cebee9b8919179284fef981040252c3bf474d5f829704f82da64781214eb18394ffe9068a5b9e5db8c869b4cdae805d746
7
+ data.tar.gz: 122ae097b4f1811b58e312040e11a232396e3b029114f55567394d3e1dad1620dd3b8b25718683a623da51e8f6d75fef5a652eef2892c0a2538481fa414731ae
data/README.md CHANGED
@@ -10,6 +10,7 @@
10
10
  ## Configuration
11
11
 
12
12
  - **nodes**: list of nodes. nodes are pairs of host and port (list, required)
13
+ - **cluster_name**: name of the cluster (string, default is "elasticsearch")
13
14
  - **index**: index name (string, required)
14
15
  - **index_type**: index type (string, required)
15
16
  - **id**: document id column (string, default is null)
data/build.gradle CHANGED
@@ -13,7 +13,7 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.1.4"
16
+ version = "0.1.5"
17
17
 
18
18
  dependencies {
19
19
  compile "org.embulk:embulk-core:0.4.0"
@@ -57,12 +57,16 @@ public class ElasticsearchOutputPlugin
57
57
  public int getPort();
58
58
  }
59
59
 
60
- public interface RunnerTask
60
+ public interface PluginTask
61
61
  extends Task
62
62
  {
63
63
  @Config("nodes")
64
64
  public List<NodeAddressTask> getNodes();
65
65
 
66
+ @Config("cluster_name")
67
+ @ConfigDefault("\"elasticsearch\"")
68
+ public String getClusterName();
69
+
66
70
  @Config("index")
67
71
  public String getIndex();
68
72
 
@@ -80,7 +84,6 @@ public class ElasticsearchOutputPlugin
80
84
  @Config("concurrent_requests")
81
85
  @ConfigDefault("5")
82
86
  public int getConcurrentRequests();
83
-
84
87
  }
85
88
 
86
89
  private final Logger log;
@@ -95,7 +98,7 @@ public class ElasticsearchOutputPlugin
95
98
  public ConfigDiff transaction(ConfigSource config, Schema schema,
96
99
  int processorCount, Control control)
97
100
  {
98
- final RunnerTask task = config.loadConfig(RunnerTask.class);
101
+ final PluginTask task = config.loadConfig(PluginTask.class);
99
102
 
100
103
  // confirm that a client can be initialized
101
104
  try (Client client = createClient(task)) {
@@ -138,11 +141,12 @@ public class ElasticsearchOutputPlugin
138
141
  List<CommitReport> successCommitReports)
139
142
  { }
140
143
 
141
- private Client createClient(final RunnerTask task)
144
+ private Client createClient(final PluginTask task)
142
145
  {
143
146
  // @see http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html
144
147
  Settings settings = ImmutableSettings.settingsBuilder()
145
148
  .classLoader(Settings.class.getClassLoader())
149
+ .put("cluster.name", task.getClusterName())
146
150
  .build();
147
151
  TransportClient client = new TransportClient(settings);
148
152
  List<NodeAddressTask> nodes = task.getNodes();
@@ -152,7 +156,7 @@ public class ElasticsearchOutputPlugin
152
156
  return client;
153
157
  }
154
158
 
155
- private BulkProcessor newBulkProcessor(final RunnerTask task, final Client client)
159
+ private BulkProcessor newBulkProcessor(final PluginTask task, final Client client)
156
160
  {
157
161
  return BulkProcessor.builder(client, new BulkProcessor.Listener() {
158
162
  @Override
@@ -196,7 +200,7 @@ public class ElasticsearchOutputPlugin
196
200
  public TransactionalPageOutput open(TaskSource taskSource, Schema schema,
197
201
  int processorIndex)
198
202
  {
199
- final RunnerTask task = taskSource.loadTask(RunnerTask.class);
203
+ final PluginTask task = taskSource.loadTask(PluginTask.class);
200
204
 
201
205
  Client client = createClient(task);
202
206
  BulkProcessor bulkProcessor = newBulkProcessor(task, client);
@@ -218,7 +222,7 @@ public class ElasticsearchOutputPlugin
218
222
  private final String type;
219
223
  private final String id;
220
224
 
221
- ElasticsearchPageOutput(RunnerTask task, Client client, BulkProcessor bulkProcessor)
225
+ ElasticsearchPageOutput(PluginTask task, Client client, BulkProcessor bulkProcessor)
222
226
  {
223
227
  this.log = Exec.getLogger(getClass());
224
228
 
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.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Muga Nishizawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-19 00:00:00.000000000 Z
11
+ date: 2015-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -72,7 +72,7 @@ files:
72
72
  - src/main/resources/META-INF/services/org.embulk.spi.Extension
73
73
  - src/test/java/org/embulk/output/TestElasticsearchOutputPlugin.java
74
74
  - classpath/elasticsearch-1.4.2.jar
75
- - classpath/embulk-output-elasticsearch-0.1.4.jar
75
+ - classpath/embulk-output-elasticsearch-0.1.5.jar
76
76
  - classpath/lucene-analyzers-common-4.10.2.jar
77
77
  - classpath/lucene-core-4.10.2.jar
78
78
  - classpath/lucene-grouping-4.10.2.jar