fluent-plugin-s3 0.5.1 → 0.5.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
  SHA1:
3
- metadata.gz: a6933d8af0483701ed94c8c0c720ecc85d3beafb
4
- data.tar.gz: 97c807cc7de26ccc845554628c9eed5929028241
3
+ metadata.gz: 94693d17ac1d8a9064b7ae64bac1496a74acf7de
4
+ data.tar.gz: 300d4d8cb66c403a8237afcda3def9de6761c74a
5
5
  SHA512:
6
- metadata.gz: 94dd5fc35ca2eee56e90952f42cf145b0d3a15e3a11da494ee49d851291a135e14163612200173b06b6d0b4c0502c910e065c1abf5b35a07d55050f5b395c9aa
7
- data.tar.gz: da466b470896ef625716609ea62ad193789b0370a2590a093b4bb12c2378018a8d1570ff55f1131b694312378b7f16d0ecd866245d4df3450161f729cee95318
6
+ metadata.gz: de718a336390d3121a194afc54f7e5597fb6c0f8d250bb5096af21e3d8165b3dc5f7a6dd467cc25fcdab6107939cfb131f464f654d0297466ff4d2ee3a6dca0e
7
+ data.tar.gz: 0379d7d50711f3f2ad4beec0774361f05f47da8b0aa0b7c364e69d0cd8475491d0764bd0f872cb7331c5edd2503926ff7d9f747959439c5544f36a42245e68c7
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ Release 0.5.2 - 2015/02/05
2
+
3
+ * Add experimental gzip_command compressor
4
+
5
+
1
6
  Release 0.5.1 - 2014/12/18
2
7
 
3
8
  * Skip apikey_check error when auto_create_bucket is true and bucket doesn't exist
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.5.2
@@ -50,6 +50,7 @@ module Fluent
50
50
  @compressor = TextCompressor.new
51
51
  end
52
52
  @compressor.configure(conf)
53
+ @compressor.buffer_type = @buffer_type
53
54
 
54
55
  # TODO: use Plugin.new_formatter instead of TextFormatter.create
55
56
  conf['format'] = @format
@@ -149,6 +150,8 @@ module Fluent
149
150
  super
150
151
  end
151
152
 
153
+ attr_accessor :buffer_type
154
+
152
155
  def ext
153
156
  end
154
157
 
@@ -0,0 +1,42 @@
1
+ module Fluent
2
+ class S3Output
3
+ class GzipCommandCompressor < Compressor
4
+ S3Output.register_compressor('gzip_command', self)
5
+
6
+ config_param :command_parameter, :string, :default => ''
7
+
8
+ def configure(conf)
9
+ super
10
+ check_command('gzip')
11
+ end
12
+
13
+ def ext
14
+ 'gz'.freeze
15
+ end
16
+
17
+ def content_type
18
+ 'application/x-gzip'.freeze
19
+ end
20
+
21
+ def compress(chunk, tmp)
22
+ chunk_is_file = @buffer_type == 'file'
23
+ path = if chunk_is_file
24
+ chunk.path
25
+ else
26
+ w = Tempfile.new("chunk-gzip-tmp")
27
+ chunk.write_to(w)
28
+ w.close
29
+ tmp.close
30
+ w.path
31
+ end
32
+ # We don't check the return code because we can't recover gzip failure.
33
+ system "gzip #{@command_parameter} -c #{path} > #{tmp.path}"
34
+ ensure
35
+ unless chunk_is_file
36
+ w.close rescue nil
37
+ w.unlink rescue nil
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-17 00:00:00.000000000 Z
12
+ date: 2015-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -116,6 +116,7 @@ files:
116
116
  - VERSION
117
117
  - fluent-plugin-s3.gemspec
118
118
  - lib/fluent/plugin/out_s3.rb
119
+ - lib/fluent/plugin/s3_compressor_gzip_command.rb
119
120
  - lib/fluent/plugin/s3_compressor_lzma2.rb
120
121
  - lib/fluent/plugin/s3_compressor_lzo.rb
121
122
  - test/test_out_s3.rb