fluent-plugin-firehose 0.0.3 → 0.0.4
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/out_firehose.rb +6 -6
- data/lib/fluent/plugin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0da463c98bbb7c5d2bb4454164b31b83fce2642
|
4
|
+
data.tar.gz: 44684222f2f5449b89f9b7c7d44856e05da275c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e00dcb09b1c27b380b15abe13b66f76d1e5b4ebef17a403dbfad6c0f70517860e128de85dab913c8710b851048b437006e28c121a200a5570939030813ba8df6
|
7
|
+
data.tar.gz: 6a561ae5b3c67c74134bdbf42d2aa5181ffa920227e404e3622cb2331ae1a0de0fdb86fc5345de1c60c49f9077da6020b08383c76a70f72668f49e7b8008b03a
|
@@ -27,7 +27,7 @@ module FluentPluginFirehose
|
|
27
27
|
include Fluent::SetTimeKeyMixin
|
28
28
|
include Fluent::SetTagKeyMixin
|
29
29
|
|
30
|
-
USER_AGENT_NAME = 'fluent-plugin-
|
30
|
+
USER_AGENT_NAME = 'fluent-plugin-firehose-output'
|
31
31
|
PUT_RECORD_MAX_DATA_SIZE = 1000 * 1024 # 1000 KB
|
32
32
|
PUT_RECORD_BATCH_MAX_COUNT = 500
|
33
33
|
PUT_RECORD_BATCH_MAX_DATA_SIZE = 4 * 1024 * 1024 # 4 MB
|
@@ -116,7 +116,7 @@ module FluentPluginFirehose
|
|
116
116
|
else
|
117
117
|
records_array = build_records_array_to_put(data_list)
|
118
118
|
records_array.each{|records|
|
119
|
-
|
119
|
+
put_record_batch_with_retry(records)
|
120
120
|
}
|
121
121
|
end
|
122
122
|
end
|
@@ -146,7 +146,7 @@ module FluentPluginFirehose
|
|
146
146
|
credentials = Aws::AssumeRoleCredentials.new(
|
147
147
|
client: Aws::STS::Client.new(options),
|
148
148
|
role_arn: @role_arn,
|
149
|
-
role_session_name: "aws-fluent-plugin-
|
149
|
+
role_session_name: "aws-fluent-plugin-firehose",
|
150
150
|
external_id: @external_id,
|
151
151
|
duration_seconds: 60 * 60
|
152
152
|
)
|
@@ -216,8 +216,8 @@ module FluentPluginFirehose
|
|
216
216
|
records_array
|
217
217
|
end
|
218
218
|
|
219
|
-
def
|
220
|
-
response = @client.
|
219
|
+
def put_record_batch_with_retry(records,retry_count=0)
|
220
|
+
response = @client.put_record_batch(
|
221
221
|
records: records,
|
222
222
|
delivery_stream_name: @delivery_stream_name
|
223
223
|
)
|
@@ -234,7 +234,7 @@ module FluentPluginFirehose
|
|
234
234
|
sleep(calculate_sleep_duration(retry_count))
|
235
235
|
retry_count += 1
|
236
236
|
log.warn sprintf('Retrying to put records. Retry count: %d', retry_count)
|
237
|
-
|
237
|
+
put_record_batch_with_retry(
|
238
238
|
failed_records.map{|record| record[:body]},
|
239
239
|
retry_count
|
240
240
|
)
|