fluent-plugin-bigquery-custom 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fluent/plugin/bigquery/version.rb +1 -1
- data/lib/fluent/plugin/out_bigquery.rb +10 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fa069b1f44e40c71a9eaaeec2120e239a0dec38
|
4
|
+
data.tar.gz: c439e475ec1bd49f3f8b73b5e3d029b99ae521eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9ff3c9c78663f7b323b90ccb0243690d7c8385bca74fc9c360cedbae1c1687fea2f6adecf14077d8ddf2c01e625dbbe61b621682c6811f1871adbe280872ed6
|
7
|
+
data.tar.gz: 6494234184b5788b9888a4f99ca9d141aae7dac0a0d6bc10e71b9748f58f92f06ab0ee3d9665fced614f0dca10aa9db6a0c54846ad8910f507aa23191e78361f
|
@@ -19,6 +19,8 @@ module Fluent
|
|
19
19
|
# https://developers.google.com/bigquery/browser-tool-quickstart
|
20
20
|
# https://developers.google.com/bigquery/bigquery-api-quickstart
|
21
21
|
|
22
|
+
RETRYABLE_ERROR_REASON = %w(backendError internalError rateLimitExceeded tableUnavailable).freeze
|
23
|
+
|
22
24
|
### default for insert
|
23
25
|
def configure_for_insert(conf)
|
24
26
|
raise ConfigError unless conf["method"] != "load"
|
@@ -463,7 +465,7 @@ module Fluent
|
|
463
465
|
end
|
464
466
|
end
|
465
467
|
|
466
|
-
raise "failed to insert into bigquery, retry" if reasons.find { |r| r
|
468
|
+
raise "failed to insert into bigquery, retry" if reasons.find { |r| RETRYABLE_ERROR_REASON.include?(r) }
|
467
469
|
return if reasons.all? { |r| r == "invalid" } && @skip_invalid_rows
|
468
470
|
flush_secondary(@secondary) if @secondary
|
469
471
|
end
|
@@ -480,10 +482,9 @@ module Fluent
|
|
480
482
|
reason = e.respond_to?(:reason) ? e.reason : nil
|
481
483
|
log.error "tabledata.insertAll API", project_id: @project, dataset: @dataset, table: table_id, code: e.status_code, message: e.message, reason: reason
|
482
484
|
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
if @secondary
|
485
|
+
if RETRYABLE_ERROR_REASON.include?(reason) || e.is_a?(Google::Apis::ServerError)
|
486
|
+
raise "failed to insert into bigquery, retry" # TODO: error class
|
487
|
+
elsif @secondary
|
487
488
|
flush_secondary(@secondary)
|
488
489
|
end
|
489
490
|
end
|
@@ -536,11 +537,11 @@ module Fluent
|
|
536
537
|
reason = e.respond_to?(:reason) ? e.reason : nil
|
537
538
|
log.error "job.insert API", project_id: @project, dataset: @dataset, table: table_id, code: e.status_code, message: e.message, reason: reason
|
538
539
|
|
539
|
-
raise "failed to insert into bigquery, retry" if reason == "backendError" # backendError is retryable. TODO: error class
|
540
540
|
return wait_load(job_id) if e.status_code == 409 && e.message =~ /Job/ # duplicate load job
|
541
541
|
|
542
|
-
|
543
|
-
|
542
|
+
if RETRYABLE_ERROR_REASON.include?(reason) || e.is_a?(Google::Apis::ServerError)
|
543
|
+
raise "failed to insert into bigquery, retry" # TODO: error class
|
544
|
+
elsif @secondary
|
544
545
|
flush_secondary(@secondary)
|
545
546
|
end
|
546
547
|
end
|
@@ -607,7 +608,7 @@ module Fluent
|
|
607
608
|
error_result = _response.status.error_result
|
608
609
|
if error_result
|
609
610
|
log.error "job.insert API (result)", project_id: @project, dataset: @dataset, table: table_id, message: error_result.message, reason: error_result.reason
|
610
|
-
if
|
611
|
+
if RETRYABLE_ERROR_REASON.include?(error_result.reason)
|
611
612
|
raise "failed to load into bigquery"
|
612
613
|
elsif @secondary
|
613
614
|
flush_secondary(@secondary)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-bigquery-custom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomohiro Hashidate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|