embulk 0.8.24-java → 0.8.25-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/build.gradle +1 -1
- data/embulk-cli/src/main/bat/selfrun.bat +4 -1
- data/embulk-core/src/main/java/org/embulk/exec/BulkLoader.java +1 -1
- data/embulk-core/src/main/java/org/embulk/jruby/JRubyPluginSource.java +6 -2
- data/embulk-core/src/main/java/org/embulk/plugin/DefaultPluginType.java +50 -0
- data/embulk-core/src/main/java/org/embulk/plugin/InjectedPluginSource.java +5 -1
- data/embulk-core/src/main/java/org/embulk/plugin/MavenPluginType.java +97 -0
- data/embulk-core/src/main/java/org/embulk/plugin/PluginSource.java +43 -0
- data/embulk-core/src/main/java/org/embulk/plugin/PluginType.java +95 -21
- data/embulk-core/src/test/java/org/embulk/plugin/TestPluginType.java +45 -4
- data/embulk-core/src/test/java/org/embulk/plugin/TestPluginTypeSerDe.java +50 -0
- data/embulk-docs/src/release.rst +1 -0
- data/embulk-docs/src/release/release-0.8.25.rst +14 -0
- data/embulk-standards/src/main/java/org/embulk/standards/StandardPluginModule.java +5 -5
- data/lib/embulk/command/embulk_bundle.rb +3 -2
- data/lib/embulk/version.rb +1 -1
- metadata +33 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2368360f1531d901df3fb7f5d0fe6069ad3362c
|
4
|
+
data.tar.gz: ef5f5347e9cfabb4ea31d9e29fd69695c9d4ebe4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af58995886e862f1cc30dcbe23813da71f72bd443eb4b9af62584ff5c4aa49ab85a6c53d717e3258f331020e28f4e7b2ff9701c1fde24f1e58d93bff89705387
|
7
|
+
data.tar.gz: 791c332fcac833460e2a5458d72d8f937ec5881af769fe4100f1b30e225e7b6ed4db0c058f0eec5274f8d3cef56f86a73ff79e95d1987f5f479ad56330f77135
|
data/build.gradle
CHANGED
@@ -2,7 +2,10 @@
|
|
2
2
|
|
3
3
|
setlocal
|
4
4
|
|
5
|
+
rem Do not use %0 to identify the JAR (bat) file.
|
6
|
+
rem %0 is just "embulk" when run by just "> embulk" while %0 is "embulk.bat" when run by "> embulk.bat".
|
5
7
|
set this=%~f0
|
8
|
+
|
6
9
|
set java_args=
|
7
10
|
set jruby_args=
|
8
11
|
set default_optimize=
|
@@ -76,7 +79,7 @@ endlocal && set BUNDLE_GEMFILE=%bundle_gemfile%
|
|
76
79
|
setlocal enabledelayedexpansion
|
77
80
|
|
78
81
|
if not defined EMBULK_BUNDLE_PATH (
|
79
|
-
for /f "delims=" %%w in ('java -cp %
|
82
|
+
for /f "delims=" %%w in ('java -cp %this% org.jruby.Main -e "print RbConfig::CONFIG['ruby_version']"') do set ruby_version=%%w
|
80
83
|
set gem_home=%USERPROFILE%\.embulk\jruby\!ruby_version!
|
81
84
|
) else (
|
82
85
|
set gem_home=
|
@@ -528,7 +528,7 @@ public class BulkLoader
|
|
528
528
|
private ExecutorPlugin newExecutorPlugin(BulkLoaderTask task)
|
529
529
|
{
|
530
530
|
return Exec.newPlugin(ExecutorPlugin.class,
|
531
|
-
task.getExecConfig().get(PluginType.class, "type",
|
531
|
+
task.getExecConfig().get(PluginType.class, "type", PluginType.LOCAL));
|
532
532
|
}
|
533
533
|
|
534
534
|
private ExecutionResult doRun(ConfigSource config)
|
@@ -36,9 +36,13 @@ public class JRubyPluginSource
|
|
36
36
|
|
37
37
|
public <T> T newPlugin(Class<T> iface, PluginType type) throws PluginSourceNotMatchException
|
38
38
|
{
|
39
|
-
|
39
|
+
if (type.getSourceType() != PluginSource.Type.DEFAULT) {
|
40
|
+
throw new PluginSourceNotMatchException();
|
41
|
+
}
|
42
|
+
|
43
|
+
final String name = type.getName();
|
40
44
|
|
41
|
-
String category;
|
45
|
+
final String category;
|
42
46
|
if (InputPlugin.class.isAssignableFrom(iface)) {
|
43
47
|
category = "input";
|
44
48
|
} else if (OutputPlugin.class.isAssignableFrom(iface)) {
|
@@ -0,0 +1,50 @@
|
|
1
|
+
package org.embulk.plugin;
|
2
|
+
|
3
|
+
import com.fasterxml.jackson.annotation.JsonValue;
|
4
|
+
import java.util.Objects;
|
5
|
+
|
6
|
+
public final class DefaultPluginType
|
7
|
+
extends PluginType
|
8
|
+
{
|
9
|
+
private DefaultPluginType(final String name)
|
10
|
+
{
|
11
|
+
super("default", name);
|
12
|
+
}
|
13
|
+
|
14
|
+
public static PluginType create(final String name)
|
15
|
+
{
|
16
|
+
if (name == null) {
|
17
|
+
throw new NullPointerException("name must not be null");
|
18
|
+
}
|
19
|
+
return new DefaultPluginType(name);
|
20
|
+
}
|
21
|
+
|
22
|
+
@JsonValue
|
23
|
+
public final String getJsonValue()
|
24
|
+
{
|
25
|
+
return this.getName();
|
26
|
+
}
|
27
|
+
|
28
|
+
@Override
|
29
|
+
public final int hashCode()
|
30
|
+
{
|
31
|
+
return Objects.hash(getSourceType(), getName());
|
32
|
+
}
|
33
|
+
|
34
|
+
@Override
|
35
|
+
public final boolean equals(final Object objectOther)
|
36
|
+
{
|
37
|
+
if (!(objectOther instanceof DefaultPluginType)) {
|
38
|
+
return false;
|
39
|
+
}
|
40
|
+
final DefaultPluginType other = (DefaultPluginType) objectOther;
|
41
|
+
return (this.getSourceType().equals(other.getSourceType()) &&
|
42
|
+
this.getName().equals(other.getName()));
|
43
|
+
}
|
44
|
+
|
45
|
+
@Override
|
46
|
+
public final String toString()
|
47
|
+
{
|
48
|
+
return this.getName();
|
49
|
+
}
|
50
|
+
}
|
@@ -44,7 +44,11 @@ public class InjectedPluginSource
|
|
44
44
|
|
45
45
|
public <T> T newPlugin(Class<T> iface, PluginType type) throws PluginSourceNotMatchException
|
46
46
|
{
|
47
|
-
|
47
|
+
if (type.getSourceType() != PluginSource.Type.DEFAULT) {
|
48
|
+
throw new PluginSourceNotMatchException();
|
49
|
+
}
|
50
|
+
|
51
|
+
final String name = type.getName();
|
48
52
|
try {
|
49
53
|
@SuppressWarnings("unchecked")
|
50
54
|
PluginFactory<T> factory = (PluginFactory<T>) injector.getInstance(
|
@@ -0,0 +1,97 @@
|
|
1
|
+
package org.embulk.plugin;
|
2
|
+
|
3
|
+
import com.fasterxml.jackson.annotation.JsonProperty;
|
4
|
+
import com.fasterxml.jackson.annotation.JsonValue;
|
5
|
+
import java.util.Collections;
|
6
|
+
import java.util.HashMap;
|
7
|
+
import java.util.Map;
|
8
|
+
import java.util.Objects;
|
9
|
+
|
10
|
+
public final class MavenPluginType
|
11
|
+
extends PluginType
|
12
|
+
{
|
13
|
+
private MavenPluginType(final String name, final String group, final String version)
|
14
|
+
{
|
15
|
+
super("maven", name);
|
16
|
+
this.group = group;
|
17
|
+
this.version = version;
|
18
|
+
|
19
|
+
final StringBuilder fullNameBuilder = new StringBuilder();
|
20
|
+
fullNameBuilder.append("maven:");
|
21
|
+
fullNameBuilder.append(group);
|
22
|
+
fullNameBuilder.append(":");
|
23
|
+
fullNameBuilder.append(name);
|
24
|
+
fullNameBuilder.append(":");
|
25
|
+
fullNameBuilder.append(version);
|
26
|
+
this.fullName = fullNameBuilder.toString();
|
27
|
+
|
28
|
+
final HashMap<String, String> fullMapMutable = new HashMap<String, String>();
|
29
|
+
fullMapMutable.put("source", "maven");
|
30
|
+
fullMapMutable.put("name", name);
|
31
|
+
fullMapMutable.put("group", group);
|
32
|
+
fullMapMutable.put("version", version);
|
33
|
+
this.fullMap = Collections.unmodifiableMap(fullMapMutable);
|
34
|
+
}
|
35
|
+
|
36
|
+
public static MavenPluginType create(final String name, final String group, final String version)
|
37
|
+
{
|
38
|
+
if (name == null) {
|
39
|
+
throw new NullPointerException("\"name\" must not present.");
|
40
|
+
}
|
41
|
+
return new MavenPluginType(name, group, version);
|
42
|
+
}
|
43
|
+
|
44
|
+
@JsonValue
|
45
|
+
public final Map<String, String> getJsonValue()
|
46
|
+
{
|
47
|
+
return this.fullMap;
|
48
|
+
}
|
49
|
+
|
50
|
+
@JsonProperty("group")
|
51
|
+
public final String getGroup()
|
52
|
+
{
|
53
|
+
return this.group;
|
54
|
+
}
|
55
|
+
|
56
|
+
@JsonProperty("version")
|
57
|
+
public final String getVersion()
|
58
|
+
{
|
59
|
+
return this.version;
|
60
|
+
}
|
61
|
+
|
62
|
+
public final String getFullName()
|
63
|
+
{
|
64
|
+
return this.fullName;
|
65
|
+
}
|
66
|
+
|
67
|
+
@Override
|
68
|
+
public final int hashCode()
|
69
|
+
{
|
70
|
+
return Objects.hash(getSourceType(), getName(), this.group, this.version);
|
71
|
+
}
|
72
|
+
|
73
|
+
@Override
|
74
|
+
public boolean equals(Object objectOther)
|
75
|
+
{
|
76
|
+
if (!(objectOther instanceof MavenPluginType)) {
|
77
|
+
return false;
|
78
|
+
}
|
79
|
+
MavenPluginType other = (MavenPluginType) objectOther;
|
80
|
+
return (this.getSourceType().equals(other.getSourceType()) &&
|
81
|
+
this.getName().equals(other.getName()) &&
|
82
|
+
this.getGroup().equals(other.getGroup()) &&
|
83
|
+
this.getVersion().equals(other.getVersion()));
|
84
|
+
}
|
85
|
+
|
86
|
+
@JsonValue
|
87
|
+
@Override
|
88
|
+
public String toString()
|
89
|
+
{
|
90
|
+
return this.fullName;
|
91
|
+
}
|
92
|
+
|
93
|
+
private final String group;
|
94
|
+
private final String version;
|
95
|
+
private final String fullName;
|
96
|
+
private final Map<String, String> fullMap;
|
97
|
+
}
|
@@ -1,6 +1,49 @@
|
|
1
1
|
package org.embulk.plugin;
|
2
2
|
|
3
|
+
import java.util.Collections;
|
4
|
+
import java.util.HashMap;
|
5
|
+
import java.util.Map;
|
6
|
+
|
3
7
|
public interface PluginSource
|
4
8
|
{
|
5
9
|
<T> T newPlugin(Class<T> iface, PluginType type) throws PluginSourceNotMatchException;
|
10
|
+
|
11
|
+
public enum Type
|
12
|
+
{
|
13
|
+
DEFAULT("default"), // DEFAULT includes InjectedPluginSource and JRubyPluginSource.
|
14
|
+
MAVEN("maven"),
|
15
|
+
;
|
16
|
+
|
17
|
+
private Type(final String sourceTypeName)
|
18
|
+
{
|
19
|
+
this.sourceTypeName = sourceTypeName;
|
20
|
+
}
|
21
|
+
|
22
|
+
public static Type of(final String sourceTypeName)
|
23
|
+
{
|
24
|
+
final Type found = MAP_FROM_STRING.get(sourceTypeName);
|
25
|
+
if (found == null) {
|
26
|
+
throw new IllegalArgumentException("\"" + sourceTypeName + "\" is not a plugin source.");
|
27
|
+
}
|
28
|
+
return found;
|
29
|
+
}
|
30
|
+
|
31
|
+
@Override
|
32
|
+
public final String toString()
|
33
|
+
{
|
34
|
+
return this.sourceTypeName;
|
35
|
+
}
|
36
|
+
|
37
|
+
static
|
38
|
+
{
|
39
|
+
final HashMap<String, Type> mapToBuild = new HashMap<String, Type>();
|
40
|
+
for (Type type : values()) {
|
41
|
+
mapToBuild.put(type.sourceTypeName, type);
|
42
|
+
}
|
43
|
+
MAP_FROM_STRING = Collections.unmodifiableMap(mapToBuild);
|
44
|
+
}
|
45
|
+
|
46
|
+
private static final Map<String, Type> MAP_FROM_STRING;
|
47
|
+
private final String sourceTypeName;
|
48
|
+
}
|
6
49
|
}
|
@@ -1,47 +1,121 @@
|
|
1
1
|
package org.embulk.plugin;
|
2
2
|
|
3
3
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
4
|
-
import com.fasterxml.jackson.annotation.
|
4
|
+
import com.fasterxml.jackson.annotation.JsonProperty;
|
5
|
+
import com.fasterxml.jackson.databind.JsonNode;
|
6
|
+
import com.fasterxml.jackson.databind.node.ContainerNode;
|
7
|
+
import com.fasterxml.jackson.databind.node.ObjectNode;
|
8
|
+
import com.fasterxml.jackson.databind.node.TextNode;
|
9
|
+
import com.google.common.annotations.VisibleForTesting;
|
10
|
+
import java.util.HashMap;
|
11
|
+
import java.util.Iterator;
|
12
|
+
import java.util.Map;
|
5
13
|
|
6
|
-
public class PluginType
|
14
|
+
public abstract class PluginType
|
7
15
|
{
|
8
|
-
|
16
|
+
public static final PluginType LOCAL = DefaultPluginType.create("local");
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Constructs {@code PluginType}.
|
20
|
+
*
|
21
|
+
* The constructor is {@code protected} to be called from subclasses, e.g. {@code DefaultPluginType}.
|
22
|
+
*/
|
23
|
+
protected PluginType(final String source, final String name)
|
24
|
+
{
|
25
|
+
this.sourceType = PluginSource.Type.of(source);
|
26
|
+
this.name = name;
|
27
|
+
}
|
9
28
|
|
10
|
-
// TODO accept isObject()/ObjectNode for complex PluginSource
|
11
29
|
@JsonCreator
|
12
|
-
|
30
|
+
private static PluginType create(final JsonNode typeJson)
|
31
|
+
{
|
32
|
+
if (typeJson.isTextual()) {
|
33
|
+
return createFromString(((TextNode) typeJson).textValue());
|
34
|
+
}
|
35
|
+
else if (typeJson.isObject()) {
|
36
|
+
final HashMap<String, String> stringMap = new HashMap<String, String>();
|
37
|
+
final ObjectNode typeObject = (ObjectNode) typeJson;
|
38
|
+
final Iterator<Map.Entry<String, JsonNode>> fieldIterator = typeObject.fields();
|
39
|
+
while (fieldIterator.hasNext()) {
|
40
|
+
final Map.Entry<String, JsonNode> field = fieldIterator.next();
|
41
|
+
final JsonNode fieldValue = field.getValue();
|
42
|
+
if (fieldValue instanceof ContainerNode) {
|
43
|
+
throw new IllegalArgumentException("\"type\" must be a string or a 1-depth mapping.");
|
44
|
+
}
|
45
|
+
stringMap.put(field.getKey(), fieldValue.textValue());
|
46
|
+
}
|
47
|
+
return createFromStringMap(stringMap);
|
48
|
+
}
|
49
|
+
else {
|
50
|
+
throw new IllegalArgumentException("\"type\" must be a string or a 1-depth mapping.");
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
private static PluginType createFromString(String name)
|
13
55
|
{
|
14
56
|
if (name == null) {
|
15
57
|
throw new NullPointerException("name must not be null");
|
16
58
|
}
|
17
|
-
|
59
|
+
return DefaultPluginType.create(name);
|
18
60
|
}
|
19
61
|
|
20
|
-
|
21
|
-
public String getName()
|
62
|
+
private static PluginType createFromStringMap(Map<String, String> stringMap)
|
22
63
|
{
|
23
|
-
|
64
|
+
final PluginSource.Type sourceType;
|
65
|
+
if (stringMap.containsKey("source")) {
|
66
|
+
sourceType = PluginSource.Type.of(stringMap.get("source"));
|
67
|
+
}
|
68
|
+
else {
|
69
|
+
sourceType = PluginSource.Type.DEFAULT;
|
70
|
+
}
|
71
|
+
|
72
|
+
switch (sourceType) {
|
73
|
+
case DEFAULT:
|
74
|
+
{
|
75
|
+
final String name = stringMap.get("name");
|
76
|
+
return createFromString(name);
|
77
|
+
}
|
78
|
+
case MAVEN:
|
79
|
+
{
|
80
|
+
final String name = stringMap.get("name");
|
81
|
+
final String group = stringMap.get("group");
|
82
|
+
final String version = stringMap.get("version");
|
83
|
+
return MavenPluginType.create(name, group, version);
|
84
|
+
}
|
85
|
+
default:
|
86
|
+
throw new IllegalArgumentException("\"source\" must be one of: [\"default\", \"maven\"]");
|
87
|
+
}
|
24
88
|
}
|
25
89
|
|
26
|
-
@
|
27
|
-
|
90
|
+
@VisibleForTesting
|
91
|
+
static PluginType createFromStringForTesting(final String name)
|
28
92
|
{
|
29
|
-
return name
|
93
|
+
return createFromString(name);
|
30
94
|
}
|
31
95
|
|
32
|
-
@
|
33
|
-
|
96
|
+
@VisibleForTesting
|
97
|
+
static PluginType createFromStringMapForTesting(final Map<String, String> stringMap)
|
34
98
|
{
|
35
|
-
|
36
|
-
return false;
|
37
|
-
}
|
38
|
-
PluginType o = (PluginType) other;
|
39
|
-
return name.equals(o.name);
|
99
|
+
return createFromStringMap(stringMap);
|
40
100
|
}
|
41
101
|
|
42
|
-
|
43
|
-
|
102
|
+
public final PluginSource.Type getSourceType()
|
103
|
+
{
|
104
|
+
return sourceType;
|
105
|
+
}
|
106
|
+
|
107
|
+
@JsonProperty("source")
|
108
|
+
public final String getSourceName()
|
109
|
+
{
|
110
|
+
return sourceType.toString();
|
111
|
+
}
|
112
|
+
|
113
|
+
@JsonProperty("name")
|
114
|
+
public final String getName()
|
44
115
|
{
|
45
116
|
return name;
|
46
117
|
}
|
118
|
+
|
119
|
+
private final PluginSource.Type sourceType;
|
120
|
+
private final String name;
|
47
121
|
}
|
@@ -1,7 +1,10 @@
|
|
1
1
|
package org.embulk.plugin;
|
2
2
|
|
3
3
|
import static org.junit.Assert.assertEquals;
|
4
|
+
import static org.junit.Assert.assertFalse;
|
5
|
+
import static org.junit.Assert.assertTrue;
|
4
6
|
|
7
|
+
import java.util.HashMap;
|
5
8
|
import org.junit.Test;
|
6
9
|
|
7
10
|
public class TestPluginType
|
@@ -9,10 +12,48 @@ public class TestPluginType
|
|
9
12
|
@Test
|
10
13
|
public void testEquals()
|
11
14
|
{
|
12
|
-
PluginType type =
|
13
|
-
|
15
|
+
PluginType type = PluginType.createFromStringForTesting("a");
|
16
|
+
assertTrue(type instanceof DefaultPluginType);
|
17
|
+
assertEquals(PluginSource.Type.DEFAULT, type.getSourceType());
|
18
|
+
assertTrue(type.equals(type));
|
14
19
|
|
15
|
-
|
16
|
-
|
20
|
+
assertTrue(type.equals(PluginType.createFromStringForTesting("a")));
|
21
|
+
assertFalse(type.equals(PluginType.createFromStringForTesting("b")));
|
22
|
+
}
|
23
|
+
|
24
|
+
@Test
|
25
|
+
public void testMapping1()
|
26
|
+
{
|
27
|
+
HashMap<String, String> mapping = new HashMap<String, String>();
|
28
|
+
mapping.put("source", "default");
|
29
|
+
mapping.put("name", "c");
|
30
|
+
|
31
|
+
PluginType type = PluginType.createFromStringMapForTesting(mapping);
|
32
|
+
assertTrue(type instanceof DefaultPluginType);
|
33
|
+
assertEquals(PluginSource.Type.DEFAULT, type.getSourceType());
|
34
|
+
assertTrue(type.equals(type));
|
35
|
+
|
36
|
+
assertTrue(type.equals(PluginType.createFromStringForTesting("c")));
|
37
|
+
assertFalse(type.equals(PluginType.createFromStringForTesting("d")));
|
38
|
+
}
|
39
|
+
|
40
|
+
@Test
|
41
|
+
public void testMapping2()
|
42
|
+
{
|
43
|
+
HashMap<String, String> mapping = new HashMap<String, String>();
|
44
|
+
mapping.put("source", "maven");
|
45
|
+
mapping.put("name", "e");
|
46
|
+
mapping.put("group", "org.embulk.foobar");
|
47
|
+
mapping.put("version", "0.1.2");
|
48
|
+
|
49
|
+
PluginType type = PluginType.createFromStringMapForTesting(mapping);
|
50
|
+
assertTrue(type instanceof MavenPluginType);
|
51
|
+
assertEquals(PluginSource.Type.MAVEN, type.getSourceType());
|
52
|
+
MavenPluginType mavenType = (MavenPluginType) type;
|
53
|
+
assertTrue(mavenType.equals(mavenType));
|
54
|
+
assertEquals("e", mavenType.getName());
|
55
|
+
assertEquals("org.embulk.foobar", mavenType.getGroup());
|
56
|
+
assertEquals("0.1.2", mavenType.getVersion());
|
57
|
+
assertEquals("maven:org.embulk.foobar:e:0.1.2", mavenType.getFullName());
|
17
58
|
}
|
18
59
|
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
package org.embulk.plugin;
|
2
|
+
|
3
|
+
import static org.junit.Assert.assertEquals;
|
4
|
+
import static org.junit.Assert.assertTrue;
|
5
|
+
|
6
|
+
import org.embulk.EmbulkTestRuntime;
|
7
|
+
import org.junit.Rule;
|
8
|
+
import org.junit.Test;
|
9
|
+
|
10
|
+
public class TestPluginTypeSerDe
|
11
|
+
{
|
12
|
+
@Rule
|
13
|
+
public EmbulkTestRuntime testRuntime = new EmbulkTestRuntime();
|
14
|
+
|
15
|
+
@Test
|
16
|
+
public void testParseTypeString()
|
17
|
+
{
|
18
|
+
PluginType pluginType = testRuntime.getModelManager().readObjectWithConfigSerDe(
|
19
|
+
PluginType.class,
|
20
|
+
"\"file\"");
|
21
|
+
assertTrue(pluginType instanceof DefaultPluginType);
|
22
|
+
assertEquals(PluginSource.Type.DEFAULT, pluginType.getSourceType());
|
23
|
+
assertEquals("file", pluginType.getName());
|
24
|
+
}
|
25
|
+
|
26
|
+
@Test
|
27
|
+
public void testParseTypeMapping()
|
28
|
+
{
|
29
|
+
PluginType pluginType = testRuntime.getModelManager().readObjectWithConfigSerDe(
|
30
|
+
PluginType.class,
|
31
|
+
"{ \"name\": \"dummy\" }");
|
32
|
+
assertTrue(pluginType instanceof DefaultPluginType);
|
33
|
+
assertEquals(PluginSource.Type.DEFAULT, pluginType.getSourceType());
|
34
|
+
assertEquals("dummy", pluginType.getName());
|
35
|
+
}
|
36
|
+
|
37
|
+
@Test
|
38
|
+
public void testParseTypeMaven()
|
39
|
+
{
|
40
|
+
PluginType pluginType = testRuntime.getModelManager().readObjectWithConfigSerDe(
|
41
|
+
PluginType.class,
|
42
|
+
"{ \"name\": \"foo\", \"source\": \"maven\", \"group\": \"org.embulk.bar\", \"version\": \"0.1.2\" }");
|
43
|
+
assertTrue(pluginType instanceof MavenPluginType);
|
44
|
+
assertEquals(PluginSource.Type.MAVEN, pluginType.getSourceType());
|
45
|
+
MavenPluginType mavenPluginType = (MavenPluginType) pluginType;
|
46
|
+
assertEquals(mavenPluginType.getName(), "foo");
|
47
|
+
assertEquals(mavenPluginType.getGroup(), "org.embulk.bar");
|
48
|
+
assertEquals(mavenPluginType.getVersion(), "0.1.2");
|
49
|
+
}
|
50
|
+
}
|
data/embulk-docs/src/release.rst
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
Release 0.8.25
|
2
|
+
==================================
|
3
|
+
|
4
|
+
General Changes
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Prepare for JAR/Maven-based pure-Java plugins [#666] [#669]
|
8
|
+
* Fix "could not find or load main class org.jruby.Main" when run as just "embulk" on Windows. [#676]
|
9
|
+
* Fix "NameError: undefined local variable or method `bundle_path_index' for main:Object" when using Bundler. [#681]
|
10
|
+
|
11
|
+
|
12
|
+
Release Date
|
13
|
+
------------------
|
14
|
+
2017-06-16
|
@@ -10,7 +10,7 @@ import org.embulk.spi.OutputPlugin;
|
|
10
10
|
import org.embulk.spi.ParserPlugin;
|
11
11
|
import org.embulk.spi.DecoderPlugin;
|
12
12
|
import org.embulk.spi.EncoderPlugin;
|
13
|
-
import org.embulk.plugin.
|
13
|
+
import org.embulk.plugin.DefaultPluginType;
|
14
14
|
import static org.embulk.plugin.InjectedPluginSource.registerPluginTo;
|
15
15
|
import static org.embulk.exec.GuessExecutor.registerDefaultGuessPluginTo;
|
16
16
|
|
@@ -50,10 +50,10 @@ public class StandardPluginModule
|
|
50
50
|
registerPluginTo(binder, FilterPlugin.class, "remove_columns", RemoveColumnsFilterPlugin.class);
|
51
51
|
|
52
52
|
// default guess plugins
|
53
|
-
registerDefaultGuessPluginTo(binder,
|
54
|
-
registerDefaultGuessPluginTo(binder,
|
55
|
-
registerDefaultGuessPluginTo(binder,
|
56
|
-
registerDefaultGuessPluginTo(binder,
|
53
|
+
registerDefaultGuessPluginTo(binder, DefaultPluginType.create("gzip"));
|
54
|
+
registerDefaultGuessPluginTo(binder, DefaultPluginType.create("bzip2"));
|
55
|
+
registerDefaultGuessPluginTo(binder, DefaultPluginType.create("json")); // should be registered before CsvGuessPlugin
|
56
|
+
registerDefaultGuessPluginTo(binder, DefaultPluginType.create("csv"));
|
57
57
|
// charset and newline guess plugins are loaded and invoked by CsvGuessPlugin
|
58
58
|
}
|
59
59
|
}
|
@@ -2,8 +2,9 @@ bundle_path = ENV['EMBULK_BUNDLE_PATH'].to_s
|
|
2
2
|
bundle_path = nil if bundle_path.empty?
|
3
3
|
|
4
4
|
# Search for -b or --bundle, and remove it.
|
5
|
-
|
6
|
-
|
5
|
+
bundle_option_index = ARGV.find_index {|arg| arg == '-b' || arg == '--bundle' }
|
6
|
+
if bundle_option_index
|
7
|
+
ARGV.slice!(bundle_option_index, 2)[1]
|
7
8
|
end
|
8
9
|
|
9
10
|
if bundle_path
|
data/lib/embulk/version.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module Embulk
|
4
4
|
@@warned = false
|
5
5
|
|
6
|
-
VERSION_INTERNAL = '0.8.
|
6
|
+
VERSION_INTERNAL = '0.8.25'
|
7
7
|
|
8
8
|
DEPRECATED_MESSAGE = 'Embulk::VERSION in (J)Ruby is deprecated. Use org.embulk.EmbulkVersion::VERSION instead. If this message is from a plugin, please tell this to the author of the plugin!'
|
9
9
|
def self.const_missing(name)
|
metadata
CHANGED
@@ -1,127 +1,127 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.25
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
18
|
version: 1.10.6
|
19
|
+
name: bundler
|
20
|
+
prerelease: false
|
21
|
+
type: :runtime
|
20
22
|
version_requirements: !ruby/object:Gem::Requirement
|
21
23
|
requirements:
|
22
24
|
- - ">="
|
23
25
|
- !ruby/object:Gem::Version
|
24
26
|
version: 1.10.6
|
25
|
-
prerelease: false
|
26
|
-
type: :runtime
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: msgpack
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - "~>"
|
32
31
|
- !ruby/object:Gem::Version
|
33
32
|
version: 1.1.0
|
33
|
+
name: msgpack
|
34
|
+
prerelease: false
|
35
|
+
type: :runtime
|
34
36
|
version_requirements: !ruby/object:Gem::Requirement
|
35
37
|
requirements:
|
36
38
|
- - "~>"
|
37
39
|
- !ruby/object:Gem::Version
|
38
40
|
version: 1.1.0
|
39
|
-
prerelease: false
|
40
|
-
type: :runtime
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: liquid
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
44
|
- - "~>"
|
46
45
|
- !ruby/object:Gem::Version
|
47
46
|
version: 3.0.6
|
47
|
+
name: liquid
|
48
|
+
prerelease: false
|
49
|
+
type: :runtime
|
48
50
|
version_requirements: !ruby/object:Gem::Requirement
|
49
51
|
requirements:
|
50
52
|
- - "~>"
|
51
53
|
- !ruby/object:Gem::Version
|
52
54
|
version: 3.0.6
|
53
|
-
prerelease: false
|
54
|
-
type: :runtime
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: rjack-icu
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
58
|
- - "~>"
|
60
59
|
- !ruby/object:Gem::Version
|
61
60
|
version: 4.54.1.1
|
61
|
+
name: rjack-icu
|
62
|
+
prerelease: false
|
63
|
+
type: :runtime
|
62
64
|
version_requirements: !ruby/object:Gem::Requirement
|
63
65
|
requirements:
|
64
66
|
- - "~>"
|
65
67
|
- !ruby/object:Gem::Version
|
66
68
|
version: 4.54.1.1
|
67
|
-
prerelease: false
|
68
|
-
type: :runtime
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: rake
|
71
70
|
requirement: !ruby/object:Gem::Requirement
|
72
71
|
requirements:
|
73
72
|
- - ">="
|
74
73
|
- !ruby/object:Gem::Version
|
75
74
|
version: 0.10.0
|
75
|
+
name: rake
|
76
|
+
prerelease: false
|
77
|
+
type: :development
|
76
78
|
version_requirements: !ruby/object:Gem::Requirement
|
77
79
|
requirements:
|
78
80
|
- - ">="
|
79
81
|
- !ruby/object:Gem::Version
|
80
82
|
version: 0.10.0
|
81
|
-
prerelease: false
|
82
|
-
type: :development
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name: test-unit
|
85
84
|
requirement: !ruby/object:Gem::Requirement
|
86
85
|
requirements:
|
87
86
|
- - "~>"
|
88
87
|
- !ruby/object:Gem::Version
|
89
88
|
version: 3.0.9
|
89
|
+
name: test-unit
|
90
|
+
prerelease: false
|
91
|
+
type: :development
|
90
92
|
version_requirements: !ruby/object:Gem::Requirement
|
91
93
|
requirements:
|
92
94
|
- - "~>"
|
93
95
|
- !ruby/object:Gem::Version
|
94
96
|
version: 3.0.9
|
95
|
-
prerelease: false
|
96
|
-
type: :development
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name: yard
|
99
98
|
requirement: !ruby/object:Gem::Requirement
|
100
99
|
requirements:
|
101
100
|
- - "~>"
|
102
101
|
- !ruby/object:Gem::Version
|
103
102
|
version: 0.8.7
|
103
|
+
name: yard
|
104
|
+
prerelease: false
|
105
|
+
type: :development
|
104
106
|
version_requirements: !ruby/object:Gem::Requirement
|
105
107
|
requirements:
|
106
108
|
- - "~>"
|
107
109
|
- !ruby/object:Gem::Version
|
108
110
|
version: 0.8.7
|
109
|
-
prerelease: false
|
110
|
-
type: :development
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name: kramdown
|
113
112
|
requirement: !ruby/object:Gem::Requirement
|
114
113
|
requirements:
|
115
114
|
- - "~>"
|
116
115
|
- !ruby/object:Gem::Version
|
117
116
|
version: 1.5.0
|
117
|
+
name: kramdown
|
118
|
+
prerelease: false
|
119
|
+
type: :development
|
118
120
|
version_requirements: !ruby/object:Gem::Requirement
|
119
121
|
requirements:
|
120
122
|
- - "~>"
|
121
123
|
- !ruby/object:Gem::Version
|
122
124
|
version: 1.5.0
|
123
|
-
prerelease: false
|
124
|
-
type: :development
|
125
125
|
description: Embulk is an open-source, plugin-based bulk data loader to scale and simplify data management across heterogeneous data stores. It can collect and ship any kinds of data in high throughput with transaction control.
|
126
126
|
email:
|
127
127
|
- frsyuki@gmail.com
|
@@ -150,9 +150,9 @@ files:
|
|
150
150
|
- classpath/commons-compress-1.10.jar
|
151
151
|
- classpath/commons-lang-2.4.jar
|
152
152
|
- classpath/commons-lang3-3.4.jar
|
153
|
-
- classpath/embulk-cli-0.8.
|
154
|
-
- classpath/embulk-core-0.8.
|
155
|
-
- classpath/embulk-standards-0.8.
|
153
|
+
- classpath/embulk-cli-0.8.25.jar
|
154
|
+
- classpath/embulk-core-0.8.25.jar
|
155
|
+
- classpath/embulk-standards-0.8.25.jar
|
156
156
|
- classpath/guava-18.0.jar
|
157
157
|
- classpath/guice-4.0.jar
|
158
158
|
- classpath/guice-bootstrap-0.1.1.jar
|
@@ -246,7 +246,9 @@ files:
|
|
246
246
|
- embulk-core/src/main/java/org/embulk/jruby/JRubyPluginSource.java
|
247
247
|
- embulk-core/src/main/java/org/embulk/jruby/JRubyScriptingModule.java
|
248
248
|
- embulk-core/src/main/java/org/embulk/plugin/BuiltinPluginSourceModule.java
|
249
|
+
- embulk-core/src/main/java/org/embulk/plugin/DefaultPluginType.java
|
249
250
|
- embulk-core/src/main/java/org/embulk/plugin/InjectedPluginSource.java
|
251
|
+
- embulk-core/src/main/java/org/embulk/plugin/MavenPluginType.java
|
250
252
|
- embulk-core/src/main/java/org/embulk/plugin/PluginClassLoader.java
|
251
253
|
- embulk-core/src/main/java/org/embulk/plugin/PluginClassLoaderFactory.java
|
252
254
|
- embulk-core/src/main/java/org/embulk/plugin/PluginClassLoaderModule.java
|
@@ -379,6 +381,7 @@ files:
|
|
379
381
|
- embulk-core/src/test/java/org/embulk/config/TestTaskSource.java
|
380
382
|
- embulk-core/src/test/java/org/embulk/plugin/MockPluginSource.java
|
381
383
|
- embulk-core/src/test/java/org/embulk/plugin/TestPluginType.java
|
384
|
+
- embulk-core/src/test/java/org/embulk/plugin/TestPluginTypeSerDe.java
|
382
385
|
- embulk-core/src/test/java/org/embulk/spi/MockFileOutput.java
|
383
386
|
- embulk-core/src/test/java/org/embulk/spi/MockFormatterPlugin.java
|
384
387
|
- embulk-core/src/test/java/org/embulk/spi/MockParserPlugin.java
|
@@ -503,6 +506,7 @@ files:
|
|
503
506
|
- embulk-docs/src/release/release-0.8.22.rst
|
504
507
|
- embulk-docs/src/release/release-0.8.23.rst
|
505
508
|
- embulk-docs/src/release/release-0.8.24.rst
|
509
|
+
- embulk-docs/src/release/release-0.8.25.rst
|
506
510
|
- embulk-docs/src/release/release-0.8.3.rst
|
507
511
|
- embulk-docs/src/release/release-0.8.4.rst
|
508
512
|
- embulk-docs/src/release/release-0.8.5.rst
|