embulk-input-azure_blob_storage 0.1.8 → 0.2.0

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: f1caa223dfe66430c7a479aceb4a34859bbfcac7
4
- data.tar.gz: 911394ff73af6685d62fcfd560736b1669383e0b
3
+ metadata.gz: 023f5fb334a7684e46155d3a3538168ca6c10d6c
4
+ data.tar.gz: 2a7ed41ce1b0f56bca0a3134add627295d5d359d
5
5
  SHA512:
6
- metadata.gz: 6b52d4764546a1a083a340c1fe0de7ac1b2674c5ea03758c7eb94d3704165564aa0dfb8b23ec4ac4d592c333031dff180e990419fbd3d15813e8cedd169d1e82
7
- data.tar.gz: 1cf0d786da368c7c195b79a3f2909bf8092b3f32aaad70fd28deb29de47833a60217daa92c3db26745373f0742e13bed5a2a3650ad63342cc15e3d4f2fe902a5
6
+ metadata.gz: fa524db4147ff03b7fe7ae509c8096c0cb1b191239a2959b9e969217ec48398bb552e588fe2b05f4f3610cbab0934dd87b14eae288f3ca0ff445959134e7879a
7
+ data.tar.gz: af78a9bc48198e812795189134bcaf449fd246d7ee90fc2f6e9ac9e70bfa1ddbf4192dd9f7863545b22a522591de91e0f67881a9a2dee65d2fed947d498f25b1
@@ -1,3 +1,6 @@
1
+ ## 0.2.0 - 2018-12-26
2
+ * [new feature] Use file name output feature in Embulk core to show file name instead of logging [#17](https://github.com/sakama/embulk-input-azure_blob_storage/pull/17)
3
+
1
4
  ## 0.1.8 - 2018-10-18
2
5
  * [maintenance] Update dependencies [#15](https://github.com/sakama/embulk-input-azure_blob_storage/pull/15)
3
6
 
data/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
 
4
4
  [Embulk](http://www.embulk.org/) file input plugin read files stored on [Microsoft Azure](https://azure.microsoft.com/) [Blob Storage](https://azure.microsoft.com/en-us/documentation/articles/storage-introduction/#blob-storage)
5
5
 
6
+ embulk-input-azure_blog_storage v0.2.0+ requires Embulk v0.9.12+
7
+
6
8
  ## Overview
7
9
 
8
10
  * **Plugin type**: file input
@@ -17,17 +17,17 @@ configurations {
17
17
  sourceCompatibility = 1.8
18
18
  targetCompatibility = 1.8
19
19
 
20
- version = "0.1.8"
20
+ version = "0.2.0"
21
21
 
22
22
  dependencies {
23
- compile "org.embulk:embulk-core:0.9.8"
24
- provided "org.embulk:embulk-core:0.9.8"
23
+ compile "org.embulk:embulk-core:0.9.12"
24
+ provided "org.embulk:embulk-core:0.9.12"
25
25
 
26
26
  compile "com.microsoft.azure:azure-storage:8.0.0"
27
27
 
28
28
  testCompile "junit:junit:4.12"
29
- testCompile "org.embulk:embulk-core:0.9.8:tests"
30
- testCompile "org.embulk:embulk-standards:0.9.8"
29
+ testCompile "org.embulk:embulk-core:0.9.12:tests"
30
+ testCompile "org.embulk:embulk-standards:0.9.12"
31
31
  }
32
32
 
33
33
  task classpath(type: Copy, dependsOn: ["jar"]) {
@@ -1,7 +1,6 @@
1
1
  package org.embulk.input.azure_blob_storage;
2
2
 
3
3
  import com.google.common.base.Charsets;
4
- import com.google.common.base.Optional;
5
4
  import com.google.common.base.Throwables;
6
5
  import com.google.common.io.BaseEncoding;
7
6
  import com.microsoft.azure.storage.CloudStorageAccount;
@@ -27,17 +26,18 @@ import org.embulk.spi.Exec;
27
26
  import org.embulk.spi.FileInputPlugin;
28
27
  import org.embulk.spi.TransactionalFileInput;
29
28
  import org.embulk.spi.util.InputStreamFileInput;
29
+ import org.embulk.spi.util.InputStreamFileInput.InputStreamWithHints;
30
30
  import org.embulk.spi.util.RetryExecutor.RetryGiveupException;
31
31
  import org.embulk.spi.util.RetryExecutor.Retryable;
32
32
  import org.slf4j.Logger;
33
33
  import static org.embulk.spi.util.RetryExecutor.retryExecutor;
34
34
 
35
35
  import java.io.IOException;
36
- import java.io.InputStream;
37
36
  import java.net.URISyntaxException;
38
37
  import java.security.InvalidKeyException;
39
38
  import java.util.Iterator;
40
39
  import java.util.List;
40
+ import java.util.Optional;
41
41
 
42
42
  public class AzureBlobStorageFileInputPlugin
43
43
  implements FileInputPlugin
@@ -260,7 +260,7 @@ public class AzureBlobStorageFileInputPlugin
260
260
  }
261
261
 
262
262
  @Override
263
- public InputStream openNext() throws IOException
263
+ public InputStreamWithHints openNextWithHints()
264
264
  {
265
265
  if (opened || !iterator.hasNext()) {
266
266
  return null;
@@ -272,13 +272,16 @@ public class AzureBlobStorageFileInputPlugin
272
272
  .withRetryLimit(maxConnectionRetry)
273
273
  .withInitialRetryWait(500)
274
274
  .withMaxRetryWait(30 * 1000)
275
- .runInterruptible(new Retryable<InputStream>() {
275
+ .runInterruptible(new Retryable<InputStreamWithHints>() {
276
276
  @Override
277
- public InputStream call() throws StorageException, URISyntaxException, IOException
277
+ public InputStreamWithHints call() throws StorageException, URISyntaxException, IOException
278
278
  {
279
279
  CloudBlobContainer container = client.getContainerReference(containerName);
280
280
  CloudBlob blob = container.getBlockBlobReference(key);
281
- return blob.openInputStream();
281
+ return new InputStreamWithHints(
282
+ blob.openInputStream(),
283
+ String.format("%s/%s", containerName, key)
284
+ );
282
285
  }
283
286
 
284
287
  @Override
@@ -3,7 +3,6 @@ package org.embulk.input.azure_blob_storage;
3
3
  import com.fasterxml.jackson.annotation.JsonCreator;
4
4
  import com.fasterxml.jackson.annotation.JsonIgnore;
5
5
  import com.fasterxml.jackson.annotation.JsonProperty;
6
- import com.google.common.base.Optional;
7
6
  import com.google.common.base.Throwables;
8
7
  import org.embulk.config.Config;
9
8
  import org.embulk.config.ConfigDefault;
@@ -24,6 +23,7 @@ import java.nio.charset.StandardCharsets;
24
23
  import java.util.AbstractList;
25
24
  import java.util.ArrayList;
26
25
  import java.util.List;
26
+ import java.util.Optional;
27
27
  import java.util.regex.Pattern;
28
28
  import java.util.zip.GZIPInputStream;
29
29
  import java.util.zip.GZIPOutputStream;
@@ -182,7 +182,7 @@ public class FileList
182
182
  catch (IOException ex) {
183
183
  throw Throwables.propagate(ex);
184
184
  }
185
- return new FileList(binary.toByteArray(), getSplits(entries), Optional.fromNullable(last));
185
+ return new FileList(binary.toByteArray(), getSplits(entries), Optional.ofNullable(last));
186
186
  }
187
187
 
188
188
  private List<List<Entry>> getSplits(List<Entry> all)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-azure_blob_storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satoshi Akama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-18 00:00:00.000000000 Z
11
+ date: 2018-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -65,9 +65,9 @@ files:
65
65
  - src/test/resources/sample_01.csv
66
66
  - src/test/resources/sample_02.csv
67
67
  - classpath/azure-storage-8.0.0.jar
68
+ - classpath/embulk-input-azure_blob_storage-0.2.0.jar
68
69
  - classpath/guava-20.0.jar
69
70
  - classpath/azure-keyvault-core-1.0.0.jar
70
- - classpath/embulk-input-azure_blob_storage-0.1.8.jar
71
71
  - classpath/jackson-core-2.9.4.jar
72
72
  homepage: https://github.com/embulk/embulk-input-azure_blob_storage
73
73
  licenses: