codeclimate-poseidon 0.0.12 → 0.0.13
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 +2 -0
- data/lib/poseidon/version.rb +1 -1
- data/spec/unit/cluster_metadata_spec.rb +6 -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: 0302cc6f1a4201b82c1f76a2254e5fad99c500e5
|
4
|
+
data.tar.gz: 740e24b90c903253b87ea4a7af4baf65ea503b3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e4a6ad856eee78acf6a5ad2ebffb6ea0d4773373823444c959f70cf5c8d044144d8b03256a32691222ddcceeb03ff044c683ef8440e9aab861ba0a9cf943d7a
|
7
|
+
data.tar.gz: 703b698973875c75c00f1b261f0cea3fbdaf601158010ea8858d4f28aaa000435722d05faab81be6cb73f7164a9996664e32a71b8ec2a74125294f5635739fcc
|
@@ -49,6 +49,8 @@ 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]
|
53
|
+
|
52
54
|
broker_id = @topic_metadata[topic_name].partition_leader(partition)
|
53
55
|
if broker_id
|
54
56
|
@brokers[broker_id]
|
data/lib/poseidon/version.rb
CHANGED
@@ -42,5 +42,11 @@ RSpec.describe ClusterMetadata do
|
|
42
42
|
expect(@cm.lead_broker_for_partition("test",1).id).to eq(1)
|
43
43
|
expect(@cm.lead_broker_for_partition("test",2).id).to eq(2)
|
44
44
|
end
|
45
|
+
|
46
|
+
it "raises an UnknownErrorOrPartition when the topic does not exist" do
|
47
|
+
expect {
|
48
|
+
@cm.lead_broker_for_partition("nonsense",1)
|
49
|
+
}.to raise_error(::Poseidon::Errors::UnknownTopicOrPartition)
|
50
|
+
end
|
45
51
|
end
|
46
52
|
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.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Potter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-16 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.
|
188
|
+
rubygems_version: 2.5.1
|
189
189
|
signing_key:
|
190
190
|
specification_version: 4
|
191
191
|
summary: Poseidon is a producer and consumer implementation for Kafka >= 0.8
|