embulk-input-azure_blob_storage 0.1.5 → 0.1.6

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: 60cc4b85fafbfd719fdb70232f8c7b44c3153d9f
4
- data.tar.gz: 50af2362a8edbc752bbc1116a36ede8a3f64aa84
3
+ metadata.gz: c8a820c0389e246171f6f0ccd9ff535ae4be3b56
4
+ data.tar.gz: 9a31f3ba0a98659a4745923cadb485b87507ad60
5
5
  SHA512:
6
- metadata.gz: b11039548309b1d49bc7b87e54a6ff60eb36863e8f75127f087f71520a957d833aac197f577dbbf262ae0d68a656edd92b0c5fa5ed42fb7c90c62f8e5f551b15
7
- data.tar.gz: ecb4b533a64440f78a07ebdb8e1a7b5a4dba91a79a4c7121e32463ecdb4e5746d26186078ae938dd73774273001d917ac09b914d20fa312690ccde91a49986d5
6
+ metadata.gz: d636e2392ad6c94b8d218e03ac84e9b1e95e29229bd30af937b9e0cd85a247f37588bea12c4ca336ea6d992ac89812a2a0d0834e087f3b3a342e92d897f3032e
7
+ data.tar.gz: aa4c141450109ad1dca6d04c1c9f7dfade3f471dbd5f821b5b87220971ea12387fa6278c4265622e70640d0ed2fbe699653b98146a1ca3093ce1fc7d92e9a04d
@@ -1,13 +1,17 @@
1
- ## 0.1.5 - 2015-03-30
1
+ ## 0.1.6 - 2016-04-01
2
+
3
+ * [maintenance] Small refactoring [#9](https://github.com/sakama/embulk-input-azure_blob_storage/pull/9)
4
+
5
+ ## 0.1.5 - 2016-03-30
2
6
 
3
7
  * [maintenance] Use RetryExecutor when retry is needed [#8](https://github.com/sakama/embulk-input-azure_blob_storage/pull/8)
4
8
 
5
- ## 0.1.4 - 2015-03-22
9
+ ## 0.1.4 - 2016-03-22
6
10
 
7
11
  * [new feature] Support `last_path` option [#7](https://github.com/sakama/embulk-input-azure_blob_storage/pull/7)
8
12
  * [new feature] Support `path_match_pattern` option [#6](https://github.com/sakama/embulk-input-azure_blob_storage/pull/6)
9
13
 
10
- ## 0.1.3 - 2015-03-16
14
+ ## 0.1.3 - 2016-03-16
11
15
 
12
16
  * [maintenance] Add unit test [#4](https://github.com/sakama/embulk-input-azure_blob_storage/pull/4)
13
17
  * [maintenance] Add retry logic [#3](https://github.com/sakama/embulk-input-azure_blob_storage/pull/3)
@@ -17,7 +17,7 @@ configurations {
17
17
  sourceCompatibility = 1.7
18
18
  targetCompatibility = 1.7
19
19
 
20
- version = "0.1.5"
20
+ version = "0.1.6"
21
21
 
22
22
  dependencies {
23
23
  compile "org.embulk:embulk-core:0.8.2"
@@ -66,7 +66,7 @@ public class AzureBlobStorageFileInputPlugin
66
66
  int getMaxResults();
67
67
 
68
68
  @Config("max_connection_retry")
69
- @ConfigDefault("10") // 10 times retry to connect sftp server if failed.
69
+ @ConfigDefault("10") // 10 times retry to connect Azure Blob Storage if failed.
70
70
  int getMaxConnectionRetry();
71
71
 
72
72
  FileList getFiles();
@@ -83,8 +83,7 @@ public class AzureBlobStorageFileInputPlugin
83
83
  {
84
84
  final PluginTask task = config.loadConfig(PluginTask.class);
85
85
 
86
- CloudBlobClient blobClient = newAzureClient(task.getAccountName(), task.getAccountKey());
87
- task.setFiles(listFiles(blobClient, task));
86
+ task.setFiles(listFiles(task));
88
87
 
89
88
  return resume(task.dump(), task.getFiles().getTaskCount(), control);
90
89
  }
@@ -122,18 +121,18 @@ public class AzureBlobStorageFileInputPlugin
122
121
  return account.createCloudBlobClient();
123
122
  }
124
123
 
125
- private FileList listFiles(CloudBlobClient client, PluginTask task)
124
+ private FileList listFiles(PluginTask task)
126
125
  {
127
126
  if (task.getPathPrefix().equals("/")) {
128
127
  log.info("Listing files with prefix \"/\". This doesn't mean all files in a bucket. If you intend to read all files, use \"path_prefix: ''\" (empty string) instead.");
129
128
  }
130
129
  FileList.Builder builder = new FileList.Builder(task);
131
130
 
132
- return listFilesWithPrefix(builder, client, task.getContainer(), task.getPathPrefix(),
131
+ return listFilesWithPrefix(builder, task.getAccountName(), task.getAccountKey(), task.getContainer(), task.getPathPrefix(),
133
132
  task.getLastPath(), task.getMaxResults(), task.getMaxConnectionRetry());
134
133
  }
135
134
 
136
- private static FileList listFilesWithPrefix(final FileList.Builder builder, final CloudBlobClient client,
135
+ private static FileList listFilesWithPrefix(final FileList.Builder builder, final String accountName, final String accountKey,
137
136
  final String containerName, final String prefix, final Optional<String> lastPath,
138
137
  final int maxResults, final int maxConnectionRetry)
139
138
  {
@@ -147,6 +146,7 @@ public class AzureBlobStorageFileInputPlugin
147
146
  @Override
148
147
  public FileList call() throws StorageException, URISyntaxException, IOException
149
148
  {
149
+ CloudBlobClient client = newAzureClient(accountName, accountKey);
150
150
  ResultContinuation token = null;
151
151
  if (lastKey != null) {
152
152
  token = new ResultContinuation();
@@ -3,7 +3,6 @@ package org.embulk.input.azure_blob_storage;
3
3
  import com.google.common.collect.ImmutableList;
4
4
  import com.google.common.collect.ImmutableMap;
5
5
  import com.google.common.collect.Lists;
6
- import com.microsoft.azure.storage.blob.CloudBlobClient;
7
6
  import org.embulk.EmbulkTestRuntime;
8
7
  import org.embulk.config.ConfigDiff;
9
8
  import org.embulk.config.ConfigException;
@@ -189,13 +188,9 @@ public class TestAzureBlobStorageFileInputPlugin
189
188
  }
190
189
  });
191
190
 
192
- Method newAzureClient = AzureBlobStorageFileInputPlugin.class.getDeclaredMethod("newAzureClient", String.class, String.class);
193
- newAzureClient.setAccessible(true);
194
- CloudBlobClient client = (CloudBlobClient) newAzureClient.invoke(plugin, task.getAccountName(), task.getAccountKey());
195
-
196
- Method listFiles = AzureBlobStorageFileInputPlugin.class.getDeclaredMethod("listFiles", CloudBlobClient.class, PluginTask.class);
191
+ Method listFiles = AzureBlobStorageFileInputPlugin.class.getDeclaredMethod("listFiles", PluginTask.class);
197
192
  listFiles.setAccessible(true);
198
- FileList actual = (FileList) listFiles.invoke(plugin, client, task);
193
+ FileList actual = (FileList) listFiles.invoke(plugin, task);
199
194
  assertEquals(expected.get(0), actual.get(0).get(0));
200
195
  assertEquals(expected.get(1), actual.get(1).get(0));
201
196
  assertEquals(AZURE_CONTAINER_IMPORT_DIRECTORY + "sample_02.csv", configDiff.get(String.class, "last_path"));
@@ -208,13 +203,9 @@ public class TestAzureBlobStorageFileInputPlugin
208
203
  PluginTask task = config.loadConfig(PluginTask.class);
209
204
  runner.transaction(config, new Control());
210
205
 
211
- Method newAzureClient = AzureBlobStorageFileInputPlugin.class.getDeclaredMethod("newAzureClient", String.class, String.class);
212
- newAzureClient.setAccessible(true);
213
- CloudBlobClient client = (CloudBlobClient) newAzureClient.invoke(plugin, task.getAccountName(), task.getAccountKey());
214
-
215
- Method listFiles = AzureBlobStorageFileInputPlugin.class.getDeclaredMethod("listFiles", CloudBlobClient.class, PluginTask.class);
206
+ Method listFiles = AzureBlobStorageFileInputPlugin.class.getDeclaredMethod("listFiles", PluginTask.class);
216
207
  listFiles.setAccessible(true);
217
- task.setFiles((FileList) listFiles.invoke(plugin, client, task));
208
+ task.setFiles((FileList) listFiles.invoke(plugin, task));
218
209
 
219
210
  assertRecords(config, output);
220
211
  }
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.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satoshi Akama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-30 00:00:00.000000000 Z
11
+ date: 2016-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -64,7 +64,7 @@ files:
64
64
  - src/test/resources/sample_02.csv
65
65
  - classpath/azure-storage-4.0.0.jar
66
66
  - classpath/commons-lang3-3.4.jar
67
- - classpath/embulk-input-azure_blob_storage-0.1.5.jar
67
+ - classpath/embulk-input-azure_blob_storage-0.1.6.jar
68
68
  - classpath/jackson-core-2.6.0.jar
69
69
  homepage: https://github.com/sakama/embulk-input-azure_blob_storage
70
70
  licenses: