embulk-output-s3 1.3.0 → 1.4.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 +4 -4
- data/README.md +3 -0
- data/build.gradle +1 -1
- data/src/main/java/org/embulk/output/S3FileOutputPlugin.java +32 -3
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00334de8a039abe0bdb057ddad0b98961fd4ad58
|
4
|
+
data.tar.gz: 6077938b5cb562c6c006986623cbd0b4428fe11f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b230018fc21488af215c1d819659e75e09c934e2f34a078dea81c3daf5fba46a1620fa2124550a317ca3e083fd43b52c8acdaf411f463753f0dec94dd9dac7db
|
7
|
+
data.tar.gz: 1f3ee354c87960fd5f79b757add1c6424250c0a338529a76c4397b8d2d5f2e11ba0c60190253a1380448eb0c5d68114b815f17b62a930b365d775408b713eccd
|
data/README.md
CHANGED
@@ -22,8 +22,11 @@
|
|
22
22
|
- **endpoint**: S3 endpoint login user name (string, optional)
|
23
23
|
- **access_key_id**: AWS access key id. This parameter is required when your agent is not running on EC2 instance with an IAM Role. (string, defualt: null)
|
24
24
|
- **secret_access_key**: AWS secret key. This parameter is required when your agent is not running on EC2 instance with an IAM Role. (string, defualt: null)
|
25
|
+
- **tmp_path**: temporary file directory. If null, it is associated with the default FileSystem. (string, default: null)
|
25
26
|
- **tmp_path_prefix**: prefix of temporary files (string, default: 'embulk-output-s3-')
|
26
27
|
- **canned_acl**: canned access control list for created objects ([enum](#cannedaccesscontrollist), default: null)
|
28
|
+
- **proxy_host**: proxy host to use when accessing AWS S3 via proxy. (string, default: null )
|
29
|
+
- **proxy_port**: proxy port to use when accessing AWS S3 via proxy. (string, default: null )
|
27
30
|
|
28
31
|
### CannedAccessControlList
|
29
32
|
you can choose one of the below list.
|
data/build.gradle
CHANGED
@@ -4,6 +4,7 @@ import java.io.IOException;
|
|
4
4
|
import java.io.OutputStream;
|
5
5
|
import java.nio.file.Files;
|
6
6
|
import java.nio.file.Path;
|
7
|
+
import java.nio.file.Paths;
|
7
8
|
import java.util.IllegalFormatException;
|
8
9
|
import java.util.List;
|
9
10
|
import java.util.Locale;
|
@@ -61,6 +62,18 @@ public class S3FileOutputPlugin
|
|
61
62
|
@ConfigDefault("null")
|
62
63
|
Optional<String> getSecretAccessKey();
|
63
64
|
|
65
|
+
@Config("proxy_host")
|
66
|
+
@ConfigDefault("null")
|
67
|
+
Optional<String> getProxyHost();
|
68
|
+
|
69
|
+
@Config("proxy_port")
|
70
|
+
@ConfigDefault("null")
|
71
|
+
Optional<Integer> getProxyPort();
|
72
|
+
|
73
|
+
@Config("tmp_path")
|
74
|
+
@ConfigDefault("null")
|
75
|
+
Optional<String> getTempPath();
|
76
|
+
|
64
77
|
@Config("tmp_path_prefix")
|
65
78
|
@ConfigDefault("\"embulk-output-s3-\"")
|
66
79
|
String getTempPathPrefix();
|
@@ -88,6 +101,7 @@ public class S3FileOutputPlugin
|
|
88
101
|
private AmazonS3Client client;
|
89
102
|
private OutputStream current;
|
90
103
|
private Path tempFilePath;
|
104
|
+
private String tempPath = null;
|
91
105
|
|
92
106
|
private static AmazonS3Client newS3Client(PluginTask task)
|
93
107
|
{
|
@@ -96,6 +110,14 @@ public class S3FileOutputPlugin
|
|
96
110
|
// TODO: Support more configurations.
|
97
111
|
ClientConfiguration config = new ClientConfiguration();
|
98
112
|
|
113
|
+
if (task.getProxyHost().isPresent()) {
|
114
|
+
config.setProxyHost(task.getProxyHost().get());
|
115
|
+
}
|
116
|
+
|
117
|
+
if (task.getProxyPort().isPresent()) {
|
118
|
+
config.setProxyPort(task.getProxyPort().get());
|
119
|
+
}
|
120
|
+
|
99
121
|
if (task.getAccessKeyId().isPresent()) {
|
100
122
|
BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(
|
101
123
|
task.getAccessKeyId().get(), task.getSecretAccessKey().get());
|
@@ -123,13 +145,20 @@ public class S3FileOutputPlugin
|
|
123
145
|
this.sequenceFormat = task.getSequenceFormat();
|
124
146
|
this.fileNameExtension = task.getFileNameExtension();
|
125
147
|
this.tempPathPrefix = task.getTempPathPrefix();
|
148
|
+
if (task.getTempPath().isPresent()) {
|
149
|
+
this.tempPath = task.getTempPath().get();
|
150
|
+
}
|
126
151
|
this.cannedAccessControlListOptional = task.getCannedAccessControlList();
|
127
152
|
}
|
128
153
|
|
129
|
-
private static Path newTempFile(String prefix)
|
154
|
+
private static Path newTempFile(String tmpDir, String prefix)
|
130
155
|
throws IOException
|
131
156
|
{
|
132
|
-
|
157
|
+
if (tmpDir == null) {
|
158
|
+
return Files.createTempFile(prefix, null);
|
159
|
+
} else {
|
160
|
+
return Files.createTempFile(Paths.get(tmpDir), prefix, null);
|
161
|
+
}
|
133
162
|
}
|
134
163
|
|
135
164
|
private void deleteTempFile()
|
@@ -193,7 +222,7 @@ public class S3FileOutputPlugin
|
|
193
222
|
closeCurrent();
|
194
223
|
|
195
224
|
try {
|
196
|
-
tempFilePath = newTempFile(tempPathPrefix);
|
225
|
+
tempFilePath = newTempFile(tempPath, tempPathPrefix);
|
197
226
|
|
198
227
|
log.info("Writing S3 file '{}'", buildCurrentKey());
|
199
228
|
|
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.
|
4
|
+
version: 1.4.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: 2016-
|
11
|
+
date: 2016-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,14 +59,14 @@ files:
|
|
59
59
|
- settings.gradle
|
60
60
|
- src/main/java/org/embulk/output/S3FileOutputPlugin.java
|
61
61
|
- src/test/java/org/embulk/output/TestS3FileOutputPlugin.java
|
62
|
-
- classpath/
|
63
|
-
- classpath/aws-java-sdk-s3-1.10.26.jar
|
62
|
+
- classpath/aws-java-sdk-core-1.10.26.jar
|
64
63
|
- classpath/aws-java-sdk-kms-1.10.26.jar
|
64
|
+
- classpath/aws-java-sdk-s3-1.10.26.jar
|
65
65
|
- classpath/commons-codec-1.6.jar
|
66
|
-
- classpath/httpcore-4.3.3.jar
|
67
|
-
- classpath/httpclient-4.3.6.jar
|
68
|
-
- classpath/aws-java-sdk-core-1.10.26.jar
|
69
66
|
- classpath/commons-logging-1.1.3.jar
|
67
|
+
- classpath/embulk-output-s3-1.4.0.jar
|
68
|
+
- classpath/httpclient-4.3.6.jar
|
69
|
+
- classpath/httpcore-4.3.3.jar
|
70
70
|
homepage: https://github.com/llibra/embulk-output-s3
|
71
71
|
licenses:
|
72
72
|
- MIT
|