embulk-output-elasticsearch 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/build.gradle +1 -1
- data/src/main/java/org/embulk/output/ElasticsearchOutputPlugin.java +11 -7
- 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: 17a43eb01895594c2923a7390d4e8d09a1700cf9
|
4
|
+
data.tar.gz: c7c96752d024bc7db265dbbae1f6f512f0f040d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
@@ -57,12 +57,16 @@ public class ElasticsearchOutputPlugin
|
|
57
57
|
public int getPort();
|
58
58
|
}
|
59
59
|
|
60
|
-
public interface
|
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
|
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
|
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
|
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
|
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(
|
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
|
+
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-
|
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.
|
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
|