embulk 0.8.18-java → 0.8.19-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/build.gradle +10 -3
- data/embulk-cli/build.gradle +2 -0
- data/embulk-cli/src/main/bat/selfrun.bat +98 -0
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkExample.java +82 -0
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkMigrate.java +458 -0
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkNew.java +419 -0
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkSelfUpdate.java +248 -0
- data/embulk-cli/src/main/sh/selfrun.sh +0 -103
- data/embulk-cli/src/test/java/org/embulk/cli/SelfrunTest.java +158 -143
- data/embulk-core/build.gradle +2 -2
- data/embulk-core/src/main/java/org/embulk/EmbulkVersion.java +109 -0
- data/embulk-core/src/main/java/org/embulk/exec/GuessExecutor.java +11 -0
- data/embulk-core/src/main/java/org/embulk/exec/PreviewExecutor.java +29 -3
- data/embulk-core/src/main/java/org/embulk/exec/SamplingParserPlugin.java +47 -13
- data/embulk-core/src/main/java/org/embulk/spi/FileInputRunner.java +6 -3
- data/embulk-core/src/main/java/org/embulk/spi/PageBuilder.java +385 -64
- data/embulk-core/src/main/java/org/embulk/spi/TempFileSpace.java +2 -1
- data/embulk-core/src/test/java/org/embulk/spi/TestPageBuilderReader.java +62 -0
- data/embulk-docs/src/built-in.rst +59 -21
- data/embulk-docs/src/customization.rst +8 -8
- data/embulk-docs/src/developers/index.rst +45 -0
- data/embulk-docs/src/index.rst +11 -7
- data/embulk-docs/src/recipe.rst +1 -1
- data/embulk-docs/src/recipe/{scheduled-csv-load-to-elasticsearch-kibana4.rst → scheduled-csv-load-to-elasticsearch-kibana5.rst} +26 -24
- data/embulk-docs/src/release.rst +1 -0
- data/embulk-docs/src/release/release-0.4.0.rst +1 -1
- data/embulk-docs/src/release/release-0.5.0.rst +1 -1
- data/embulk-docs/src/release/release-0.6.0.rst +1 -1
- data/embulk-docs/src/release/release-0.6.20.rst +1 -1
- data/embulk-docs/src/release/release-0.8.19.rst +43 -0
- data/embulk-standards/src/main/java/org/embulk/standards/CsvParserPlugin.java +2 -2
- data/embulk-standards/src/main/java/org/embulk/standards/LocalFileInputPlugin.java +30 -1
- data/embulk-standards/src/test/java/org/embulk/standards/guess/TestCsvGuessPlugin.java +10 -0
- data/embulk-standards/src/test/java/org/embulk/standards/preview/TestFilePreview.java +73 -0
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_skip_suggest_if_empty_sample_records.csv +5 -0
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_skip_suggest_if_empty_sample_records_guessed.yml +2 -0
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_skip_suggest_if_empty_sample_records_seed.yml +1 -0
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_sample_buffer_bytes.csv +5 -0
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_sample_buffer_bytes_exec.yml +1 -0
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_sample_buffer_bytes_load.yml +19 -0
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_sample_buffer_bytes_previewed.csv +1 -0
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_simple.csv +5 -0
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_simple_load.yml +19 -0
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_simple_previewed.csv +4 -0
- data/embulk-test/src/main/java/org/embulk/test/PreviewResultInputPlugin.java +65 -0
- data/embulk-test/src/main/java/org/embulk/test/TestingBulkLoader.java +5 -0
- data/embulk-test/src/main/java/org/embulk/test/TestingEmbulk.java +59 -2
- data/embulk.gemspec +2 -1
- data/lib/embulk/command/embulk_run.rb +11 -49
- data/lib/embulk/data/new/README.md.vm +106 -0
- data/lib/embulk/data/new/{gitignore.erb → gitignore.vm} +3 -3
- data/lib/embulk/data/new/java/{build.gradle.erb → build.gradle.vm} +8 -8
- data/lib/embulk/data/new/java/{decoder.java.erb → decoder.java.vm} +6 -4
- data/lib/embulk/data/new/java/{encoder.java.erb → encoder.java.vm} +7 -5
- data/lib/embulk/data/new/java/{file_input.java.erb → file_input.java.vm} +9 -7
- data/lib/embulk/data/new/java/{file_output.java.erb → file_output.java.vm} +7 -5
- data/lib/embulk/data/new/java/{filter.java.erb → filter.java.vm} +4 -3
- data/lib/embulk/data/new/java/{formatter.java.erb → formatter.java.vm} +5 -4
- data/lib/embulk/data/new/java/{input.java.erb → input.java.vm} +6 -4
- data/lib/embulk/data/new/java/{output.java.erb → output.java.vm} +7 -5
- data/lib/embulk/data/new/java/{parser.java.erb → parser.java.vm} +5 -4
- data/lib/embulk/data/new/java/plugin_loader.rb.vm +3 -0
- data/lib/embulk/data/new/java/test.java.vm +5 -0
- data/lib/embulk/data/new/ruby/decoder_guess.rb.vm +25 -0
- data/lib/embulk/data/new/ruby/{filter.rb.erb → filter.rb.vm} +2 -2
- data/lib/embulk/data/new/ruby/{formatter.rb.erb → formatter.rb.vm} +2 -2
- data/lib/embulk/data/new/ruby/gemspec.vm +20 -0
- data/lib/embulk/data/new/ruby/{input.rb.erb → input.rb.vm} +10 -10
- data/lib/embulk/data/new/ruby/{output.rb.erb → output.rb.vm} +7 -7
- data/lib/embulk/data/new/ruby/{parser.rb.erb → parser.rb.vm} +2 -2
- data/lib/embulk/data/new/ruby/parser_guess.rb.vm +65 -0
- data/lib/embulk/guess/csv.rb +5 -0
- data/lib/embulk/version.rb +22 -1
- metadata +55 -35
- data/lib/embulk/command/embulk_example.rb +0 -33
- data/lib/embulk/command/embulk_generate_bin.rb +0 -62
- data/lib/embulk/command/embulk_migrate_plugin.rb +0 -244
- data/lib/embulk/command/embulk_new_plugin.rb +0 -126
- data/lib/embulk/command/embulk_selfupdate.rb +0 -121
- data/lib/embulk/data/new/README.md.erb +0 -111
- data/lib/embulk/data/new/java/plugin_loader.rb.erb +0 -3
- data/lib/embulk/data/new/java/test.java.erb +0 -5
- data/lib/embulk/data/new/ruby/decoder_guess.rb.erb +0 -25
- data/lib/embulk/data/new/ruby/gemspec.erb +0 -20
- data/lib/embulk/data/new/ruby/parser_guess.rb.erb +0 -65
data/embulk.gemspec
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
+
# TODO(v2)[#566]: Remove this embulk.gemspec.
|
1
2
|
$LOAD_PATH.push File.expand_path("../lib", __FILE__)
|
2
3
|
require 'embulk/version'
|
3
4
|
|
4
5
|
Gem::Specification.new do |gem|
|
5
6
|
gem.name = "embulk"
|
6
|
-
gem.version = Embulk::
|
7
|
+
gem.version = Embulk::VERSION_INTERNAL
|
7
8
|
|
8
9
|
gem.summary = "Embulk, a plugin-based parallel bulk data loader"
|
9
10
|
gem.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."
|
@@ -11,7 +11,7 @@ module Embulk
|
|
11
11
|
i = argv.find_index {|arg| arg !~ /^\-/ }
|
12
12
|
unless i
|
13
13
|
if argv.include?('--version')
|
14
|
-
puts "embulk #{
|
14
|
+
puts "embulk #{org.embulk.EmbulkVersion::VERSION}"
|
15
15
|
system_exit_success
|
16
16
|
end
|
17
17
|
usage nil
|
@@ -21,9 +21,9 @@ module Embulk
|
|
21
21
|
require 'java'
|
22
22
|
require 'optparse'
|
23
23
|
op = OptionParser.new
|
24
|
-
op.version =
|
24
|
+
op.version = org.embulk.EmbulkVersion::VERSION
|
25
25
|
|
26
|
-
puts "#{Time.now.strftime("%Y-%m-%d %H:%M:%S.%3N %z")}: Embulk v#{
|
26
|
+
puts "#{Time.now.strftime("%Y-%m-%d %H:%M:%S.%3N %z")}: Embulk v#{org.embulk.EmbulkVersion::VERSION}"
|
27
27
|
|
28
28
|
plugin_paths = []
|
29
29
|
load_paths = []
|
@@ -226,57 +226,19 @@ examples:
|
|
226
226
|
|
227
227
|
case subcmd
|
228
228
|
when :example
|
229
|
-
|
230
|
-
path = ARGV[0] || "embulk-example"
|
231
|
-
puts "Creating #{path} directory..."
|
232
|
-
Embulk.create_example(path)
|
233
|
-
puts ""
|
234
|
-
puts "Run following subcommands to try embulk:"
|
235
|
-
puts ""
|
236
|
-
puts " 1. embulk guess #{File.join(path, 'seed.yml')} -o config.yml"
|
237
|
-
puts " 2. embulk preview config.yml"
|
238
|
-
puts " 3. embulk run config.yml"
|
239
|
-
puts ""
|
229
|
+
(org.embulk.cli.EmbulkExample.new).createExample(ARGV[0] || "embulk-example")
|
240
230
|
|
241
231
|
when :new
|
242
|
-
|
243
|
-
name = ARGV[1]
|
244
|
-
|
245
|
-
language, category = case lang_cate
|
246
|
-
when "java-input" then [:java, :input]
|
247
|
-
when "java-output" then [:java, :output]
|
248
|
-
when "java-filter" then [:java, :filter]
|
249
|
-
when "java-file-input" then [:java, :file_input]
|
250
|
-
when "java-file-output" then [:java, :file_output]
|
251
|
-
when "java-parser" then [:java, :parser]
|
252
|
-
when "java-formatter" then [:java, :formatter]
|
253
|
-
when "java-decoder" then [:java, :decoder]
|
254
|
-
when "java-encoder" then [:java, :encoder]
|
255
|
-
when "ruby-input" then [:ruby, :input]
|
256
|
-
when "ruby-output" then [:ruby, :output]
|
257
|
-
when "ruby-filter" then [:ruby, :filter]
|
258
|
-
when "ruby-file-input" then raise "ruby-file-input is not implemented yet. See #21 on github." #[:ruby, :file_input]
|
259
|
-
when "ruby-file-output" then raise "ruby-file-output is not implemented yet. See #22 on github." #[:ruby, :file_output]
|
260
|
-
when "ruby-parser" then [:ruby, :parser]
|
261
|
-
when "ruby-formatter" then [:ruby, :formatter]
|
262
|
-
when "ruby-decoder" then raise "ruby-decoder is not implemented yet. See #31 on github." #[:ruby, :decoder]
|
263
|
-
when "ruby-encoder" then raise "ruby-decoder is not implemented yet. See #32 on github." #[:ruby, :encoder]
|
264
|
-
else
|
265
|
-
usage_op op, "Unknown category '#{lang_cate}'"
|
266
|
-
end
|
267
|
-
|
268
|
-
require 'embulk/command/embulk_new_plugin'
|
269
|
-
Embulk.new_plugin(name, language, category)
|
232
|
+
(org.embulk.cli.EmbulkNew.new(ARGV[0], ARGV[1], org.embulk.EmbulkVersion::VERSION)).newPlugin()
|
270
233
|
|
271
234
|
when :migrate
|
272
|
-
|
273
|
-
require 'embulk/command/embulk_migrate_plugin'
|
274
|
-
Embulk.migrate_plugin(path)
|
235
|
+
(org.embulk.cli.EmbulkMigrate.new).migratePlugin(ARGV[0], org.embulk.EmbulkVersion::VERSION)
|
275
236
|
|
276
237
|
when :selfupdate
|
277
|
-
|
278
|
-
|
279
|
-
|
238
|
+
(org.embulk.cli.EmbulkSelfUpdate.new).updateSelf(org.embulk.EmbulkVersion::VERSION,
|
239
|
+
ARGV[0],
|
240
|
+
__FILE__,
|
241
|
+
options[:force])
|
280
242
|
|
281
243
|
when :mkbundle
|
282
244
|
new_bundle(argv[0], options[:bundle_path])
|
@@ -399,7 +361,7 @@ examples:
|
|
399
361
|
end
|
400
362
|
|
401
363
|
def self.usage(message)
|
402
|
-
STDERR.puts "Embulk v#{
|
364
|
+
STDERR.puts "Embulk v#{org.embulk.EmbulkVersion::VERSION}"
|
403
365
|
STDERR.puts "Usage: embulk [-vm-options] <command> [--options]"
|
404
366
|
STDERR.puts "Commands:"
|
405
367
|
STDERR.puts " mkbundle <directory> # create a new plugin bundle environment."
|
@@ -0,0 +1,106 @@
|
|
1
|
+
#[[#]]# ${displayName} ${displayCategory} plugin for Embulk
|
2
|
+
|
3
|
+
#if (${language} == "ruby")
|
4
|
+
TODO: Write short description here and ${fullProjectName}.gemspec file.
|
5
|
+
#elseif (${language} == "java")
|
6
|
+
TODO: Write short description here and build.gradle file.
|
7
|
+
#else
|
8
|
+
TODO: Write short description here.
|
9
|
+
#end
|
10
|
+
|
11
|
+
#[[##]]# Overview
|
12
|
+
|
13
|
+
#if (${category} == "output" || ${category} == "file_output")
|
14
|
+
* **Plugin type**: ${displayCategory}
|
15
|
+
* **Load all or nothing**: no
|
16
|
+
* **Resume supported**: no
|
17
|
+
* **Cleanup supported**: yes
|
18
|
+
#elseif (${category} == "file_input")
|
19
|
+
* **Plugin type**: ${displayCategory}
|
20
|
+
* **Resume supported**: yes
|
21
|
+
* **Cleanup supported**: yes
|
22
|
+
#elseif (${category} == "input")
|
23
|
+
* **Plugin type**: ${displayCategory}
|
24
|
+
* **Resume supported**: yes
|
25
|
+
* **Cleanup supported**: yes
|
26
|
+
* **Guess supported**: no
|
27
|
+
#elseif (${category} == "parser" || ${category} == "decoder")
|
28
|
+
* **Plugin type**: ${displayCategory}
|
29
|
+
* **Guess supported**: no
|
30
|
+
#else
|
31
|
+
* **Plugin type**: ${displayCategory}
|
32
|
+
#end
|
33
|
+
|
34
|
+
#[[##]]# Configuration
|
35
|
+
|
36
|
+
- **option1**: description (integer, required)
|
37
|
+
- **option2**: description (string, default: `"myvalue"`)
|
38
|
+
- **option3**: description (string, default: `null`)
|
39
|
+
|
40
|
+
#[[##]]# Example
|
41
|
+
|
42
|
+
```yaml
|
43
|
+
#if (${category} == "input" || ${category} == "file_input")
|
44
|
+
in:
|
45
|
+
type: ${name}
|
46
|
+
option1: example1
|
47
|
+
option2: example2
|
48
|
+
#elseif (${category} == "output" || ${category} == "file_output")
|
49
|
+
out:
|
50
|
+
type: ${name}
|
51
|
+
option1: example1
|
52
|
+
option2: example2
|
53
|
+
#elseif (${category} == "filter")
|
54
|
+
filters:
|
55
|
+
- type: ${name}
|
56
|
+
option1: example1
|
57
|
+
option2: example2
|
58
|
+
#elseif (${category} == "parser")
|
59
|
+
in:
|
60
|
+
type: any file input plugin type
|
61
|
+
parser:
|
62
|
+
type: ${name}
|
63
|
+
option1: example1
|
64
|
+
option2: example2
|
65
|
+
#elseif (${category} == "formatter")
|
66
|
+
out:
|
67
|
+
type: any output input plugin type
|
68
|
+
formatter:
|
69
|
+
type: ${name}
|
70
|
+
option1: example1
|
71
|
+
option2: example2
|
72
|
+
#elseif (${category} == "decoder")
|
73
|
+
in:
|
74
|
+
type: any output input plugin type
|
75
|
+
decoders:
|
76
|
+
- type: ${name}
|
77
|
+
option1: example1
|
78
|
+
option2: example2
|
79
|
+
#elseif (${category} == "encoder")
|
80
|
+
out:
|
81
|
+
type: any output input plugin type
|
82
|
+
encoders:
|
83
|
+
- type: ${name}
|
84
|
+
option1: example1
|
85
|
+
option2: example2
|
86
|
+
#end
|
87
|
+
```
|
88
|
+
|
89
|
+
#if (${category} == "parser" || ${category} == "decoder")
|
90
|
+
(If guess supported) you don't have to write `${category}:` section in the configuration file. After writing `in:` section, you can let embulk guess `${category}:` section using this command:
|
91
|
+
|
92
|
+
```
|
93
|
+
$ embulk gem install ${fullProjectName}
|
94
|
+
$ embulk guess -g ${name} config.yml -o guessed.yml
|
95
|
+
```
|
96
|
+
#end
|
97
|
+
|
98
|
+
#[[##]]# Build
|
99
|
+
|
100
|
+
```
|
101
|
+
#if (${language} == "ruby")
|
102
|
+
$ rake
|
103
|
+
#elseif (${language} == "java")
|
104
|
+
$ ./gradlew gem # -t to watch change of files and rebuild continuously
|
105
|
+
#end
|
106
|
+
```
|
@@ -1,7 +1,7 @@
|
|
1
1
|
*~
|
2
2
|
/pkg/
|
3
3
|
/tmp/
|
4
|
-
|
4
|
+
#if (${language} == "java")
|
5
5
|
*.gemspec
|
6
6
|
.gradle/
|
7
7
|
/classpath/
|
@@ -11,7 +11,7 @@ build/
|
|
11
11
|
/.metadata/
|
12
12
|
.classpath
|
13
13
|
.project
|
14
|
-
|
14
|
+
#elseif (${language} == "ruby")
|
15
15
|
/.bundle/
|
16
16
|
/Gemfile.lock
|
17
|
-
|
17
|
+
#end
|
@@ -19,8 +19,8 @@ sourceCompatibility = 1.7
|
|
19
19
|
targetCompatibility = 1.7
|
20
20
|
|
21
21
|
dependencies {
|
22
|
-
compile "org.embulk:embulk-core
|
23
|
-
provided "org.embulk:embulk-core
|
22
|
+
compile "org.embulk:embulk-core:${embulkVersion}"
|
23
|
+
provided "org.embulk:embulk-core:${embulkVersion}"
|
24
24
|
// compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
|
25
25
|
testCompile "junit:junit:4.+"
|
26
26
|
}
|
@@ -63,7 +63,7 @@ task gemPush(type: JRubyExec, dependsOn: ["gem"]) {
|
|
63
63
|
task "package"(dependsOn: ["gemspec", "classpath"]) {
|
64
64
|
doLast {
|
65
65
|
println "> Build succeeded."
|
66
|
-
println "> You can run embulk with
|
66
|
+
println "> You can run embulk with ${argumentToRunEmbulkJava} argument."
|
67
67
|
}
|
68
68
|
}
|
69
69
|
|
@@ -75,12 +75,12 @@ task gemspec {
|
|
75
75
|
Gem::Specification.new do |spec|
|
76
76
|
spec.name = "${project.name}"
|
77
77
|
spec.version = "${project.version}"
|
78
|
-
spec.authors = [
|
79
|
-
spec.summary = %[
|
80
|
-
spec.description = %[
|
81
|
-
spec.email = [
|
78
|
+
spec.authors = ["${author}"]
|
79
|
+
spec.summary = %[${displayName} ${displayCategory} plugin for Embulk]
|
80
|
+
spec.description = %[${description}]
|
81
|
+
spec.email = ["${email}"]
|
82
82
|
spec.licenses = ["MIT"]
|
83
|
-
# TODO set this: spec.homepage =
|
83
|
+
# TODO set this: spec.homepage = "https://github.com/${expectedGitHubAccount}/${fullProjectName}"
|
84
84
|
|
85
85
|
spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
|
86
86
|
spec.test_files = spec.files.grep(%r"^(test|spec)/")
|
@@ -1,21 +1,23 @@
|
|
1
|
-
package
|
1
|
+
package ${javaPackageName};
|
2
2
|
|
3
3
|
import java.io.InputStream;
|
4
4
|
import java.io.IOException;
|
5
|
+
|
5
6
|
import com.google.common.base.Optional;
|
7
|
+
|
6
8
|
import org.embulk.config.Config;
|
7
9
|
import org.embulk.config.ConfigDefault;
|
8
10
|
import org.embulk.config.ConfigInject;
|
9
11
|
import org.embulk.config.ConfigSource;
|
10
12
|
import org.embulk.config.Task;
|
11
13
|
import org.embulk.config.TaskSource;
|
14
|
+
import org.embulk.spi.BufferAllocator;
|
12
15
|
import org.embulk.spi.DecoderPlugin;
|
13
16
|
import org.embulk.spi.FileInput;
|
14
|
-
import org.embulk.spi.BufferAllocator;
|
15
17
|
import org.embulk.spi.util.FileInputInputStream;
|
16
18
|
import org.embulk.spi.util.InputStreamFileInput;
|
17
19
|
|
18
|
-
public class
|
20
|
+
public class ${javaClassName}
|
19
21
|
implements DecoderPlugin
|
20
22
|
{
|
21
23
|
public interface PluginTask
|
@@ -53,7 +55,7 @@ public class <%= java_class_name %>
|
|
53
55
|
final PluginTask task = taskSource.loadTask(PluginTask.class);
|
54
56
|
|
55
57
|
// Write your code here :)
|
56
|
-
throw new UnsupportedOperationException("
|
58
|
+
throw new UnsupportedOperationException("${javaClassName}.open method is not implemented yet");
|
57
59
|
|
58
60
|
// If expect InputStream, you can use this code:
|
59
61
|
|
@@ -1,21 +1,23 @@
|
|
1
|
-
package
|
1
|
+
package ${javaPackageName};
|
2
2
|
|
3
|
-
import java.io.OutputStream;
|
4
3
|
import java.io.IOException;
|
4
|
+
import java.io.OutputStream;
|
5
|
+
|
5
6
|
import com.google.common.base.Optional;
|
7
|
+
|
6
8
|
import org.embulk.config.Config;
|
7
9
|
import org.embulk.config.ConfigDefault;
|
8
10
|
import org.embulk.config.ConfigInject;
|
9
11
|
import org.embulk.config.ConfigSource;
|
10
12
|
import org.embulk.config.Task;
|
11
13
|
import org.embulk.config.TaskSource;
|
14
|
+
import org.embulk.spi.BufferAllocator;
|
12
15
|
import org.embulk.spi.EncoderPlugin;
|
13
16
|
import org.embulk.spi.FileOutput;
|
14
|
-
import org.embulk.spi.BufferAllocator;
|
15
17
|
import org.embulk.spi.util.FileOutputOutputStream;
|
16
18
|
import org.embulk.spi.util.OutputStreamFileOutput;
|
17
19
|
|
18
|
-
public class
|
20
|
+
public class ${javaClassName}
|
19
21
|
implements EncoderPlugin
|
20
22
|
{
|
21
23
|
public interface PluginTask
|
@@ -53,7 +55,7 @@ public class <%= java_class_name %>
|
|
53
55
|
final PluginTask task = taskSource.loadTask(PluginTask.class);
|
54
56
|
|
55
57
|
// Write your code here :)
|
56
|
-
throw new UnsupportedOperationException("
|
58
|
+
throw new UnsupportedOperationException("${javaClassName}.open method is not implemented yet");
|
57
59
|
|
58
60
|
// If expect OutputStream, you can use this code:
|
59
61
|
|
@@ -1,24 +1,26 @@
|
|
1
|
-
package
|
1
|
+
package ${javaPackageName};
|
2
2
|
|
3
|
-
import java.util.List;
|
4
3
|
import java.util.ArrayList;
|
4
|
+
import java.util.List;
|
5
|
+
|
5
6
|
import com.google.common.base.Optional;
|
6
7
|
import com.google.common.collect.ImmutableList;
|
7
|
-
|
8
|
+
|
8
9
|
import org.embulk.config.Config;
|
9
10
|
import org.embulk.config.ConfigDefault;
|
10
|
-
import org.embulk.config.ConfigInject;
|
11
11
|
import org.embulk.config.ConfigDiff;
|
12
|
+
import org.embulk.config.ConfigInject;
|
12
13
|
import org.embulk.config.ConfigSource;
|
13
14
|
import org.embulk.config.Task;
|
15
|
+
import org.embulk.config.TaskReport;
|
14
16
|
import org.embulk.config.TaskSource;
|
17
|
+
import org.embulk.spi.BufferAllocator;
|
15
18
|
import org.embulk.spi.Exec;
|
16
19
|
import org.embulk.spi.FileInputPlugin;
|
17
|
-
import org.embulk.spi.BufferAllocator;
|
18
20
|
import org.embulk.spi.TransactionalFileInput;
|
19
21
|
import org.embulk.spi.util.InputStreamTransactionalFileInput;
|
20
22
|
|
21
|
-
public class
|
23
|
+
public class ${javaClassName}
|
22
24
|
implements FileInputPlugin
|
23
25
|
{
|
24
26
|
public interface PluginTask
|
@@ -117,7 +119,7 @@ public class <%= java_class_name %>
|
|
117
119
|
final PluginTask task = taskSource.loadTask(PluginTask.class);
|
118
120
|
|
119
121
|
// Write your code here :)
|
120
|
-
throw new UnsupportedOperationException("
|
122
|
+
throw new UnsupportedOperationException("${javaClassName}.open method is not implemented yet");
|
121
123
|
|
122
124
|
// if you expect InputStream, you can use this code:
|
123
125
|
|
@@ -1,19 +1,21 @@
|
|
1
|
-
package
|
1
|
+
package ${javaPackageName};
|
2
2
|
|
3
3
|
import java.util.List;
|
4
|
+
|
4
5
|
import com.google.common.base.Optional;
|
5
|
-
|
6
|
+
|
6
7
|
import org.embulk.config.Config;
|
7
8
|
import org.embulk.config.ConfigDefault;
|
8
9
|
import org.embulk.config.ConfigDiff;
|
9
10
|
import org.embulk.config.ConfigSource;
|
10
11
|
import org.embulk.config.Task;
|
12
|
+
import org.embulk.config.TaskReport;
|
11
13
|
import org.embulk.config.TaskSource;
|
12
14
|
import org.embulk.spi.Exec;
|
13
15
|
import org.embulk.spi.FileOutputPlugin;
|
14
16
|
import org.embulk.spi.TransactionalFileOutput;
|
15
17
|
|
16
|
-
public class
|
18
|
+
public class ${javaClassName}
|
17
19
|
implements FileOutputPlugin
|
18
20
|
{
|
19
21
|
public interface PluginTask
|
@@ -69,7 +71,7 @@ public class <%= java_class_name %>
|
|
69
71
|
int taskCount,
|
70
72
|
FileOutputPlugin.Control control)
|
71
73
|
{
|
72
|
-
throw new UnsupportedOperationException("
|
74
|
+
throw new UnsupportedOperationException("${name} output plugin does not support resuming");
|
73
75
|
}
|
74
76
|
|
75
77
|
@Override
|
@@ -85,7 +87,7 @@ public class <%= java_class_name %>
|
|
85
87
|
PluginTask task = taskSource.loadTask(PluginTask.class);
|
86
88
|
|
87
89
|
// Write your code here :)
|
88
|
-
throw new UnsupportedOperationException("
|
90
|
+
throw new UnsupportedOperationException("${javaClassName}.open method is not implemented yet");
|
89
91
|
|
90
92
|
// See LocalFileOutputPlugin as an example implementation:
|
91
93
|
// https://github.com/embulk/embulk/blob/master/embulk-standards/src/main/java/org/embulk/standards/LocalFileOutputPlugin.java
|
@@ -1,6 +1,7 @@
|
|
1
|
-
package
|
1
|
+
package ${javaPackageName};
|
2
2
|
|
3
3
|
import com.google.common.base.Optional;
|
4
|
+
|
4
5
|
import org.embulk.config.Config;
|
5
6
|
import org.embulk.config.ConfigDefault;
|
6
7
|
import org.embulk.config.ConfigDiff;
|
@@ -12,7 +13,7 @@ import org.embulk.spi.FilterPlugin;
|
|
12
13
|
import org.embulk.spi.PageOutput;
|
13
14
|
import org.embulk.spi.Schema;
|
14
15
|
|
15
|
-
public class
|
16
|
+
public class ${javaClassName}
|
16
17
|
implements FilterPlugin
|
17
18
|
{
|
18
19
|
public interface PluginTask
|
@@ -51,6 +52,6 @@ public class <%= java_class_name %>
|
|
51
52
|
PluginTask task = taskSource.loadTask(PluginTask.class);
|
52
53
|
|
53
54
|
// Write your code here :)
|
54
|
-
throw new UnsupportedOperationException("
|
55
|
+
throw new UnsupportedOperationException("${javaClassName}.open method is not implemented yet");
|
55
56
|
}
|
56
57
|
}
|