embulk-input-gcs 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8331e71b0a9f82c385f328df68c243d2394b4a28
4
- data.tar.gz: 0b923e4a693e3373f160da81a3190baf2ceba99e
3
+ metadata.gz: 6ce6983c74eefcfcb205c892493bd7ff599e57c2
4
+ data.tar.gz: 98715ab6fc0161496ef3b271f28a6d4b06c85f64
5
5
  SHA512:
6
- metadata.gz: 5bd006df0e41586b1a9ebcdae830e11fe6621a80bb15cd5b8ee5e4ccd5dbb71431b69b86834d11bd9cd50c1f7adac5915ddd5a422a2c9fb8b0ebe6c01345cb23
7
- data.tar.gz: 5fe9f54ad9489c920b6eb08bdc735bdbd71b02ccdcb3bcdae5725ca7ba6f6dede5ea0f8e94a6586a44dd155bb19366dd2d097c66a80ad944e304fc3e0821136a
6
+ metadata.gz: 20a443c53891a35dd23ef4e1a149b97ee46dd8052fc0c92927643c0ed83da3d47a80acf49f4cabc9e26b23aa389e0aecaa446f4d7d803f05eb0ea8e1d99e27ca
7
+ data.tar.gz: c2a1a41105caae03abfa2dd19331bc07486deb267d8166626bde9a0009868d1086e8fd92f8042427b9c1bb3766f41d78c7519106758d7d875b1e8e25fd95cd22
@@ -15,7 +15,7 @@ configurations {
15
15
  sourceCompatibility = 1.7
16
16
  targetCompatibility = 1.7
17
17
 
18
- version = "0.1.3"
18
+ version = "0.1.4"
19
19
 
20
20
  dependencies {
21
21
  compile "org.embulk:embulk-core:0.5.1"
@@ -49,7 +49,7 @@ Gem::Specification.new do |spec|
49
49
  spec.description = %[gcs input plugin is an Embulk plugin that loads records from Google Cloud Storage. read by any input plugins. Search the output plugins by 'embulk-output' keyword.]
50
50
  spec.email = ["satoshiakama@gmail.com"]
51
51
  spec.licenses = ["Apache-2.0"]
52
- spec.homepage = "https://github.com/sakama/embulk-input-gcs"
52
+ spec.homepage = "https://github.com/embulk/embulk-input-gcs"
53
53
 
54
54
  spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
55
55
  spec.test_files = spec.files.grep(%r"^(test|spec)/")
@@ -81,7 +81,7 @@ public class GcsFileInputPlugin
81
81
  public ConfigDiff transaction(ConfigSource config,
82
82
  FileInputPlugin.Control control)
83
83
  {
84
- final PluginTask task = config.loadConfig(PluginTask.class);
84
+ PluginTask task = config.loadConfig(PluginTask.class);
85
85
 
86
86
  try {
87
87
  httpTransport = GoogleNetHttpTransport.newTrustedTransport();
@@ -101,17 +101,24 @@ public class GcsFileInputPlugin
101
101
  int taskCount,
102
102
  FileInputPlugin.Control control)
103
103
  {
104
- final PluginTask task = taskSource.loadTask(PluginTask.class);
104
+ PluginTask task = taskSource.loadTask(PluginTask.class);
105
105
 
106
106
  control.run(taskSource, taskCount);
107
107
 
108
+ ConfigDiff configDiff = Exec.newConfigDiff();
109
+
108
110
  List<String> files = new ArrayList<String>(task.getFiles());
109
- if (files.size() == 0) {
110
- return null;
111
+ if (files.isEmpty()) {
112
+ // keep the last value if any
113
+ if (task.getLastPath().isPresent()) {
114
+ configDiff.set("last_path", task.getLastPath().get());
115
+ }
116
+ } else {
117
+ Collections.sort(files);
118
+ configDiff.set("last_path", files.get(files.size() - 1));
111
119
  }
112
- Collections.sort(files);
113
- return Exec.newConfigDiff().
114
- set("last_path", files.get(files.size() - 1));
120
+
121
+ return configDiff;
115
122
  }
116
123
 
117
124
  @Override
@@ -189,7 +196,7 @@ public class GcsFileInputPlugin
189
196
  log.debug("bucket timeCreated: " + bk.getTimeCreated());
190
197
  log.debug("bucket owner: " + bk.getOwner());
191
198
  }
192
- } catch (Exception e) {
199
+ } catch (IOException e) {
193
200
  log.warn("Could not access to bucket:" + bucket);
194
201
  log.warn(e.getMessage());
195
202
  }
@@ -219,7 +226,7 @@ public class GcsFileInputPlugin
219
226
  lastKey = objects.getNextPageToken();
220
227
  listObjects.setPageToken(lastKey);
221
228
  } while (lastKey != null);
222
- } catch (Exception e) {
229
+ } catch (IOException e) {
223
230
  log.warn(String.format("Could not get file list from bucket:%s", bucket));
224
231
  log.warn(e.getMessage());
225
232
  }
@@ -230,7 +237,7 @@ public class GcsFileInputPlugin
230
237
  @Override
231
238
  public TransactionalFileInput open(TaskSource taskSource, int taskIndex)
232
239
  {
233
- final PluginTask task = taskSource.loadTask(PluginTask.class);
240
+ PluginTask task = taskSource.loadTask(PluginTask.class);
234
241
  return new GcsFileInput(task, taskIndex);
235
242
  }
236
243
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-gcs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satoshi Akama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-15 00:00:00.000000000 Z
11
+ date: 2015-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ files:
58
58
  - src/test/java/org/embulk/input/gcs/TestGcsFileInputPlugin.java
59
59
  - classpath/commons-codec-1.3.jar
60
60
  - classpath/commons-logging-1.1.1.jar
61
- - classpath/embulk-input-gcs-0.1.3.jar
61
+ - classpath/embulk-input-gcs-0.1.4.jar
62
62
  - classpath/google-api-client-1.19.1.jar
63
63
  - classpath/google-api-services-storage-v1-rev27-1.19.1.jar
64
64
  - classpath/google-http-client-1.19.0.jar
@@ -67,7 +67,7 @@ files:
67
67
  - classpath/httpclient-4.0.1.jar
68
68
  - classpath/httpcore-4.0.1.jar
69
69
  - classpath/jsr305-1.3.9.jar
70
- homepage: https://github.com/sakama/embulk-input-gcs
70
+ homepage: https://github.com/embulk/embulk-input-gcs
71
71
  licenses:
72
72
  - Apache-2.0
73
73
  metadata: {}