kazoo-ruby 0.5.4 → 0.5.5
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/lib/kazoo/partition.rb +7 -1
- data/lib/kazoo/version.rb +1 -1
- data/test/partition_test.rb +11 -0
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: e685442d28a803004bd355327f84617aba976334
         | 
| 4 | 
            +
              data.tar.gz: 86297a6b19d5a538249577a5987594a3d6df12fc
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 931166fb34160a6d209a81465767852b210c6142d1f20c20608b0b80d0c403f0d029dfcf6e3e81332f01095ec451955fcd098e33679cadec3bd4130ce03f8e0e
         | 
| 7 | 
            +
              data.tar.gz: 0be07ec392fdb01c6a7b76003fb11df948f7dcb8a792b5c80d8d0f0ed66e608ecdf5cc952878b759ecf8854bc140a6e1740f0c6df54d863df2feaea934f8394c
         | 
    
        data/lib/kazoo/partition.rb
    CHANGED
    
    | @@ -99,7 +99,13 @@ module Kazoo | |
| 99 99 | 
             
                  raise Kazoo::VersionNotSupported unless json.fetch('version') == 1
         | 
| 100 100 |  | 
| 101 101 | 
             
                  @leader = cluster.brokers.fetch(json.fetch('leader'))
         | 
| 102 | 
            -
                  @isr = json.fetch('isr').map  | 
| 102 | 
            +
                  @isr = json.fetch('isr').map do |r|
         | 
| 103 | 
            +
                    begin
         | 
| 104 | 
            +
                      cluster.brokers.fetch(r)
         | 
| 105 | 
            +
                    rescue KeyError
         | 
| 106 | 
            +
                      raise Kazoo::Error, "Broker #{r} not in cluster but in ISR list #{json.fetch('isr').inspect}?!"
         | 
| 107 | 
            +
                    end
         | 
| 108 | 
            +
                  end
         | 
| 103 109 | 
             
                end
         | 
| 104 110 | 
             
              end
         | 
| 105 111 | 
             
            end
         | 
    
        data/lib/kazoo/version.rb
    CHANGED
    
    
    
        data/test/partition_test.rb
    CHANGED
    
    | @@ -44,4 +44,15 @@ class PartitionTest < Minitest::Test | |
| 44 44 | 
             
                refute partition.valid?
         | 
| 45 45 | 
             
                assert_raises(Kazoo::ValidationError) { partition.validate }
         | 
| 46 46 | 
             
              end
         | 
| 47 | 
            +
             | 
| 48 | 
            +
              def test_raises_unknown_broker
         | 
| 49 | 
            +
                partition = @cluster.topics['test.1'].partitions[0]
         | 
| 50 | 
            +
                partition.unstub(:leader)
         | 
| 51 | 
            +
                partition.unstub(:isr)
         | 
| 52 | 
            +
             | 
| 53 | 
            +
                json_payload = '{"controller_epoch":157,"leader":1,"version":1,"leader_epoch":8,"isr":[4,2,1]}'
         | 
| 54 | 
            +
                @cluster.zk.expects(:get).with(path: "/brokers/topics/test.1/partitions/0/state").returns(data: json_payload, rc: 0)
         | 
| 55 | 
            +
             | 
| 56 | 
            +
                assert_raises(Kazoo::Error) { partition.under_replicated? }
         | 
| 57 | 
            +
              end
         | 
| 47 58 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: kazoo-ruby
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.5. | 
| 4 | 
            +
              version: 0.5.5
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Willem van Bergen
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2017-02-03 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: thor
         | 
| @@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 156 156 | 
             
                  version: '0'
         | 
| 157 157 | 
             
            requirements: []
         | 
| 158 158 | 
             
            rubyforge_project: 
         | 
| 159 | 
            -
            rubygems_version: 2.5. | 
| 159 | 
            +
            rubygems_version: 2.5.2
         | 
| 160 160 | 
             
            signing_key: 
         | 
| 161 161 | 
             
            specification_version: 4
         | 
| 162 162 | 
             
            summary: Library to access and manipulate Kafka metadata in Zookeeper
         |