codeclimate-poseidon 0.0.14 → 0.0.15

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: 89451780f4cbf5a82de300d746c4a438bf0bf677
4
- data.tar.gz: 873cd07cf3f43dcab11603bb6158a33e105dde7e
3
+ metadata.gz: 87b2ad36f5c17298853637118a0ce8b8febe91c2
4
+ data.tar.gz: 3696f519b680dc6542d4255800878fb85b4af2ab
5
5
  SHA512:
6
- metadata.gz: a81fa0935d726c4ab4562b2563cabeaa67712b6fa5e12ce327914a3fdd92fb7b4180ed44cbb1f56a574866e7ddb8561b9165a2f7a53a0e3db333e08459230e23
7
- data.tar.gz: e010e73bd02ea768b4ae1170ecd12bbdd3be649afb4fbcea4b1fd25d8977f071820d9557ff43081ee14cc65dd77cb3f57e747a8a02eb2e1fa4e4d5d0c9ece0c0
6
+ metadata.gz: 8cc31dc8c635c9f591906e0c5acf407f793b7f749c265f8cc0eceea1b15adeed063250717eeb3a00dd2bdcb341986508f36a6a5e34aabb5e9338f6231a9b7281
7
+ data.tar.gz: 729a81fa41c7f52dd40cfee32e98a13e7259a18b5759728bb5eb622c117e143082498cd5ec3431e06e753ebd8d080c2d75d1a64ec140f79bc117604810f3389d
@@ -49,14 +49,22 @@ module Poseidon
49
49
 
50
50
  # Return lead broker for topic and partition
51
51
  def lead_broker_for_partition(topic_name, partition)
52
- raise ::Poseidon::Errors::UnknownTopicOrPartition unless @topic_metadata[topic_name]
52
+ unless @topic_metadata[topic_name]
53
+ raise ::Poseidon::Errors::UnknownTopicOrPartition,
54
+ "Topic not found: #{topic_name}"
55
+ end
56
+
57
+ unless (broker_id = @topic_metadata[topic_name].partition_leader(partition))
58
+ raise ::Poseidon::Errors::UnknownTopicOrPartition,
59
+ "Partition not found #{topic_name}/#{partition}"
60
+ end
53
61
 
54
- broker_id = @topic_metadata[topic_name].partition_leader(partition)
55
- if broker_id
56
- @brokers[broker_id]
57
- else
58
- raise ::Poseidon::Errors::UnknownTopicOrPartition
62
+ unless (broker = @brokers[broker_id])
63
+ raise ::Poseidon::Errors::LeaderNotAvailable,
64
+ "Lead broker #{broker_id} not present in brokers: #{@brokers.keys.inspect}"
59
65
  end
66
+
67
+ broker
60
68
  end
61
69
 
62
70
  def topics
@@ -1,4 +1,4 @@
1
1
  module Poseidon
2
2
  # Unstable! API May Change!
3
- VERSION = "0.0.14"
3
+ VERSION = "0.0.15"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeclimate-poseidon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Potter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-09 00:00:00.000000000 Z
11
+ date: 2017-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  version: '0'
186
186
  requirements: []
187
187
  rubyforge_project:
188
- rubygems_version: 2.6.8
188
+ rubygems_version: 2.6.11
189
189
  signing_key:
190
190
  specification_version: 4
191
191
  summary: Poseidon is a producer and consumer implementation for Kafka >= 0.8