embulk 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +5 -13
  2. data/.travis.yml +16 -0
  3. data/Gemfile +0 -1
  4. data/README.md +37 -19
  5. data/Rakefile +5 -37
  6. data/bin/embulk +1 -1
  7. data/build.gradle +178 -95
  8. data/embulk-core/build.gradle +1 -1
  9. data/embulk-core/src/main/java/org/embulk/command/Runner.java +11 -10
  10. data/embulk-core/src/main/java/org/embulk/config/ConfigDiff.java +26 -0
  11. data/embulk-core/src/main/java/org/embulk/config/ConfigInject.java +14 -0
  12. data/embulk-core/src/main/java/org/embulk/config/DataSourceImpl.java +2 -2
  13. data/embulk-core/src/main/java/org/embulk/config/DataSourceSerDe.java +4 -3
  14. data/embulk-core/src/main/java/org/embulk/config/TaskSerDe.java +5 -3
  15. data/embulk-core/src/main/java/org/embulk/config/TaskValidationException.java +1 -0
  16. data/embulk-core/src/main/java/org/embulk/exec/ExecutionResult.java +6 -6
  17. data/embulk-core/src/main/java/org/embulk/exec/GuessExecutor.java +19 -19
  18. data/embulk-core/src/main/java/org/embulk/exec/LocalExecutor.java +61 -36
  19. data/embulk-core/src/main/java/org/embulk/plugin/InjectedPluginSource.java +4 -0
  20. data/embulk-core/src/main/java/org/embulk/plugin/PluginManager.java +16 -1
  21. data/embulk-core/src/main/java/org/embulk/spi/Column.java +1 -1
  22. data/embulk-core/src/main/java/org/embulk/spi/{SchemaVisitor.java → ColumnVisitor.java} +1 -1
  23. data/embulk-core/src/main/java/org/embulk/spi/Exec.java +3 -3
  24. data/embulk-core/src/main/java/org/embulk/spi/ExecSession.java +2 -2
  25. data/embulk-core/src/main/java/org/embulk/spi/FileInputPlugin.java +3 -3
  26. data/embulk-core/src/main/java/org/embulk/spi/FileInputRunner.java +3 -3
  27. data/embulk-core/src/main/java/org/embulk/spi/FileOutputPlugin.java +3 -3
  28. data/embulk-core/src/main/java/org/embulk/spi/FileOutputRunner.java +3 -3
  29. data/embulk-core/src/main/java/org/embulk/spi/FilterPlugin.java +1 -1
  30. data/embulk-core/src/main/java/org/embulk/spi/GuessPlugin.java +2 -2
  31. data/embulk-core/src/main/java/org/embulk/spi/InputPlugin.java +3 -3
  32. data/embulk-core/src/main/java/org/embulk/spi/OutputPlugin.java +3 -3
  33. data/embulk-core/src/main/java/org/embulk/spi/PluginClassLoader.java +80 -0
  34. data/embulk-core/src/main/java/org/embulk/spi/Schema.java +1 -1
  35. data/embulk-core/src/main/java/org/embulk/spi/time/TimestampFormatter.java +2 -2
  36. data/embulk-core/src/main/java/org/embulk/spi/time/TimestampParser.java +2 -2
  37. data/embulk-core/src/main/java/org/embulk/spi/util/Filters.java +1 -1
  38. data/embulk-core/src/main/java/org/embulk/spi/util/LineEncoder.java +2 -2
  39. data/embulk-core/src/main/java/org/embulk/spi/util/PagePrinter.java +6 -6
  40. data/embulk-core/src/main/java/org/embulk/spi/util/Pages.java +6 -6
  41. data/embulk-core/src/test/java/org/embulk/GuiceBinder.java +1 -1
  42. data/embulk-core/src/test/java/org/embulk/plugin/MockPluginSource.java +1 -0
  43. data/embulk-core/src/test/java/org/embulk/spi/MockFormatterPlugin.java +2 -2
  44. data/embulk-core/src/test/java/org/embulk/spi/PageTestUtils.java +1 -1
  45. data/embulk-core/src/test/java/org/embulk/spi/TestFileInputRunner.java +3 -3
  46. data/embulk-core/src/test/java/org/embulk/spi/TestFileOutputRunner.java +4 -4
  47. data/embulk-docs/Makefile +178 -0
  48. data/embulk-docs/build.gradle +20 -0
  49. data/embulk-docs/make.bat +243 -0
  50. data/embulk-docs/push-gh-pages.sh +29 -0
  51. data/embulk-docs/src/conf.py +260 -0
  52. data/embulk-docs/src/index.rst +19 -0
  53. data/embulk-docs/src/release.rst +14 -0
  54. data/embulk-docs/src/release/release-0.1.0.rst +8 -0
  55. data/embulk-docs/src/release/release-0.2.0.rst +16 -0
  56. data/embulk-docs/src/release/release-0.2.1.rst +19 -0
  57. data/embulk-docs/src/release/release-0.3.0.rst +34 -0
  58. data/embulk-docs/src/release/release-0.3.1.rst +11 -0
  59. data/embulk-docs/src/release/release-0.3.2.rst +15 -0
  60. data/embulk-docs/src/release/release-0.4.0.rst +74 -0
  61. data/embulk-standards/build.gradle +0 -1
  62. data/embulk-standards/src/main/java/org/embulk/standards/CsvFormatterPlugin.java +2 -2
  63. data/embulk-standards/src/main/java/org/embulk/standards/CsvParserPlugin.java +12 -3
  64. data/embulk-standards/src/main/java/org/embulk/standards/GzipFileDecoderPlugin.java +2 -2
  65. data/embulk-standards/src/main/java/org/embulk/standards/LocalFileInputPlugin.java +49 -26
  66. data/embulk-standards/src/main/java/org/embulk/standards/LocalFileOutputPlugin.java +16 -17
  67. data/embulk-standards/src/main/java/org/embulk/standards/NullOutputPlugin.java +4 -4
  68. data/embulk-standards/src/main/java/org/embulk/standards/StandardPluginModule.java +0 -1
  69. data/embulk-standards/src/main/java/org/embulk/standards/StdoutOutputPlugin.java +5 -5
  70. data/gradle/wrapper/gradle-wrapper.jar +0 -0
  71. data/gradle/wrapper/gradle-wrapper.properties +2 -2
  72. data/lib/embulk/buffer.rb +2 -2
  73. data/lib/embulk/column.rb +6 -6
  74. data/lib/embulk/command/embulk_example.rb +1 -1
  75. data/lib/embulk/command/embulk_new_plugin.rb +87 -0
  76. data/lib/embulk/command/embulk_run.rb +84 -26
  77. data/lib/embulk/data/bundle/Gemfile +12 -20
  78. data/lib/embulk/data/bundle/embulk/{filter_example.rb → filter/example.rb} +3 -3
  79. data/lib/embulk/data/bundle/embulk/{input_example.rb → input/example.rb} +3 -3
  80. data/lib/embulk/data/bundle/embulk/{output_example.rb → output/example.rb} +3 -3
  81. data/lib/embulk/data/new/LICENSE.txt +21 -0
  82. data/lib/embulk/data/new/README.md.erb +75 -0
  83. data/lib/embulk/data/new/gitignore.erb +12 -0
  84. data/lib/embulk/data/new/java/build.gradle.erb +57 -0
  85. data/lib/embulk/data/new/java/decoder.java.erb +40 -0
  86. data/lib/embulk/data/new/java/encoder.java.erb +40 -0
  87. data/lib/embulk/data/new/java/file_input.java.erb +64 -0
  88. data/lib/embulk/data/new/java/file_output.java.erb +66 -0
  89. data/lib/embulk/data/new/java/filter.java.erb +47 -0
  90. data/lib/embulk/data/new/java/formatter.java.erb +45 -0
  91. data/lib/embulk/data/new/java/gradle/wrapper/gradle-wrapper.jar +0 -0
  92. data/lib/embulk/data/new/java/gradle/wrapper/gradle-wrapper.properties +6 -0
  93. data/lib/embulk/data/new/java/gradlew +164 -0
  94. data/lib/embulk/data/new/java/gradlew.bat +90 -0
  95. data/lib/embulk/data/new/java/input.java.erb +69 -0
  96. data/lib/embulk/data/new/java/output.java.erb +65 -0
  97. data/lib/embulk/data/new/java/parser.java.erb +51 -0
  98. data/lib/embulk/data/new/java/plugin_loader.rb.erb +3 -0
  99. data/lib/embulk/data/new/java/test.java.erb +5 -0
  100. data/lib/embulk/data/new/ruby/Gemfile +2 -0
  101. data/lib/embulk/data/new/ruby/Rakefile +1 -0
  102. data/lib/embulk/data/new/ruby/filter.rb.erb +39 -0
  103. data/lib/embulk/data/new/ruby/gemspec.erb +19 -0
  104. data/lib/embulk/data/new/ruby/input.rb.erb +47 -0
  105. data/lib/embulk/data/new/ruby/output.rb.erb +59 -0
  106. data/lib/embulk/data/package_data.rb +64 -0
  107. data/lib/embulk/data_source.rb +2 -2
  108. data/lib/embulk/decoder_plugin.rb +27 -0
  109. data/lib/embulk/encoder_plugin.rb +27 -0
  110. data/lib/embulk/error.rb +3 -0
  111. data/lib/embulk/file_input_plugin.rb +27 -0
  112. data/lib/embulk/file_output_plugin.rb +27 -0
  113. data/lib/embulk/filter_plugin.rb +28 -9
  114. data/lib/embulk/formatter_plugin.rb +105 -0
  115. data/lib/embulk/guess_csv.rb +10 -1
  116. data/lib/embulk/guess_plugin.rb +22 -27
  117. data/lib/embulk/input_plugin.rb +34 -20
  118. data/lib/embulk/java/bootstrap.rb +5 -0
  119. data/lib/embulk/java/imports.rb +7 -0
  120. data/lib/embulk/java_plugin.rb +84 -0
  121. data/lib/embulk/output_plugin.rb +35 -19
  122. data/lib/embulk/page.rb +1 -1
  123. data/lib/embulk/page_builder.rb +1 -1
  124. data/lib/embulk/parser_plugin.rb +76 -0
  125. data/lib/embulk/plugin.rb +130 -65
  126. data/lib/embulk/plugin_registry.rb +19 -8
  127. data/lib/embulk/schema.rb +4 -4
  128. data/lib/embulk/version.rb +1 -1
  129. data/settings.gradle +1 -0
  130. metadata +123 -90
  131. data/ChangeLog +0 -46
  132. data/embulk-cli/pom.xml +0 -94
  133. data/embulk-core/pom.xml +0 -148
  134. data/embulk-core/src/main/java/org/embulk/config/NextConfig.java +0 -26
  135. data/embulk-standards/pom.xml +0 -68
  136. data/embulk-standards/src/main/java/org/embulk/standards/S3FileInputPlugin.java +0 -250
  137. data/embulk-standards/src/test/java/org/embulk/standards/TestS3FileInputPlugin.java +0 -43
  138. data/pom.xml +0 -541
@@ -1,6 +1,5 @@
1
1
  dependencies {
2
2
  compile project(':embulk-core')
3
- compile 'com.amazonaws:aws-java-sdk:1.5.2'
4
3
 
5
4
  testCompile project(':embulk-core').sourceSets.test.output
6
5
  }
@@ -11,7 +11,7 @@ import org.embulk.config.TaskSource;
11
11
  import org.embulk.config.ConfigSource;
12
12
  import org.embulk.spi.Column;
13
13
  import org.embulk.spi.Schema;
14
- import org.embulk.spi.SchemaVisitor;
14
+ import org.embulk.spi.ColumnVisitor;
15
15
  import org.embulk.spi.FormatterPlugin;
16
16
  import org.embulk.spi.Page;
17
17
  import org.embulk.spi.PageOutput;
@@ -78,7 +78,7 @@ public class CsvFormatterPlugin
78
78
  {
79
79
  pageReader.setPage(page);
80
80
  while (pageReader.nextRecord()) {
81
- schema.visitColumns(new SchemaVisitor() {
81
+ schema.visitColumns(new ColumnVisitor() {
82
82
  public void booleanColumn(Column column)
83
83
  {
84
84
  addDelimiter(column);
@@ -3,6 +3,7 @@ package org.embulk.standards;
3
3
  import com.google.common.base.Preconditions;
4
4
  import com.google.common.collect.ImmutableMap;
5
5
  import com.google.common.base.Optional;
6
+ import com.google.common.collect.ImmutableSet;
6
7
  import org.embulk.config.Task;
7
8
  import org.embulk.config.Config;
8
9
  import org.embulk.config.ConfigDefault;
@@ -14,7 +15,7 @@ import org.embulk.spi.time.TimestampParseException;
14
15
  import org.embulk.spi.Column;
15
16
  import org.embulk.spi.Schema;
16
17
  import org.embulk.spi.SchemaConfig;
17
- import org.embulk.spi.SchemaVisitor;
18
+ import org.embulk.spi.ColumnVisitor;
18
19
  import org.embulk.spi.PageBuilder;
19
20
  import org.embulk.spi.ParserPlugin;
20
21
  import org.embulk.spi.Exec;
@@ -29,6 +30,14 @@ import java.util.Map;
29
30
  public class CsvParserPlugin
30
31
  implements ParserPlugin
31
32
  {
33
+ private static final ImmutableSet<String> TRUE_STRINGS =
34
+ ImmutableSet.of(
35
+ "true", "True", "TRUE",
36
+ "yes", "Yes", "YES",
37
+ "y", "Y",
38
+ "on", "On", "ON",
39
+ "1");
40
+
32
41
  public interface PluginTask
33
42
  extends Task, LineDecoder.DecoderTask, TimestampParser.ParserTask
34
43
  {
@@ -120,14 +129,14 @@ public class CsvParserPlugin
120
129
  break;
121
130
  }
122
131
 
123
- schema.visitColumns(new SchemaVisitor() {
132
+ schema.visitColumns(new ColumnVisitor() {
124
133
  public void booleanColumn(Column column)
125
134
  {
126
135
  String v = nextColumn(schema, tokenizer, nullStringOrNull);
127
136
  if (v == null) {
128
137
  pageBuilder.setNull(column);
129
138
  } else {
130
- pageBuilder.setBoolean(column, Boolean.parseBoolean(v));
139
+ pageBuilder.setBoolean(column, TRUE_STRINGS.contains(v));
131
140
  }
132
141
  }
133
142
 
@@ -3,10 +3,10 @@ package org.embulk.standards;
3
3
  import java.io.InputStream;
4
4
  import java.io.IOException;
5
5
  import java.util.zip.GZIPInputStream;
6
- import com.fasterxml.jackson.annotation.JacksonInject;
7
6
  import org.embulk.config.Task;
8
7
  import org.embulk.config.TaskSource;
9
8
  import org.embulk.config.ConfigSource;
9
+ import org.embulk.config.ConfigInject;
10
10
  import org.embulk.spi.DecoderPlugin;
11
11
  import org.embulk.spi.BufferAllocator;
12
12
  import org.embulk.spi.FileInput;
@@ -19,7 +19,7 @@ public class GzipFileDecoderPlugin
19
19
  public interface PluginTask
20
20
  extends Task
21
21
  {
22
- @JacksonInject
22
+ @ConfigInject
23
23
  public BufferAllocator getBufferAllocator();
24
24
  }
25
25
 
@@ -13,12 +13,14 @@ import java.nio.file.FileVisitResult;
13
13
  import java.nio.file.attribute.BasicFileAttributes;
14
14
  import javax.validation.constraints.NotNull;
15
15
  import com.google.common.collect.ImmutableList;
16
- import com.fasterxml.jackson.annotation.JacksonInject;
16
+ import com.google.common.base.Optional;
17
17
  import org.embulk.config.Config;
18
+ import org.embulk.config.ConfigInject;
19
+ import org.embulk.config.ConfigDefault;
18
20
  import org.embulk.config.Task;
19
21
  import org.embulk.config.TaskSource;
20
22
  import org.embulk.config.ConfigSource;
21
- import org.embulk.config.NextConfig;
23
+ import org.embulk.config.ConfigDiff;
22
24
  import org.embulk.config.CommitReport;
23
25
  import org.embulk.spi.BufferAllocator;
24
26
  import org.embulk.spi.Exec;
@@ -27,34 +29,37 @@ import org.embulk.spi.TransactionalFileInput;
27
29
  import org.embulk.spi.util.InputStreamFileInput;
28
30
  import org.slf4j.Logger;
29
31
 
30
- import static org.embulk.spi.util.Inputs.formatPath;
31
-
32
32
  public class LocalFileInputPlugin
33
33
  implements FileInputPlugin
34
34
  {
35
35
  public interface PluginTask
36
36
  extends Task
37
37
  {
38
- @Config("paths")
39
- @NotNull
40
- public List<String> getPathPrefixes();
38
+ @Config("path_prefix")
39
+ public String getPathPrefix();
40
+
41
+ @Config("last_path")
42
+ @ConfigDefault("null")
43
+ public Optional<String> getLastPath();
41
44
 
42
45
  public List<String> getFiles();
43
46
  public void setFiles(List<String> files);
44
47
 
45
- @JacksonInject
48
+ @ConfigInject
46
49
  public BufferAllocator getBufferAllocator();
47
50
  }
48
51
 
49
52
  private final Logger log = Exec.getLogger(getClass());
50
53
 
51
54
  @Override
52
- public NextConfig transaction(ConfigSource config, FileInputPlugin.Control control)
55
+ public ConfigDiff transaction(ConfigSource config, FileInputPlugin.Control control)
53
56
  {
54
57
  PluginTask task = config.loadConfig(PluginTask.class);
55
58
 
56
59
  // list files recursively
57
- task.setFiles(listFiles(task));
60
+ List<String> files = listFiles(task);
61
+ log.info("Loading files {}", files);
62
+ task.setFiles(files);
58
63
 
59
64
  // number of processors is same with number of files
60
65
  int processorCount = task.getFiles().size();
@@ -62,12 +67,12 @@ public class LocalFileInputPlugin
62
67
  }
63
68
 
64
69
  @Override
65
- public NextConfig resume(TaskSource taskSource,
70
+ public ConfigDiff resume(TaskSource taskSource,
66
71
  int processorCount,
67
72
  FileInputPlugin.Control control)
68
73
  {
69
74
  control.run(taskSource, processorCount);
70
- return Exec.newNextConfig();
75
+ return Exec.newConfigDiff();
71
76
  }
72
77
 
73
78
  @Override
@@ -78,22 +83,40 @@ public class LocalFileInputPlugin
78
83
 
79
84
  public List<String> listFiles(PluginTask task)
80
85
  {
86
+ Path pathPrefix = Paths.get(task.getPathPrefix()).normalize();
87
+ final Path directory;
88
+ final String fileNamePrefix;
89
+ if (Files.isDirectory(pathPrefix)) {
90
+ directory = pathPrefix;
91
+ fileNamePrefix = "";
92
+ } else {
93
+ fileNamePrefix = pathPrefix.getFileName().toString();
94
+ Path d = pathPrefix.getParent();
95
+ directory = (d == null ? Paths.get(".") : d);
96
+ }
97
+
81
98
  final ImmutableList.Builder<String> builder = ImmutableList.builder();
82
- for (String prefix : task.getPathPrefixes()) {
83
- String formatted = formatPath(prefix);
84
- try {
85
- log.info("Listing local files with prefix '{}'", formatted);
86
- Files.walkFileTree(Paths.get(formatted), new SimpleFileVisitor<Path>() {
87
- @Override
88
- public FileVisitResult visitFile(Path file, BasicFileAttributes aAttrs)
89
- {
90
- builder.add(file.toString());
91
- return FileVisitResult.CONTINUE;
99
+ final String lastPath = task.getLastPath().orNull();
100
+ try {
101
+ log.info("Listing local files at directory '{}' filtering filename by prefix '{}'", directory, fileNamePrefix);
102
+ Files.walkFileTree(directory, new SimpleFileVisitor<Path>() {
103
+ @Override
104
+ public FileVisitResult visitFile(Path path, BasicFileAttributes aAttrs)
105
+ {
106
+ if (lastPath == null || path.toString().compareTo(lastPath) > 0) {
107
+ if (path.getParent().equals(directory)) {
108
+ if (path.getFileName().toString().startsWith(fileNamePrefix)) {
109
+ builder.add(path.toString());
110
+ }
111
+ } else {
112
+ builder.add(path.toString());
113
+ }
92
114
  }
93
- });
94
- } catch (IOException ex) {
95
- throw new RuntimeException(String.format("Failed get a list of local files at '%s'", formatted), ex);
96
- }
115
+ return FileVisitResult.CONTINUE;
116
+ }
117
+ });
118
+ } catch (IOException ex) {
119
+ throw new RuntimeException(String.format("Failed get a list of local files at '%s'", directory), ex);
97
120
  }
98
121
  return builder.build();
99
122
  }
@@ -8,8 +8,9 @@ import java.io.OutputStream;
8
8
  import java.util.ArrayList;
9
9
  import java.util.List;
10
10
  import org.embulk.config.Config;
11
+ import org.embulk.config.ConfigDefault;
11
12
  import org.embulk.config.ConfigSource;
12
- import org.embulk.config.NextConfig;
13
+ import org.embulk.config.ConfigDiff;
13
14
  import org.embulk.config.CommitReport;
14
15
  import org.embulk.config.Task;
15
16
  import org.embulk.config.TaskSource;
@@ -25,38 +26,38 @@ public class LocalFileOutputPlugin
25
26
  public interface PluginTask
26
27
  extends Task
27
28
  {
28
- @Config("directory")
29
- public String getDirectory();
30
-
31
- @Config("file_name")
32
- public String getFileNameFormat();
29
+ @Config("path_prefix")
30
+ public String getPathPrefix();
33
31
 
34
32
  @Config("file_ext")
35
33
  public String getFileNameExtension();
36
34
 
37
- // TODO support in FileInputPlugin and FileOutputPlugin
38
- //@Config("compress_type")
39
- //public String getCompressType();
35
+ @Config("sequence_format")
36
+ @ConfigDefault("\".%03d.%02d\"")
37
+ public String getSequenceFormat();
40
38
  }
41
39
 
42
40
  private final Logger log = Exec.getLogger(getClass());
43
41
 
44
42
  @Override
45
- public NextConfig transaction(ConfigSource config, int processorCount,
43
+ public ConfigDiff transaction(ConfigSource config, int processorCount,
46
44
  FileOutputPlugin.Control control)
47
45
  {
48
46
  PluginTask task = config.loadConfig(PluginTask.class);
49
47
 
48
+ // validate sequence_format
49
+ String.format(task.getSequenceFormat(), 0, 0);
50
+
50
51
  return resume(task.dump(), processorCount, control);
51
52
  }
52
53
 
53
54
  @Override
54
- public NextConfig resume(TaskSource taskSource,
55
+ public ConfigDiff resume(TaskSource taskSource,
55
56
  int processorCount,
56
57
  FileOutputPlugin.Control control)
57
58
  {
58
59
  control.run(taskSource);
59
- return Exec.newNextConfig();
60
+ return Exec.newConfigDiff();
60
61
  }
61
62
 
62
63
  @Override
@@ -70,11 +71,9 @@ public class LocalFileOutputPlugin
70
71
  {
71
72
  PluginTask task = taskSource.loadTask(PluginTask.class);
72
73
 
73
- // TODO format path using timestamp
74
- final String fileName = task.getFileNameFormat();
75
-
76
- final String pathPrefix = task.getDirectory() + File.separator + fileName;
74
+ final String pathPrefix = task.getPathPrefix();
77
75
  final String pathSuffix = task.getFileNameExtension();
76
+ final String sequenceFormat = task.getSequenceFormat();
78
77
 
79
78
  final List<String> fileNames = new ArrayList<>();
80
79
 
@@ -85,7 +84,7 @@ public class LocalFileOutputPlugin
85
84
  public void nextFile()
86
85
  {
87
86
  closeFile();
88
- String path = pathPrefix + String.format(".%03d.%02d.", processorIndex, fileIndex) + pathSuffix;
87
+ String path = pathPrefix + String.format(sequenceFormat, processorIndex, fileIndex) + pathSuffix;
89
88
  log.info("Writing local file '{}'", path);
90
89
  fileNames.add(path);
91
90
  try {
@@ -3,7 +3,7 @@ package org.embulk.standards;
3
3
  import java.util.List;
4
4
  import org.embulk.config.ConfigSource;
5
5
  import org.embulk.config.TaskSource;
6
- import org.embulk.config.NextConfig;
6
+ import org.embulk.config.ConfigDiff;
7
7
  import org.embulk.config.CommitReport;
8
8
  import org.embulk.spi.Schema;
9
9
  import org.embulk.spi.Page;
@@ -15,19 +15,19 @@ public class NullOutputPlugin
15
15
  implements OutputPlugin
16
16
  {
17
17
  @Override
18
- public NextConfig transaction(ConfigSource config,
18
+ public ConfigDiff transaction(ConfigSource config,
19
19
  Schema schema, int processorCount,
20
20
  OutputPlugin.Control control)
21
21
  {
22
22
  return resume(Exec.newTaskSource(), schema, processorCount, control);
23
23
  }
24
24
 
25
- public NextConfig resume(TaskSource taskSource,
25
+ public ConfigDiff resume(TaskSource taskSource,
26
26
  Schema schema, int processorCount,
27
27
  OutputPlugin.Control control)
28
28
  {
29
29
  control.run(taskSource);
30
- return Exec.newNextConfig();
30
+ return Exec.newConfigDiff();
31
31
  }
32
32
 
33
33
  public void cleanup(TaskSource taskSource,
@@ -22,7 +22,6 @@ public class StandardPluginModule
22
22
 
23
23
  // input plugins
24
24
  registerPluginTo(binder, InputPlugin.class, "file", LocalFileInputPlugin.class);
25
- registerPluginTo(binder, InputPlugin.class, "s3_file", S3FileInputPlugin.class);
26
25
 
27
26
  // parser plugins
28
27
  registerPluginTo(binder, ParserPlugin.class, "csv", CsvParserPlugin.class);
@@ -3,12 +3,12 @@ package org.embulk.standards;
3
3
  import java.util.List;
4
4
  import org.embulk.config.ConfigSource;
5
5
  import org.embulk.config.TaskSource;
6
- import org.embulk.config.NextConfig;
6
+ import org.embulk.config.ConfigDiff;
7
7
  import org.embulk.config.CommitReport;
8
8
  import org.embulk.config.Task;
9
9
  import org.embulk.spi.time.TimestampFormatter;
10
10
  import org.embulk.spi.Schema;
11
- import org.embulk.spi.SchemaVisitor;
11
+ import org.embulk.spi.ColumnVisitor;
12
12
  import org.embulk.spi.Column;
13
13
  import org.embulk.spi.Page;
14
14
  import org.embulk.spi.Exec;
@@ -26,7 +26,7 @@ public class StdoutOutputPlugin
26
26
  }
27
27
 
28
28
  @Override
29
- public NextConfig transaction(ConfigSource config,
29
+ public ConfigDiff transaction(ConfigSource config,
30
30
  Schema schema, int processorCount,
31
31
  OutputPlugin.Control control)
32
32
  {
@@ -35,12 +35,12 @@ public class StdoutOutputPlugin
35
35
  }
36
36
 
37
37
  @Override
38
- public NextConfig resume(TaskSource taskSource,
38
+ public ConfigDiff resume(TaskSource taskSource,
39
39
  Schema schema, int processorCount,
40
40
  OutputPlugin.Control control)
41
41
  {
42
42
  control.run(taskSource);
43
- return Exec.newNextConfig();
43
+ return Exec.newConfigDiff();
44
44
  }
45
45
 
46
46
  public void cleanup(TaskSource taskSource,
Binary file
@@ -1,6 +1,6 @@
1
- #Wed Jan 21 18:25:48 PST 2015
1
+ #Wed Feb 04 13:46:12 PST 2015
2
2
  distributionBase=GRADLE_USER_HOME
3
3
  distributionPath=wrapper/dists
4
4
  zipStoreBase=GRADLE_USER_HOME
5
5
  zipStorePath=wrapper/dists
6
- distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-bin.zip
6
+ distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-bin.zip
data/lib/embulk/buffer.rb CHANGED
@@ -2,14 +2,14 @@
2
2
  module Embulk
3
3
  class Buffer < String
4
4
  if Embulk.java?
5
- def self.from_java_object(java_buffer)
5
+ def self.from_java(java_buffer)
6
6
  byte_list = org.jruby.util.ByteList.new(java_buffer.array(), java_buffer.offset(), java_buffer.limit(), false)
7
7
  buffer = new
8
8
  buffer.replace(org.jruby.RubyString.new(JRuby.runtime, self, byte_list).dup) # TODO simplify
9
9
  buffer
10
10
  end
11
11
 
12
- def java_object
12
+ def to_java
13
13
  Java::Buffer.wrap(to_java_bytes)
14
14
  end
15
15
  end
data/lib/embulk/column.rb CHANGED
@@ -6,26 +6,26 @@ module Embulk
6
6
  end
7
7
 
8
8
  if Embulk.java?
9
- def self.from_java_object(java_column)
9
+ def self.from_java(java_column)
10
10
  Column.new(
11
11
  java_column.getIndex,
12
12
  java_column.getName,
13
- Type.from_java_object(java_column.getType))
13
+ Type.from_java(java_column.getType))
14
14
  end
15
15
 
16
- def java_object
17
- Java::Column.new(index, name, Type.to_java_object(type))
16
+ def to_java
17
+ Java::Column.new(index, name, Type.new_java_type(type))
18
18
  end
19
19
  end
20
20
  end
21
21
 
22
22
  module Type
23
23
  if Embulk.java?
24
- def self.from_java_object(java_type)
24
+ def self.from_java(java_type)
25
25
  java_type.getName.to_sym
26
26
  end
27
27
 
28
- def self.to_java_object(ruby_type)
28
+ def self.new_java_type(ruby_type)
29
29
  case ruby_type
30
30
  when :boolean
31
31
  Java::Types::BOOLEAN