embulk-output-s3_per_record 0.1.1 → 0.1.2

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: 66c630852cd7438c47f5c7d4ce90e5ae9c260c28
4
- data.tar.gz: 7485c4a4d693740fb7f6ef9975d31ab3f63522fc
3
+ metadata.gz: df24af87908ca267e9a6518308f0bfb319d14808
4
+ data.tar.gz: 1f9f6af566dff9c786c1f9531b7527d039eadcf2
5
5
  SHA512:
6
- metadata.gz: d05834b8904544d92f524e09919dd8fc6793da6243a76c43056da0d8c16d025534ab5d4d036c63625acd61545a907e8bda4431312f072f66df66cdde8dc42858
7
- data.tar.gz: 9181a74cc5ccd62a19090d864f96697ee74b7c0b4defeb2158b51fe4f02f7c9c89b146b105d67ecf34efc2b567d290fb7aaa84b29b69aa0726e5a714f26bc406
6
+ metadata.gz: 083299386ca77263932553aaab9bb0e735f73b24ebe502328568ab70e4d7d0ff5c9711792c7a4758a0a3daeb5c74f2b5567473cc9310b325f78f6d8fe25f333e
7
+ data.tar.gz: 38912a1f91df7c26d1db2a023babd24b7a696b8f132f8218add7b59890bd668fd172205fff76105fd851d7ed346a22314502176703861983a37a7aff73824605
data/build.gradle CHANGED
@@ -13,7 +13,7 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.1.1"
16
+ version = "0.1.2"
17
17
 
18
18
  sourceCompatibility = 1.7
19
19
  targetCompatibility = 1.7
@@ -113,7 +113,6 @@ public class S3PerRecordOutputPlugin
113
113
  private final List<KeyPart> keyPattern;
114
114
  private final Column dataColumn;
115
115
  private final Schema schema;
116
- private List<Upload> uploads;
117
116
  private final boolean decodeBase64;
118
117
 
119
118
  public S3PerRecordPageOutput(PluginTask task, Schema schema) {
@@ -130,8 +129,6 @@ public class S3PerRecordOutputPlugin
130
129
  credentials = new DefaultAWSCredentialsProviderChain().getCredentials();
131
130
  }
132
131
  transferManager = new TransferManager(credentials);
133
-
134
- uploads = new ArrayList<>();
135
132
  }
136
133
 
137
134
  private List<KeyPart> makeKeyPattern(final String key) {
@@ -177,8 +174,8 @@ public class S3PerRecordOutputPlugin
177
174
 
178
175
  try (InputStream is = new ByteArrayInputStream(payloadBytes)) {
179
176
  Upload upload = transferManager.upload(bucket, key, is, metadata);
180
- uploads.add(upload);
181
- } catch (IOException e) {
177
+ upload.waitForUploadResult();
178
+ } catch (InterruptedException | IOException e) {
182
179
  throw new RuntimeException(e);
183
180
  }
184
181
  }
@@ -195,15 +192,7 @@ public class S3PerRecordOutputPlugin
195
192
  @Override
196
193
  public void finish()
197
194
  {
198
- try {
199
- for (Upload upload : uploads) {
200
- upload.waitForUploadResult();
201
- }
202
- } catch (InterruptedException e) {
203
- throw new RuntimeException(e);
204
- } finally {
205
- close();
206
- }
195
+ close();
207
196
  }
208
197
 
209
198
  @Override
@@ -211,14 +200,12 @@ public class S3PerRecordOutputPlugin
211
200
  {
212
201
  if (pageReader != null) {
213
202
  pageReader.close();
203
+ pageReader = null;
214
204
  }
215
205
  }
216
206
 
217
207
  @Override
218
208
  public void abort() {
219
- for (Upload upload : uploads) {
220
- upload.abort();
221
- }
222
209
  }
223
210
 
224
211
  @Override
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-s3_per_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - tomykaira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-21 00:00:00.000000000 Z
11
+ date: 2016-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -63,8 +63,8 @@ files:
63
63
  - classpath/commons-logging-1.1.3.jar
64
64
  - classpath/commons-codec-1.6.jar
65
65
  - classpath/aws-java-sdk-s3-1.10.71.jar
66
+ - classpath/embulk-output-s3_per_record-0.1.2.jar
66
67
  - classpath/aws-java-sdk-core-1.10.71.jar
67
- - classpath/embulk-output-s3_per_record-0.1.1.jar
68
68
  - classpath/httpcore-4.3.3.jar
69
69
  - classpath/aws-java-sdk-kms-1.10.71.jar
70
70
  homepage: https://github.com/tomykaira/embulk-output-s3_per_record