fluent-plugin-bin 0.1 → 0.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/fluent-plugin-bin.gemspec +2 -2
- data/lib/fluent/plugin/in_bin.rb +12 -9
- metadata +9 -9
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: ebd76b9496c7a4b04740de272ebc348cd71011f0
         | 
| 4 | 
            +
              data.tar.gz: fbfa773cf99e560df185f5d2fda4b1e45b762eba
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: a4a303085122c573c707b97f4a688d602d7e888658f97f01c82f3d18b858955c9cc142273de624c886ba7b2e95d4f9d5407f8a0d6a4aead592ecf9a253ac59e4
         | 
| 7 | 
            +
              data.tar.gz: 0918b80c360a334beaa1d0db9482dfadad696e88b7a83d2f0161b35978dd4bd3f94cd53ea2ae6940e4c523bf71a22778eea06d988c11d106b748b4276b5f1e19
         | 
    
        data/fluent-plugin-bin.gemspec
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            Gem::Specification.new do |gem|
         | 
| 2 2 | 
             
                gem.name            = "fluent-plugin-bin"
         | 
| 3 | 
            -
                gem.version         = "0. | 
| 3 | 
            +
                gem.version         = "0.2"
         | 
| 4 4 | 
             
                gem.authors         = ["Klaus Wölfel"]
         | 
| 5 5 | 
             
                gem.email           = ["klaus@nexedi.com"]
         | 
| 6 6 | 
             
                gem.summary         = %q{Fluentd input plugin for binary files}
         | 
| @@ -11,5 +11,5 @@ Gem::Specification.new do |gem| | |
| 11 11 | 
             
                gem.files           = `git ls-files -z`.split("\x0")
         | 
| 12 12 | 
             
                gem.require_paths   = ["lib"]
         | 
| 13 13 |  | 
| 14 | 
            -
                gem.add_runtime_dependency "fluentd", "~> 0. | 
| 14 | 
            +
                gem.add_runtime_dependency "fluentd", "~> 0.14"
         | 
| 15 15 | 
             
            end
         | 
    
        data/lib/fluent/plugin/in_bin.rb
    CHANGED
    
    | @@ -15,12 +15,12 @@ | |
| 15 15 | 
             
            #   See the License for the specific language governing permissions and
         | 
| 16 16 | 
             
            #   limitations under the License.
         | 
| 17 17 |  | 
| 18 | 
            -
            require 'fluent/ | 
| 18 | 
            +
            require 'fluent/plugin/in_tail'
         | 
| 19 19 |  | 
| 20 | 
            -
            module Fluent
         | 
| 20 | 
            +
            module Fluent::Plugin
         | 
| 21 21 |  | 
| 22 | 
            -
              class BinInput <  | 
| 23 | 
            -
                Plugin.register_input('bin', self)
         | 
| 22 | 
            +
              class BinInput < TailInput
         | 
| 23 | 
            +
                Fluent::Plugin.register_input('bin', self)
         | 
| 24 24 |  | 
| 25 25 | 
             
                def convert_line_to_event(line, es, tail_watcher)
         | 
| 26 26 | 
             
                  begin
         | 
| @@ -34,11 +34,14 @@ module Fluent | |
| 34 34 | 
             
                def setup_watcher(path, pe)
         | 
| 35 35 | 
             
                  line_buffer_timer_flusher = (@multiline_mode && @multiline_flush_interval) ? TailWatcher::LineBufferTimerFlusher.new(log, @multiline_flush_interval, &method(:flush_buffer)) : nil
         | 
| 36 36 | 
             
                  tw = TailWatcher.new(path, @rotate_wait, pe, log, @read_from_head, @enable_watch_timer, @read_lines_limit, method(:update_watcher), line_buffer_timer_flusher,  &method(:receive_lines))
         | 
| 37 | 
            -
                  tw.attach | 
| 37 | 
            +
                  tw.attach do |watcher|
         | 
| 38 | 
            +
                     timer_execute(:in_tail_timer_trigger, 1, &watcher.method(:on_notify)) if watcher.enable_watch_timer
         | 
| 39 | 
            +
                     event_loop_attach(watcher.stat_trigger)
         | 
| 40 | 
            +
                  end
         | 
| 38 41 | 
             
                  tw
         | 
| 39 42 | 
             
                end
         | 
| 40 43 |  | 
| 41 | 
            -
                class TailWatcher <  | 
| 44 | 
            +
                class TailWatcher < TailInput::TailWatcher
         | 
| 42 45 | 
             
                  def on_rotate(io)
         | 
| 43 46 | 
             
                    if @io_handler == nil
         | 
| 44 47 | 
             
                      if io
         | 
| @@ -104,7 +107,7 @@ module Fluent | |
| 104 107 |  | 
| 105 108 | 
             
                    def swap_state(pe)
         | 
| 106 109 | 
             
                      # Use MemoryPositionEntry for rotated file temporary
         | 
| 107 | 
            -
                      mpe = MemoryPositionEntry.new
         | 
| 110 | 
            +
                      mpe = TailInput::MemoryPositionEntry.new
         | 
| 108 111 | 
             
                      mpe.update(pe.read_inode, pe.read_pos)
         | 
| 109 112 | 
             
                      @pe = mpe
         | 
| 110 113 | 
             
                      @io_handler.pe = mpe # Don't re-create IOHandler because IOHandler has an internal buffer.
         | 
| @@ -113,7 +116,7 @@ module Fluent | |
| 113 116 | 
             
                    end
         | 
| 114 117 | 
             
                  end
         | 
| 115 118 |  | 
| 116 | 
            -
                  class IOHandler  <  | 
| 119 | 
            +
                  class IOHandler  < TailInput::TailWatcher::IOHandler
         | 
| 117 120 | 
             
                    def initialize(io, pe, log, read_lines_limit, first = true, &receive_lines)
         | 
| 118 121 | 
             
                      @log = log
         | 
| 119 122 | 
             
                      @log.info "following #{io.path}" if first
         | 
| @@ -161,4 +164,4 @@ module Fluent | |
| 161 164 | 
             
                  end
         | 
| 162 165 | 
             
                end
         | 
| 163 166 | 
             
              end
         | 
| 164 | 
            -
            end
         | 
| 167 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,29 +1,29 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: fluent-plugin-bin
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: '0. | 
| 4 | 
            +
              version: '0.2'
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Klaus Wölfel
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016- | 
| 11 | 
            +
            date: 2016-09-23 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: fluentd
         | 
| 15 15 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 16 | 
             
                requirements:
         | 
| 17 | 
            -
                - - ~>
         | 
| 17 | 
            +
                - - "~>"
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: '0. | 
| 19 | 
            +
                    version: '0.14'
         | 
| 20 20 | 
             
              type: :runtime
         | 
| 21 21 | 
             
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 | 
            -
                - - ~>
         | 
| 24 | 
            +
                - - "~>"
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version: '0. | 
| 26 | 
            +
                    version: '0.14'
         | 
| 27 27 | 
             
            description: Fluentd input plugin to read binary files based on in_tail
         | 
| 28 28 | 
             
            email:
         | 
| 29 29 | 
             
            - klaus@nexedi.com
         | 
| @@ -46,17 +46,17 @@ require_paths: | |
| 46 46 | 
             
            - lib
         | 
| 47 47 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 48 48 | 
             
              requirements:
         | 
| 49 | 
            -
              - -  | 
| 49 | 
            +
              - - ">="
         | 
| 50 50 | 
             
                - !ruby/object:Gem::Version
         | 
| 51 51 | 
             
                  version: '0'
         | 
| 52 52 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 53 53 | 
             
              requirements:
         | 
| 54 | 
            -
              - -  | 
| 54 | 
            +
              - - ">="
         | 
| 55 55 | 
             
                - !ruby/object:Gem::Version
         | 
| 56 56 | 
             
                  version: '0'
         | 
| 57 57 | 
             
            requirements: []
         | 
| 58 58 | 
             
            rubyforge_project: 
         | 
| 59 | 
            -
            rubygems_version: 2. | 
| 59 | 
            +
            rubygems_version: 2.5.1
         | 
| 60 60 | 
             
            signing_key: 
         | 
| 61 61 | 
             
            specification_version: 4
         | 
| 62 62 | 
             
            summary: Fluentd input plugin for binary files
         |