embulk 0.8.0-java → 0.8.1-java

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: 55c8a96cd529ab0f895063f6d73c36522a96d0be
4
- data.tar.gz: 6d416a8b3f768a941a5a386107d70893afff1509
3
+ metadata.gz: 811d87a7f7729cc533a84da4300355918eeaa251
4
+ data.tar.gz: 980c4dbe0eb15a13ca1fec8490fd22d8ee669694
5
5
  SHA512:
6
- metadata.gz: fb9a45ea1d54286c3626ab98055783043b439e6a0e34380d3431cc8ef30bb3cb7f7043f70714f2929ef10421acc5bfdf795f05b481a419896a93efa17a5da535
7
- data.tar.gz: 8947eb80b213318118325705087655d33c05b53a5861dccfc8d79d0be16f6c01612755bc6daed6a2f17790dcbadbed80d22653877a245ca434f171ca90869658
6
+ metadata.gz: ce0ad08275891531774570de157084c0c4027e6bb1c37be9761d1bc72ed4846334fc692be83ac14f47f4e79d73559d65130e585af0094729b23f5fd5ee8c6ed5
7
+ data.tar.gz: 3efa329206f77fc0b42e414d4c9cbe1bd5b486f6554f03c94e29691b0625dc8ad71b8b08625cd57043f4bee5e61972dd3ba09e4fcf47f460a792cd8ddcf8b6b6
@@ -16,7 +16,7 @@ def release_projects = [project(":embulk-core"), project(":embulk-standards")]
16
16
 
17
17
  allprojects {
18
18
  group = 'org.embulk'
19
- version = '0.8.0'
19
+ version = '0.8.1'
20
20
 
21
21
  ext {
22
22
  jrubyVersion = '9.0.4.0'
@@ -44,6 +44,7 @@ dependencies {
44
44
  compile 'com.ibm.icu:icu4j:54.1.1'
45
45
 
46
46
  gems 'rubygems:bundler:1.10.6'
47
+ gems 'rubygems:msgpack:0.7.4'
47
48
  gems 'rubygems:liquid:3.0.6'
48
49
  }
49
50
 
@@ -11,6 +11,7 @@ import org.embulk.spi.Schema;
11
11
  import org.embulk.spi.time.Timestamp;
12
12
  import org.embulk.spi.Page;
13
13
  import org.embulk.spi.util.Pages;
14
+ import org.msgpack.value.Value;
14
15
 
15
16
  public abstract class PreviewPrinter
16
17
  implements Closeable
@@ -68,6 +69,8 @@ public abstract class PreviewPrinter
68
69
  return obj.toString();
69
70
  } else if (obj instanceof Timestamp) {
70
71
  return obj.toString();
72
+ } else if (obj instanceof Value) {
73
+ return obj.toString();
71
74
  } else {
72
75
  return modelManager.writeObject(obj);
73
76
  }
@@ -9,6 +9,7 @@ import org.msgpack.core.buffer.MessageBuffer;
9
9
  import org.msgpack.value.Value;
10
10
  import org.jruby.Ruby;
11
11
  import org.jruby.RubyString;
12
+ import org.jruby.runtime.builtin.IRubyObject;
12
13
  import org.jruby.util.ByteList;
13
14
  import org.jcodings.specific.ASCIIEncoding;
14
15
 
@@ -52,4 +53,10 @@ public class RubyValueApi
52
53
  throw Throwables.propagate(ex);
53
54
  }
54
55
  }
56
+
57
+ public static Value toValue(Ruby runtime, IRubyObject object)
58
+ {
59
+ RubyString string = (RubyString) object.callMethod(runtime.getCurrentContext(), "to_msgpack");
60
+ return fromMessagePack(string);
61
+ }
55
62
  }
@@ -1,6 +1,7 @@
1
1
  package org.embulk.spi.util;
2
2
 
3
3
  import org.embulk.spi.time.Timestamp;
4
+ import org.msgpack.value.Value;
4
5
 
5
6
  public interface DynamicColumnSetter
6
7
  {
@@ -15,4 +16,6 @@ public interface DynamicColumnSetter
15
16
  void set(String value);
16
17
 
17
18
  void set(Timestamp value);
19
+
20
+ void set(Value value);
18
21
  }
@@ -12,6 +12,7 @@ import org.embulk.spi.PageBuilder;
12
12
  import org.embulk.spi.Column;
13
13
  import org.embulk.spi.util.DynamicColumnSetter;
14
14
  import org.embulk.spi.time.Timestamp;
15
+ import org.embulk.spi.json.RubyValueApi;
15
16
  import org.msgpack.value.Value;
16
17
 
17
18
  public abstract class AbstractDynamicColumnSetter
@@ -76,7 +77,7 @@ public abstract class AbstractDynamicColumnSetter
76
77
  int nano = (int) ((msec % 1000) * 1000000 + nsec % 1000000000);
77
78
  set(Timestamp.ofEpochSecond(sec, nano));
78
79
  } else {
79
- throw rubyObject.getRuntime().newTypeError("cannot convert instance of " + rubyObject.getMetaClass() + " to nil, true, false, Integer, Float, String, or Time");
80
+ set(RubyValueApi.toValue(rubyObject.getRuntime(), rubyObject));
80
81
  }
81
82
  }
82
83
  }
@@ -53,7 +53,7 @@ public class BooleanColumnSetter
53
53
  if (TRUE_STRINGS.contains(v)) {
54
54
  pageBuilder.setBoolean(column, true);
55
55
  } else {
56
- defaultValue.setDouble(pageBuilder, column);
56
+ defaultValue.setBoolean(pageBuilder, column);
57
57
  }
58
58
  }
59
59
 
@@ -66,6 +66,6 @@ public class BooleanColumnSetter
66
66
  @Override
67
67
  public void set(Value v)
68
68
  {
69
- pageBuilder.setJson(column, v);
69
+ defaultValue.setBoolean(pageBuilder, column);
70
70
  }
71
71
  }
@@ -63,6 +63,6 @@ public class DoubleColumnSetter
63
63
  @Override
64
64
  public void set(Value v)
65
65
  {
66
- pageBuilder.setJson(column, v);
66
+ defaultValue.setDouble(pageBuilder, column);
67
67
  }
68
68
  }
@@ -67,12 +67,12 @@ public class LongColumnSetter
67
67
  @Override
68
68
  public void set(Timestamp v)
69
69
  {
70
- pageBuilder.setDouble(column, v.getEpochSecond());
70
+ pageBuilder.setLong(column, v.getEpochSecond());
71
71
  }
72
72
 
73
73
  @Override
74
74
  public void set(Value v)
75
75
  {
76
- pageBuilder.setJson(column, v);
76
+ defaultValue.setLong(pageBuilder, column);
77
77
  }
78
78
  }
@@ -58,6 +58,6 @@ public class StringColumnSetter
58
58
  @Override
59
59
  public void set(Value v)
60
60
  {
61
- pageBuilder.setJson(column, v);
61
+ pageBuilder.setString(column, v.toJson());
62
62
  }
63
63
  }
@@ -67,6 +67,6 @@ public class TimestampColumnSetter
67
67
  @Override
68
68
  public void set(Value v)
69
69
  {
70
- pageBuilder.setJson(column, v);
70
+ defaultValue.setTimestamp(pageBuilder, column);
71
71
  }
72
72
  }
@@ -4,6 +4,7 @@ Release Notes
4
4
  .. toctree::
5
5
  :maxdepth: 1
6
6
 
7
+ release/release-0.8.1
7
8
  release/release-0.8.0
8
9
  release/release-0.7.10
9
10
  release/release-0.7.9
@@ -1,28 +1,32 @@
1
1
  Release 0.8.0
2
2
  ==================================
3
3
 
4
- General Changes
4
+ JSON type
5
5
  ------------------
6
6
 
7
- * Added JSON type support.
7
+ Embulk v0.8.0 added JSON type support.
8
+
9
+ * A column with ``json`` type can represent nested values such as maps or arrays. This is useful when both input and output support dynamically-typed values.
8
10
 
9
- * A column with ``json`` type can represent nested values such as maps or arrays. This is useful when both input and output support dynamically-typed values.
11
+ * **IMPORTANT**: If input plugin uses JSON type but output plugin is compiled with an old embulk (< 0.8.0), a bulk load transaction fails with a confusing error message. To avoid this issue, please run ``embulk migrate /path/to/embulk-plugin-directory`` to upgrade plugin code, and use the latest plugin. This problem doesn't happen if input plugin doesn't use json type.
10
12
 
11
- * **IMPORTANT**: If input plugin uses JSON type but output plugin is compiled with an old embulk (< 0.8.0), a bulk load transaction fails with a confusing error message. To avoid this issue, please run ``embulk migrate /path/to/embulk-plugin-directory`` to upgrade plugin code, and use the latest plugin. This problem doesn't happen if input plugin doesn't use json type.
13
+ * Filter plugins to process JSON types are not ready yet. Expected plugins are for example, flatten a json column into statically-typed columns with guess plugin, extracting a value from a json column using an expression (such as JSONPath) and set it to another column, or building a json column by copying values from other columns.
12
14
 
13
- * Filter plugins to process JSON types are not ready yet. Expected plugins are for example, flatten a json column into statically-typed columns with guess plugin, extracting a value from a json column using an expression (such as JSONPath) and set it to another column, or building a json column by copying values from other columns.
15
+ Page scattering
16
+ ------------------
14
17
 
15
- * Local executor plugin (the default executor) runs multiple tasks even if there is only 1 input task. This improves performance a lot especially if input is a single huge file.
18
+ Local executor plugin (the default executor) runs multiple tasks even if there is only 1 input task. This improves performance a lot especially if input is a single huge file.
16
19
 
17
- * Its mechanism is that the executor creates 2, 3, 4, or more number of output tasks for each input task. Page chunks from a input task is scattered to output tasks. All of the tasks run in parallel using threads. This feature is called "page scattering".
20
+ * Its mechanism is that the executor creates 2, 3, 4, or more number of output tasks for each input task. Page chunks from a input task is scattered to output tasks. All of the tasks run in parallel using threads. This feature is called "page scattering".
18
21
 
19
- * Added ``min_output_tasks`` option at ``exec:`` section. Default is 1x of available CPU cores. Page scattering is enabled if number of input tasks is less than this ``min_output_tasks`` option. Setting larger number here is useful if embulk doesn't use multi-threading with enough concurrency due to too few number of input tasks.
22
+ * Added ``min_output_tasks`` option at ``exec:`` section. Default is 1x of available CPU cores. Page scattering is enabled if number of input tasks is less than this ``min_output_tasks`` option. Setting larger number here is useful if embulk doesn't use multi-threading with enough concurrency due to too few number of input tasks.
20
23
 
21
- * Added ``max_threads`` option at ``exec:`` section. Default is 2x of availalbe CPU cores. This option controls maximum concurrency. Setting smaller number here is useful if too many threads make the destination or source storage overloaded. Setting larger number here is useful if CPU utilization is too low due to high latency.
24
+ * Added ``max_threads`` option at ``exec:`` section. Default is 2x of availalbe CPU cores. This option controls maximum concurrency. Setting smaller number here is useful if too many threads make the destination or source storage overloaded. Setting larger number here is useful if CPU utilization is too low due to high latency.
22
25
 
23
- * The results of output transaction will be deterministic. There're no randomness that depends on timing. However, task assignment changes if ``min_output_tasks`` changes. If you need deterministic results regardless of machines that may have different number of CPU cores, please add ``min_output_tasks`` option to ``exec:`` section. Setting 1 there will disable page scattering completely.
26
+ * The results of output transaction will be deterministic. There're no randomness that depends on timing. However, task assignment changes if ``min_output_tasks`` changes. If you need deterministic results regardless of machines that may have different number of CPU cores, please add ``min_output_tasks`` option to ``exec:`` section. Setting 1 there will disable page scattering completely.
24
27
 
25
- * Upraded JRuby version to 9.0.4.0.
28
+ General Changes
29
+ ------------------
26
30
 
27
31
  * YAML configuration parser uses stricter rules when it converts type of a non-quoted strings.
28
32
 
@@ -32,6 +36,8 @@ General Changes
32
36
 
33
37
  * On, Off, Yes, and No (case-insensitive) will be a string instead of boolean. Only true, True, false, False are recognized as a boolean.
34
38
 
39
+ * Upraded JRuby version to 9.0.4.0.
40
+
35
41
  Java Plugin API
36
42
  ------------------
37
43
 
@@ -0,0 +1,18 @@
1
+ Release 0.8.1
2
+ ==================================
3
+
4
+ General Changes
5
+ ------------------
6
+
7
+ * Ruby-based plugins use ``>=`` instead of ``~>`` to depend on bundler and embulk so that users can use both older plugins and newer plugins together. This assumes major versions of those dependencies most likely don't break backward compatibility.
8
+
9
+ * Added bulit-in dependency to msgpack.gem v0.7.4 which is used to support json types at ruby plugins.
10
+
11
+ * Fixed json value creation using ruby-based parser and input plugins.
12
+
13
+ * Fixed preview of json types.
14
+
15
+
16
+ Release Date
17
+ ------------------
18
+ 2016-01-13
@@ -20,7 +20,8 @@ Gem::Specification.new do |gem|
20
20
  gem.has_rdoc = false
21
21
 
22
22
  if RUBY_PLATFORM =~ /java/i
23
- gem.add_dependency "bundler", '~> 1.10.6'
23
+ gem.add_dependency "bundler", '>= 1.10.6'
24
+ gem.add_dependency "msgpack", '~> 0.7.3'
24
25
  gem.add_dependency "liquid", '~> 3.0.6'
25
26
 
26
27
  # For embulk/guess/charset.rb. See also embulk-core/build.gradle
@@ -128,10 +128,12 @@ EOF
128
128
  if from_ver <= version("0.1.0")
129
129
  # add add_development_dependency
130
130
  migrator.insert_line("**/*.gemspec", /([ \t]*\w+)\.add_development_dependency/) {|m|
131
- "#{m[1]}.add_development_dependency 'embulk', ['~> #{Embulk::VERSION}']"
131
+ "#{m[1]}.add_development_dependency 'embulk', ['>= #{Embulk::VERSION}']"
132
132
  }
133
133
  else
134
- migrator.replace("**/*.gemspec", /add_(?:development_)?dependency\s+\W+embulk\W+\s+([\d\.]+)\W+/, Embulk::VERSION)
134
+ unless migrator.replace("**/*.gemspec", /add_(?:development_)?dependency\s+\W+embulk\W+\s*(\~\>\s*[\d\.]+)\W+/, ">= #{Embulk::VERSION}")
135
+ migrator.replace("**/*.gemspec", /add_(?:development_)?dependency\s+\W+embulk\W+\s*([\d\.]+)\W+/, Embulk::VERSION)
136
+ end
135
137
  end
136
138
  end
137
139
 
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.require_paths = ["lib"]
15
15
 
16
16
  #spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION']
17
- spec.add_development_dependency 'embulk', ['~> <%= Embulk::VERSION %>']
18
- spec.add_development_dependency 'bundler', ['~> 1.0']
17
+ spec.add_development_dependency 'embulk', ['>= <%= Embulk::VERSION %>']
18
+ spec.add_development_dependency 'bundler', ['>= 1.10.6']
19
19
  spec.add_development_dependency 'rake', ['>= 10.0']
20
20
  end
@@ -19,23 +19,23 @@ module Embulk::Java
19
19
 
20
20
  module SPI
21
21
  module Time
22
- include_package 'org.embulk.time'
22
+ include_package 'org.embulk.spi.time'
23
23
  end
24
24
 
25
25
  module Json
26
- include_package 'org.embulk.json'
26
+ include_package 'org.embulk.spi.json'
27
27
  end
28
28
 
29
29
  module Type
30
- include_package 'org.embulk.type'
30
+ include_package 'org.embulk.spi.type'
31
31
  end
32
32
 
33
33
  module Unit
34
- include_package 'org.embulk.unit'
34
+ include_package 'org.embulk.spi.unit'
35
35
  end
36
36
 
37
37
  module Util
38
- include_package 'org.embulk.util'
38
+ include_package 'org.embulk.spi.util'
39
39
  end
40
40
 
41
41
  include_package 'org.embulk.spi'
@@ -6,6 +6,7 @@ module Embulk
6
6
 
7
7
  class PageBuilder
8
8
  def initialize(schema, java_page_output)
9
+ require 'msgpack' # used at DynamicPageBuilder.set(Value)
9
10
  # TODO get task as an argument
10
11
  task = Java::SPI::Exec.newConfigSource.load_config(Java::DynamicPageBuilder::BuilderTask.java_class)
11
12
  @page_builder = Java::DynamicPageBuilder.new(task, Java::Injected::BufferAllocator, schema.to_java, java_page_output)
@@ -1,3 +1,3 @@
1
1
  module Embulk
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: java
6
6
  authors:
7
7
  - Sadayuki Furuhashi
@@ -14,16 +14,30 @@ dependencies:
14
14
  name: bundler
15
15
  version_requirements: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.10.6
20
20
  requirement: !ruby/object:Gem::Requirement
21
21
  requirements:
22
- - - "~>"
22
+ - - ">="
23
23
  - !ruby/object:Gem::Version
24
24
  version: 1.10.6
25
25
  prerelease: false
26
26
  type: :runtime
27
+ - !ruby/object:Gem::Dependency
28
+ name: msgpack
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.7.3
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - "~>"
37
+ - !ruby/object:Gem::Version
38
+ version: 0.7.3
39
+ prerelease: false
40
+ type: :runtime
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: liquid
29
43
  version_requirements: !ruby/object:Gem::Requirement
@@ -133,8 +147,8 @@ files:
133
147
  - classpath/bval-jsr303-0.5.jar
134
148
  - classpath/commons-beanutils-core-1.8.3.jar
135
149
  - classpath/commons-lang3-3.1.jar
136
- - classpath/embulk-core-0.8.0.jar
137
- - classpath/embulk-standards-0.8.0.jar
150
+ - classpath/embulk-core-0.8.1.jar
151
+ - classpath/embulk-standards-0.8.1.jar
138
152
  - classpath/guava-18.0.jar
139
153
  - classpath/guice-4.0.jar
140
154
  - classpath/guice-bootstrap-0.1.1.jar
@@ -444,6 +458,7 @@ files:
444
458
  - embulk-docs/src/release/release-0.7.8.rst
445
459
  - embulk-docs/src/release/release-0.7.9.rst
446
460
  - embulk-docs/src/release/release-0.8.0.rst
461
+ - embulk-docs/src/release/release-0.8.1.rst
447
462
  - embulk-standards/build.gradle
448
463
  - embulk-standards/src/main/java/org/embulk/standards/CsvFormatterPlugin.java
449
464
  - embulk-standards/src/main/java/org/embulk/standards/CsvParserPlugin.java