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 +4 -4
- data/lib/poseidon/cluster_metadata.rb +14 -6
- data/lib/poseidon/version.rb +1 -1
- 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: 87b2ad36f5c17298853637118a0ce8b8febe91c2
|
4
|
+
data.tar.gz: 3696f519b680dc6542d4255800878fb85b4af2ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
55
|
-
|
56
|
-
|
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
|
data/lib/poseidon/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|