embulk-input-gcs 0.2.7 → 0.2.8
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/.travis.yml +0 -7
- data/CHANGELOG.md +3 -0
- data/build.gradle +3 -3
- data/src/main/java/org/embulk/input/gcs/GcsAuthentication.java +22 -14
- data/src/main/java/org/embulk/input/gcs/GcsFileInputPlugin.java +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a5659bab7542e13aad7999cf6f389a65583b4e98
|
|
4
|
+
data.tar.gz: dd924ef90a423c1144d41a3807529ca06573aef5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9bd79f9ee60895f4af84dcf72422f13659f074fbb97ddaf07a900daf7d184283eee91e3a51c2edc21774715eba0b83357fe1dc4e6993eaaf67f512ebd2efa45
|
|
7
|
+
data.tar.gz: a5bba84dab3456e94048f9e8416b881e6323a22fdd64af7a5cd8f78ffbd2c345be2b79d00834bf112396dfe2dbdeb7c58afcdc3a315f91b182711e082263182a
|
data/.travis.yml
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
dist: precise
|
|
2
1
|
language: java
|
|
3
2
|
|
|
4
3
|
jdk:
|
|
5
4
|
- oraclejdk8
|
|
6
|
-
- oraclejdk7
|
|
7
|
-
- openjdk7
|
|
8
5
|
|
|
9
6
|
before_install:
|
|
10
7
|
- openssl aes-256-cbc -K $encrypted_79f1af2a2546_key -iv $encrypted_79f1af2a2546_iv
|
|
@@ -22,7 +19,3 @@ env:
|
|
|
22
19
|
script:
|
|
23
20
|
- ./gradlew gem
|
|
24
21
|
- ./gradlew --info check jacocoTestReport
|
|
25
|
-
addons:
|
|
26
|
-
hosts:
|
|
27
|
-
- example.com
|
|
28
|
-
hostname: example.com
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
## 0.2.8 - 2018-06-29
|
|
2
|
+
* [maintenance] Improve retry logic to retry "400 Bad Request" "Invalid JWT: No valid verifier found for issuer" [#34](https://github.com/embulk/embulk-input-gcs/pull/34)
|
|
3
|
+
|
|
1
4
|
## 0.2.7 - 2018-03-22
|
|
2
5
|
* [maintenance] Fix retry logic to avoid IOException happens while IOUtils.copy() [#33](https://github.com/embulk/embulk-input-gcs/pull/33)
|
|
3
6
|
|
data/build.gradle
CHANGED
|
@@ -14,10 +14,10 @@ configurations {
|
|
|
14
14
|
provided
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
sourceCompatibility = 1.
|
|
18
|
-
targetCompatibility = 1.
|
|
17
|
+
sourceCompatibility = 1.8
|
|
18
|
+
targetCompatibility = 1.8
|
|
19
19
|
|
|
20
|
-
version = "0.2.
|
|
20
|
+
version = "0.2.8"
|
|
21
21
|
|
|
22
22
|
dependencies {
|
|
23
23
|
compile "org.embulk:embulk-core:0.8.2"
|
|
@@ -130,25 +130,33 @@ public class GcsAuthentication
|
|
|
130
130
|
@Override
|
|
131
131
|
public boolean isRetryableException(Exception exception)
|
|
132
132
|
{
|
|
133
|
-
if (exception instanceof GoogleJsonResponseException
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
String content = "";
|
|
138
|
-
if (((GoogleJsonResponseException) exception).getContent() != null) {
|
|
139
|
-
content = ((GoogleJsonResponseException) exception).getContent();
|
|
140
|
-
}
|
|
133
|
+
if (exception instanceof GoogleJsonResponseException) {
|
|
134
|
+
if (((GoogleJsonResponseException) exception).getDetails() == null) {
|
|
135
|
+
if (((GoogleJsonResponseException) exception).getContent() != null) {
|
|
136
|
+
String content = ((GoogleJsonResponseException) exception).getContent();
|
|
141
137
|
log.warn("Invalid response was returned : {}", content);
|
|
142
138
|
return true;
|
|
143
139
|
}
|
|
144
|
-
statusCode = ((GoogleJsonResponseException) exception).getDetails().getCode();
|
|
145
140
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
141
|
+
int statusCode = ((GoogleJsonResponseException) exception).getDetails().getCode();
|
|
142
|
+
return !(statusCode / 100 == 4);
|
|
143
|
+
}
|
|
144
|
+
else if (exception instanceof TokenResponseException) {
|
|
145
|
+
TokenResponseException ex = (TokenResponseException) exception;
|
|
146
|
+
if (ex.getDetails() != null && ex.getDetails().getErrorDescription() != null) {
|
|
147
|
+
String errorDescription = ex.getDetails().getErrorDescription();
|
|
148
|
+
// Retry: 400 BadRequest "Invalid JWT..."
|
|
149
|
+
// Caused by: com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request
|
|
150
|
+
// {
|
|
151
|
+
// "error" : "invalid_grant",
|
|
152
|
+
// "error_description" : "Invalid JWT: No valid verifier found for issuer."
|
|
153
|
+
// }
|
|
154
|
+
if (errorDescription.contains("Invalid JWT")) {
|
|
155
|
+
log.warn("Invalid response was returned : {}", errorDescription);
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
151
158
|
}
|
|
159
|
+
return !(ex.getStatusCode() / 100 == 4);
|
|
152
160
|
}
|
|
153
161
|
return true;
|
|
154
162
|
}
|
|
@@ -71,7 +71,7 @@ public class GcsFileInputPlugin
|
|
|
71
71
|
throw new ConfigException("No file is found. Confirm paths option isn't empty");
|
|
72
72
|
}
|
|
73
73
|
FileList.Builder builder = new FileList.Builder(config);
|
|
74
|
-
for (String file: task.getPathFiles()) {
|
|
74
|
+
for (String file : task.getPathFiles()) {
|
|
75
75
|
builder.add(file, 1);
|
|
76
76
|
}
|
|
77
77
|
task.setFiles(builder.build());
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: embulk-input-gcs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Satoshi Akama
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-06-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -69,17 +69,17 @@ files:
|
|
|
69
69
|
- src/test/resources/sample_01.csv
|
|
70
70
|
- src/test/resources/sample_02.csv
|
|
71
71
|
- src/test/resources/secretkeys.tar.enc
|
|
72
|
-
- classpath/commons-codec-1.3.jar
|
|
73
|
-
- classpath/commons-logging-1.1.1.jar
|
|
74
|
-
- classpath/embulk-input-gcs-0.2.7.jar
|
|
75
72
|
- classpath/google-api-client-1.21.0.jar
|
|
73
|
+
- classpath/httpclient-4.0.1.jar
|
|
74
|
+
- classpath/jsr305-1.3.9.jar
|
|
75
|
+
- classpath/commons-logging-1.1.1.jar
|
|
76
76
|
- classpath/google-api-services-storage-v1-rev59-1.21.0.jar
|
|
77
77
|
- classpath/google-http-client-1.21.0.jar
|
|
78
|
-
- classpath/
|
|
78
|
+
- classpath/embulk-input-gcs-0.2.8.jar
|
|
79
79
|
- classpath/google-oauth-client-1.21.0.jar
|
|
80
|
-
- classpath/
|
|
80
|
+
- classpath/commons-codec-1.3.jar
|
|
81
|
+
- classpath/google-http-client-jackson2-1.21.0.jar
|
|
81
82
|
- classpath/httpcore-4.0.1.jar
|
|
82
|
-
- classpath/jsr305-1.3.9.jar
|
|
83
83
|
homepage: https://github.com/embulk/embulk-input-gcs
|
|
84
84
|
licenses:
|
|
85
85
|
- Apache-2.0
|