embulk-output-s3 1.0.0 → 1.1.0

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: d032d430e3aafe62fb980b9bd11016486656cf4c
4
- data.tar.gz: 833295c8e4f14f5dd51396413a2a14a2990a6d0d
3
+ metadata.gz: 4d30bd3aaf8225192a198c2272068b535ff03ae2
4
+ data.tar.gz: 67c729c619c8d5eb5366f6268719d9e559736be6
5
5
  SHA512:
6
- metadata.gz: bb2b7688fcb2424313ebd552d86c4a60081240994d6b1efe5f5d791946e2e385fa71a8df8a52a02ea59bac4d22d70fb385697941839b9fd2cfae3d2607cade43
7
- data.tar.gz: fcab1a115ca785ac9af2b17c35c227a280f8d71ee5ab98139428f9712b69bee3b0560a7b77dba0198233d72768d1fb1417e4b76c0346a699352d6682d582d7ff
6
+ metadata.gz: f8c94a94091c02e2f38c649372b72fb3a37e7f0cb514addc201fe3efe76763757c633b5b9367b4448dde3ecc4f167336dea0458f2d08bb03cf0842e95dc2bb84
7
+ data.tar.gz: df4d41d74fdd8c0c3bd8fbbb428471f0f99d61fdcaf6f645c6dee633f3359c3c75a7eaf79bdc2361404b5dde6029ffa3c23bd04a5a3533da871539fb8251ac7b
data/build.gradle CHANGED
@@ -12,7 +12,7 @@ configurations {
12
12
  provided
13
13
  }
14
14
 
15
- version = "1.0.0"
15
+ version = "1.1.0"
16
16
 
17
17
  sourceCompatibility = 1.7
18
18
  targetCompatibility = 1.7
@@ -46,7 +46,8 @@ public class S3FileOutputPlugin implements FileOutputPlugin {
46
46
  public String getBucket();
47
47
 
48
48
  @Config("endpoint")
49
- public String getEndpoint();
49
+ @ConfigDefault("null")
50
+ public Optional<String> getEndpoint();
50
51
 
51
52
  @Config("access_key_id")
52
53
  @ConfigDefault("null")
@@ -79,26 +80,24 @@ public class S3FileOutputPlugin implements FileOutputPlugin {
79
80
 
80
81
  private static AmazonS3Client newS3Client(PluginTask task) {
81
82
  AmazonS3Client client = null;
82
- try {
83
- if (task.getAccessKeyId().isPresent()) {
84
- BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(
85
- task.getAccessKeyId().get(), task.getSecretAccessKey().get());
86
-
87
- ClientConfiguration config = new ClientConfiguration();
88
- // TODO: Support more configurations.
89
-
90
- client = new AmazonS3Client(basicAWSCredentials, config);
91
- } else {
92
- if (System.getenv("AWS_ACCESS_KEY_ID") == null) {
93
- client = new AmazonS3Client(new EnvironmentVariableCredentialsProvider());
94
- } else { // IAM ROLE
95
- client = new AmazonS3Client();
96
- }
83
+
84
+ if (task.getAccessKeyId().isPresent()) {
85
+ BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(
86
+ task.getAccessKeyId().get(), task.getSecretAccessKey().get());
87
+
88
+ ClientConfiguration config = new ClientConfiguration();
89
+ // TODO: Support more configurations.
90
+
91
+ client = new AmazonS3Client(basicAWSCredentials, config);
92
+ } else {
93
+ if (System.getenv("AWS_ACCESS_KEY_ID") == null) {
94
+ client = new AmazonS3Client(new EnvironmentVariableCredentialsProvider());
95
+ } else { // IAM ROLE
96
+ client = new AmazonS3Client();
97
97
  }
98
- client.setEndpoint(task.getEndpoint());
99
- client.isRequesterPaysEnabled(task.getBucket()); // check s3 access.
100
- } catch (Exception e) {
101
- throw new RuntimeException("can't call S3 API. Please check your access_key_id / secret_access_key or s3_region configuration.", e);
98
+ }
99
+ if (task.getEndpoint().isPresent()) {
100
+ client.setEndpoint(task.getEndpoint().get());
102
101
  }
103
102
 
104
103
  return client;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Takayama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-15 00:00:00.000000000 Z
11
+ date: 2015-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -61,7 +61,7 @@ files:
61
61
  - classpath/aws-java-sdk-s3-1.10.26.jar
62
62
  - classpath/commons-codec-1.6.jar
63
63
  - classpath/commons-logging-1.1.3.jar
64
- - classpath/embulk-output-s3-1.0.0.jar
64
+ - classpath/embulk-output-s3-1.1.0.jar
65
65
  - classpath/httpclient-4.3.6.jar
66
66
  - classpath/httpcore-4.3.3.jar
67
67
  homepage: https://github.com/llibra/embulk-output-s3