fluent-plugin-s3 0.5.1 → 0.5.2
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 +4 -4
- data/ChangeLog +5 -0
- data/VERSION +1 -1
- data/lib/fluent/plugin/out_s3.rb +3 -0
- data/lib/fluent/plugin/s3_compressor_gzip_command.rb +42 -0
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 94693d17ac1d8a9064b7ae64bac1496a74acf7de
         | 
| 4 | 
            +
              data.tar.gz: 300d4d8cb66c403a8237afcda3def9de6761c74a
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: de718a336390d3121a194afc54f7e5597fb6c0f8d250bb5096af21e3d8165b3dc5f7a6dd467cc25fcdab6107939cfb131f464f654d0297466ff4d2ee3a6dca0e
         | 
| 7 | 
            +
              data.tar.gz: 0379d7d50711f3f2ad4beec0774361f05f47da8b0aa0b7c364e69d0cd8475491d0764bd0f872cb7331c5edd2503926ff7d9f747959439c5544f36a42245e68c7
         | 
    
        data/ChangeLog
    CHANGED
    
    
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0.5. | 
| 1 | 
            +
            0.5.2
         | 
    
        data/lib/fluent/plugin/out_s3.rb
    CHANGED
    
    | @@ -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. | 
| 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:  | 
| 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
         |