embulk-input-azure_blob_storage 0.1.5 → 0.1.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8a820c0389e246171f6f0ccd9ff535ae4be3b56
|
4
|
+
data.tar.gz: 9a31f3ba0a98659a4745923cadb485b87507ad60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d636e2392ad6c94b8d218e03ac84e9b1e95e29229bd30af937b9e0cd85a247f37588bea12c4ca336ea6d992ac89812a2a0d0834e087f3b3a342e92d897f3032e
|
7
|
+
data.tar.gz: aa4c141450109ad1dca6d04c1c9f7dfade3f471dbd5f821b5b87220971ea12387fa6278c4265622e70640d0ed2fbe699653b98146a1ca3093ce1fc7d92e9a04d
|
data/CHANGELOG.md
CHANGED
@@ -1,13 +1,17 @@
|
|
1
|
-
## 0.1.
|
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 -
|
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 -
|
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)
|
data/build.gradle
CHANGED
@@ -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
|
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
|
-
|
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(
|
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,
|
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
|
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();
|
data/src/test/java/org/embulk/input/azure_blob_storage/TestAzureBlobStorageFileInputPlugin.java
CHANGED
@@ -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
|
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,
|
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
|
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,
|
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.
|
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-
|
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.
|
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:
|