embulk 0.6.18 → 0.6.19

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: ff085042dbecce04ca4a8095c59802bc4336a67e
4
- data.tar.gz: aab28c9c0d9ae11a758ba6148baa12a8973e7903
3
+ metadata.gz: 0525d84746ae3f0cbd2839f3b6447063fc8f72ed
4
+ data.tar.gz: ea6a6a7c3a2a74b05466b5c1170239a6f32d0fa3
5
5
  SHA512:
6
- metadata.gz: bace1db62e73980869cbf11118be290cdcacda974473bb6e334fbb0075bbbdcf8dec7096cff6f35c8de185baa67b6f5efee498e13d974183a5ec15a7ab9bf0db
7
- data.tar.gz: 2d1e67648bc4eec548433c69f147e70647fe958d53c15234af3df6289e562a2aaa2e1d49bc9342204f83f6718f2965fa9b7713e5a415bb3e733d3a32e9fcdeac
6
+ metadata.gz: b5972147aab6f9e81cbdd13eb536ffbbdee7dfcff9ee32122b90a76e3e41756fd144f709f6bbbd22d603a57c613e86c671f135903528f0c94beccea70066d0a1
7
+ data.tar.gz: 10383e3a6a6362decade2631ad9b365455be007e9600c97e4564f3a7df2a9556f7356985ea45975a37bbc2c612a3255c79a1ae11657084fa78a643b345625722
data/README.md CHANGED
@@ -121,6 +121,14 @@ embulk run -b ./embulk_bundle ...
121
121
 
122
122
  For further details, visit [Embulk documentation](http://www.embulk.org/docs/).
123
123
 
124
+ ## Upgrading to the latest version
125
+
126
+ Following command updates embulk itself to the latest released version.
127
+
128
+ ```sh
129
+ embulk selfupdate
130
+ ```
131
+
124
132
  ## Embulk Development
125
133
 
126
134
  ### Build
data/build.gradle CHANGED
@@ -11,7 +11,7 @@ def release_projects = [project(":embulk-core"), project(":embulk-standards")]
11
11
 
12
12
  allprojects {
13
13
  group = 'org.embulk'
14
- version = '0.6.18'
14
+ version = '0.6.19'
15
15
 
16
16
  ext {
17
17
  jrubyVersion = '1.7.19'
@@ -11,22 +11,18 @@ import org.embulk.exec.ExtensionServiceLoaderModule;
11
11
  import org.embulk.plugin.PluginClassLoaderModule;
12
12
  import org.embulk.plugin.BuiltinPluginSourceModule;
13
13
  import org.embulk.jruby.JRubyScriptingModule;
14
+ import static com.google.common.base.Preconditions.checkState;
14
15
 
15
16
  public class EmbulkService
16
17
  {
17
- protected final Injector injector;
18
+ private final ConfigSource systemConfig;
19
+
20
+ protected Injector injector;
21
+ private boolean initialized;
18
22
 
19
23
  public EmbulkService(ConfigSource systemConfig)
20
24
  {
21
- ImmutableList.Builder<Module> modules = ImmutableList.builder();
22
- modules.add(new SystemConfigModule(systemConfig));
23
- modules.add(new ExecModule());
24
- modules.add(new ExtensionServiceLoaderModule(systemConfig));
25
- modules.add(new PluginClassLoaderModule(systemConfig));
26
- modules.add(new BuiltinPluginSourceModule());
27
- modules.add(new JRubyScriptingModule(systemConfig));
28
- modules.addAll(getAdditionalModules(systemConfig));
29
- injector = Guice.createInjector(modules.build());
25
+ this.systemConfig = systemConfig;
30
26
  }
31
27
 
32
28
  protected Iterable<? extends Module> getAdditionalModules(ConfigSource systemConfig)
@@ -34,8 +30,40 @@ public class EmbulkService
34
30
  return ImmutableList.of();
35
31
  }
36
32
 
37
- public Injector getInjector()
33
+ protected Iterable<? extends Module> overrideModules(Iterable<? extends Module> modules, ConfigSource systemConfig)
34
+ {
35
+ return modules;
36
+ }
37
+
38
+ public Injector initialize()
38
39
  {
40
+ checkState(!initialized, "Already initialized");
41
+
42
+ ImmutableList.Builder<Module> builder = ImmutableList.builder();
43
+ builder.add(new SystemConfigModule(systemConfig));
44
+ builder.add(new ExecModule());
45
+ builder.add(new ExtensionServiceLoaderModule(systemConfig));
46
+ builder.add(new PluginClassLoaderModule(systemConfig));
47
+ builder.add(new BuiltinPluginSourceModule());
48
+ builder.add(new JRubyScriptingModule(systemConfig));
49
+
50
+ builder.addAll(getAdditionalModules(systemConfig));
51
+
52
+ Iterable<? extends Module> modules = builder.build();
53
+ modules = overrideModules(modules, systemConfig);
54
+
55
+ injector = Guice.createInjector(modules);
56
+ initialized = true;
57
+
39
58
  return injector;
40
59
  }
60
+
61
+ @Deprecated
62
+ public synchronized Injector getInjector()
63
+ {
64
+ if (initialized) {
65
+ return injector;
66
+ }
67
+ return initialize();
68
+ }
41
69
  }
@@ -67,7 +67,7 @@ public class Runner
67
67
  this.systemConfig = new ConfigLoader(bootstrapModelManager).fromPropertiesYamlLiteral(System.getProperties(), "embulk.");
68
68
  mergeOptionsToSystemConfig(options, systemConfig);
69
69
  this.service = new EmbulkService(systemConfig);
70
- this.injector = service.getInjector();
70
+ this.injector = service.initialize();
71
71
  }
72
72
 
73
73
  @SuppressWarnings("unchecked")
@@ -0,0 +1,54 @@
1
+ package org.embulk.spi.unit;
2
+
3
+ import com.google.common.base.Optional;
4
+ import com.fasterxml.jackson.databind.JsonNode;
5
+ import com.fasterxml.jackson.databind.JsonMappingException;
6
+ import com.fasterxml.jackson.databind.node.NullNode;
7
+ import com.fasterxml.jackson.annotation.JsonCreator;
8
+ import com.fasterxml.jackson.annotation.JsonValue;
9
+
10
+ public class ToString
11
+ {
12
+ private final String string;
13
+
14
+ public ToString(String string)
15
+ {
16
+ this.string = string;
17
+ }
18
+
19
+ @JsonCreator
20
+ public ToString(Optional<JsonNode> option) throws JsonMappingException
21
+ {
22
+ JsonNode node = option.or(NullNode.getInstance());
23
+ if (node.isTextual()) {
24
+ this.string = node.textValue();
25
+ } else if (node.isValueNode()) {
26
+ this.string = node.toString();
27
+ } else {
28
+ throw new JsonMappingException(String.format("Arrays and objects are invalid: '%s'", node));
29
+ }
30
+ }
31
+
32
+ @Override
33
+ public boolean equals(Object obj)
34
+ {
35
+ if (!(obj instanceof ToString)) {
36
+ return false;
37
+ }
38
+ ToString o = (ToString) obj;
39
+ return string.equals(o.string);
40
+ }
41
+
42
+ @Override
43
+ public int hashCode()
44
+ {
45
+ return string.hashCode();
46
+ }
47
+
48
+ @JsonValue
49
+ @Override
50
+ public String toString()
51
+ {
52
+ return string;
53
+ }
54
+ }
@@ -0,0 +1,35 @@
1
+ package org.embulk.spi.unit;
2
+
3
+ import java.util.Map;
4
+ import java.util.HashMap;
5
+ import java.util.Properties;
6
+ import com.google.common.base.Function;
7
+ import com.google.common.collect.Maps;
8
+ import com.fasterxml.jackson.annotation.JsonCreator;
9
+ import com.fasterxml.jackson.annotation.JsonValue;
10
+
11
+ public class ToStringMap
12
+ extends HashMap<String, String>
13
+ {
14
+ @JsonCreator
15
+ public ToStringMap(Map<String, ToString> map)
16
+ {
17
+ super(Maps.transformValues(map, new Function<ToString, String>() {
18
+ public String apply(ToString value)
19
+ {
20
+ if (value == null) {
21
+ return "null";
22
+ } else {
23
+ return value.toString();
24
+ }
25
+ }
26
+ }));
27
+ }
28
+
29
+ public Properties toProperties()
30
+ {
31
+ Properties props = new Properties();
32
+ props.putAll(this);
33
+ return props;
34
+ }
35
+ }
@@ -4,6 +4,7 @@ Release Notes
4
4
  .. toctree::
5
5
  :maxdepth: 1
6
6
 
7
+ release/release-0.6.19
7
8
  release/release-0.6.18
8
9
  release/release-0.6.17
9
10
  release/release-0.6.16
@@ -0,0 +1,18 @@
1
+ Release 0.6.19
2
+ ==================================
3
+
4
+ Java Plugin API
5
+ ------------------
6
+
7
+ * Added spi.unit.ToStringMap utility class which can be used as a field type of a Task class. ToStringMap is a ``Map<String,String>`` but also accepts non-string values and converts it to string. This fuzzy behavior is useful for options such as ``options``.
8
+
9
+
10
+ Embulk Embed API
11
+ ------------------
12
+
13
+ * EmbulkService supports ``overrideModules`` method so that applications can use ``Modules.override`` to override specific injections.
14
+
15
+
16
+ Release Date
17
+ ------------------
18
+ 2015-07-23
@@ -1,3 +1,3 @@
1
1
  module Embulk
2
- VERSION = '0.6.18'
2
+ VERSION = '0.6.19'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.18
4
+ version: 0.6.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-22 00:00:00.000000000 Z
11
+ date: 2015-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -222,6 +222,8 @@ files:
222
222
  - embulk-core/src/main/java/org/embulk/spi/unit/ByteSize.java
223
223
  - embulk-core/src/main/java/org/embulk/spi/unit/LocalFile.java
224
224
  - embulk-core/src/main/java/org/embulk/spi/unit/LocalFileSerDe.java
225
+ - embulk-core/src/main/java/org/embulk/spi/unit/ToString.java
226
+ - embulk-core/src/main/java/org/embulk/spi/unit/ToStringMap.java
225
227
  - embulk-core/src/main/java/org/embulk/spi/util/CharsetSerDe.java
226
228
  - embulk-core/src/main/java/org/embulk/spi/util/Decoders.java
227
229
  - embulk-core/src/main/java/org/embulk/spi/util/DynamicColumnNotFoundException.java
@@ -335,6 +337,7 @@ files:
335
337
  - embulk-docs/src/release/release-0.6.16.rst
336
338
  - embulk-docs/src/release/release-0.6.17.rst
337
339
  - embulk-docs/src/release/release-0.6.18.rst
340
+ - embulk-docs/src/release/release-0.6.19.rst
338
341
  - embulk-docs/src/release/release-0.6.2.rst
339
342
  - embulk-docs/src/release/release-0.6.3.rst
340
343
  - embulk-docs/src/release/release-0.6.4.rst
@@ -451,8 +454,8 @@ files:
451
454
  - classpath/bval-jsr303-0.5.jar
452
455
  - classpath/commons-beanutils-core-1.8.3.jar
453
456
  - classpath/commons-lang3-3.1.jar
454
- - classpath/embulk-core-0.6.18.jar
455
- - classpath/embulk-standards-0.6.18.jar
457
+ - classpath/embulk-core-0.6.19.jar
458
+ - classpath/embulk-standards-0.6.19.jar
456
459
  - classpath/guava-18.0.jar
457
460
  - classpath/guice-4.0.jar
458
461
  - classpath/guice-multibindings-4.0.jar