fluent-plugin-kinesis 3.4.1 → 3.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90a9718baa3e6849ce6ad7be32104672dcdf8993940c71d2d9fb666ce64b35e2
4
- data.tar.gz: 064de8d0bbe66a8b8a8f4102bb686487fc0d7294904399dd745ce641b593c9bf
3
+ metadata.gz: 2a80a4e62aad6b32241c8db4ce69903db51da13b06391d9762737ef9b39a3987
4
+ data.tar.gz: 6dd4150b29f65e50980dd8977227de8675a6125b3d3977fe20089650f76bae90
5
5
  SHA512:
6
- metadata.gz: 248f0fd2de87171ea58d878de9450edf95eb1dee58e31bfaf1aa716080e3921f68aa8ebdac2cbf052759a7e4262d5e598c5380c0c75edef503c54c8e760f1d3e
7
- data.tar.gz: 79128aa4b4d07372ecc8d53d2f7196fa442d2c7c1694e215daca6cac7aae4d097af3b0512ddeae74708c053d6fb92fdce3c87811f4c0a2f5060b2c76649597e4
6
+ metadata.gz: 26ef149f10a4e953573bacdc3bf19185edeff7d13fc72058bc02d93d453d9573455eb9a9f5d75e0016ece72b1f0440f2431a0351ce9d988784de6a273efc3a9c
7
+ data.tar.gz: 1e591b860e4f1d4d2152d1b1327488da16d0efc2273d5ceff214180fb58f38bfc78d25859166b0ab67e4f883e140a2d5242a5a3dd95161cc8f2084f58cc9e7ac
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.4.2
4
+ - Feature - Add option to support gzip compression : [#215](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/215)
5
+
3
6
  ## 3.4.1
4
7
 
5
8
  - Enhancement - Add stream name to debug logs to identify : [#214](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/214)
data/README.md CHANGED
@@ -353,7 +353,7 @@ Also, there are some format related options below:
353
353
  If your record contains a field whose string should be sent to Amazon Kinesis directly (without formatter), use this parameter to specify the field. In that case, other fields than **data_key** are thrown away and never sent to Amazon Kinesis. Default `nil`, which means whole record will be formatted and sent.
354
354
 
355
355
  ### compression
356
- Specifing compression way for data of each record. Current accepted options are `zlib`. Otherwise, no compression will be preformed.
356
+ Specifying compression way for data of each record. Current accepted options are `zlib` and `gzip`. Otherwise, no compression will be preformed.
357
357
 
358
358
  ### log_truncate_max_size
359
359
  Integer, default 1024. When emitting the log entry, the message will be truncated by this size to avoid infinite loop when the log is also sent to Kinesis. The value 0 means no truncation.
@@ -17,6 +17,7 @@ require 'fluent/msgpack_factory'
17
17
  require 'fluent/plugin/output'
18
18
  require 'fluent/plugin/kinesis_helper/client'
19
19
  require 'fluent/plugin/kinesis_helper/api'
20
+ require 'fluent/plugin/kinesis_helper/compression'
20
21
  require 'zlib'
21
22
 
22
23
  module Fluent
@@ -121,6 +122,8 @@ module Fluent
121
122
  case @compression
122
123
  when "zlib"
123
124
  ->(data) { Zlib::Deflate.deflate(data) }
125
+ when "gzip"
126
+ ->(data) { Gzip.compress(data) }
124
127
  else
125
128
  ->(data) { data }
126
129
  end
@@ -0,0 +1,27 @@
1
+ require "stringio"
2
+ require "zlib"
3
+
4
+ class Stream < StringIO
5
+ def initialize(*)
6
+ super
7
+ set_encoding "BINARY"
8
+ end
9
+
10
+ def close
11
+ rewind;
12
+ end
13
+ end
14
+
15
+ class Gzip
16
+ def self.compress(string, level = Zlib::DEFAULT_COMPRESSION, strategy = Zlib::DEFAULT_STRATEGY)
17
+ output = Stream.new
18
+ gz = Zlib::GzipWriter.new(output, level, strategy)
19
+ gz.write(string)
20
+ gz.close
21
+ output.string
22
+ end
23
+
24
+ def self.decompress(string)
25
+ Zlib::GzipReader.wrap(StringIO.new(string), &:read)
26
+ end
27
+ end
@@ -13,5 +13,5 @@
13
13
  # language governing permissions and limitations under the License.
14
14
 
15
15
  module FluentPluginKinesis
16
- VERSION = '3.4.1'
16
+ VERSION = '3.4.2'
17
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-kinesis
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.1
4
+ version: 3.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-09 00:00:00.000000000 Z
11
+ date: 2021-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -308,6 +308,7 @@ files:
308
308
  - lib/fluent/plugin/kinesis_helper/aggregator.rb
309
309
  - lib/fluent/plugin/kinesis_helper/api.rb
310
310
  - lib/fluent/plugin/kinesis_helper/client.rb
311
+ - lib/fluent/plugin/kinesis_helper/compression.rb
311
312
  - lib/fluent/plugin/out_kinesis_firehose.rb
312
313
  - lib/fluent/plugin/out_kinesis_streams.rb
313
314
  - lib/fluent/plugin/out_kinesis_streams_aggregated.rb