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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c7a8f8dcd33afc9c58b25bc3604dae90a407fb4
4
- data.tar.gz: bd5afe31028d098c805e7096a6939e877bc2633e
3
+ metadata.gz: a5659bab7542e13aad7999cf6f389a65583b4e98
4
+ data.tar.gz: dd924ef90a423c1144d41a3807529ca06573aef5
5
5
  SHA512:
6
- metadata.gz: 9e761bc69cbb53342b4f7cc943bff476e8678a6dc4f22306039d2269fd91d4651c797d51d6891580af148d53d4cc54fb3a7a45710c9cada571dd59db88b12842
7
- data.tar.gz: 2e03a2ca66c9daae76190f70c5dda99c437cf783e77ff5dd6ed1fe15dbe6633e4644350f53d303eb7e0aa06af84540d4bd6d5f6ffb65299819e508a397b5f9d6
6
+ metadata.gz: e9bd79f9ee60895f4af84dcf72422f13659f074fbb97ddaf07a900daf7d184283eee91e3a51c2edc21774715eba0b83357fe1dc4e6993eaaf67f512ebd2efa45
7
+ data.tar.gz: a5bba84dab3456e94048f9e8416b881e6323a22fdd64af7a5cd8f78ffbd2c345be2b79d00834bf112396dfe2dbdeb7c58afcdc3a315f91b182711e082263182a
@@ -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
@@ -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
 
@@ -14,10 +14,10 @@ configurations {
14
14
  provided
15
15
  }
16
16
 
17
- sourceCompatibility = 1.7
18
- targetCompatibility = 1.7
17
+ sourceCompatibility = 1.8
18
+ targetCompatibility = 1.8
19
19
 
20
- version = "0.2.7"
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 || exception instanceof TokenResponseException) {
134
- int statusCode;
135
- if (exception instanceof GoogleJsonResponseException) {
136
- if (((GoogleJsonResponseException) exception).getDetails() == null) {
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
- else {
147
- statusCode = ((TokenResponseException) exception).getStatusCode();
148
- }
149
- if (statusCode / 100 == 4) {
150
- return false;
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.7
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-03-22 00:00:00.000000000 Z
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/google-http-client-jackson2-1.21.0.jar
78
+ - classpath/embulk-input-gcs-0.2.8.jar
79
79
  - classpath/google-oauth-client-1.21.0.jar
80
- - classpath/httpclient-4.0.1.jar
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