ruby-kafka-ec2 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kafka/ec2/mixed_instance_assignment_strategy.rb +14 -13
- data/lib/kafka/ec2/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b87f937f29a107174e7a972b79e2a717780bdd28b28fa37e3601633ff1f075b0
|
4
|
+
data.tar.gz: 413c79ff75ccb9f9304dd5c57dfb2fb1f26b0b673eeae9cb7e7d86cb68d65e74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22dfa6ddf4e0e0f8eb5db7bd6cb9c54b25edb175186bba989b32df698e23c705754c8dff057e7d82df480a3835bea110a363177b36739bca73432206227ac680
|
7
|
+
data.tar.gz: 1deda3ac8da64c41f9d598e26049b667aec2d81956a98dc7ded279c8a13e517d7dc4042ab34f9f4e8a05365be46c570e274207bd5bd430210b7de458972cace3
|
@@ -74,28 +74,29 @@ module Kafka
|
|
74
74
|
member_ids = instance_id_to_member_ids[instance_id]
|
75
75
|
member_ids.each do |member_id|
|
76
76
|
acceptable_partition_weight = capacity * partition_weight_per_capacity / member_ids.size
|
77
|
-
|
77
|
+
while last_index < topic_partitions.size
|
78
78
|
topic, partition = topic_partitions[last_index]
|
79
79
|
partition_weight = partition_weights.dig(topic, partition)
|
80
|
-
if
|
81
|
-
member_id_to_acceptable_partition_weight[member_id] = acceptable_partition_weight
|
82
|
-
break
|
83
|
-
end
|
80
|
+
break if acceptable_partition_weight - partition_weight < 0
|
84
81
|
|
85
82
|
group_assignment[member_id].assign(topic, [partition])
|
86
|
-
last_index += 1
|
87
83
|
acceptable_partition_weight -= partition_weight
|
84
|
+
|
85
|
+
last_index += 1
|
88
86
|
end
|
87
|
+
|
88
|
+
member_id_to_acceptable_partition_weight[member_id] = acceptable_partition_weight
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
-
|
93
|
-
member_id_to_acceptable_partition_weight.
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
92
|
+
while last_index < topic_partitions.size
|
93
|
+
member_id, _ = member_id_to_acceptable_partition_weight.max_by { |_, remaining| remaining }
|
94
|
+
topic, partition = topic_partitions[last_index]
|
95
|
+
group_assignment[member_id].assign(topic, [partition])
|
96
|
+
|
97
|
+
member_id_to_acceptable_partition_weight[member_id] -= partition_weights.dig(topic, partition)
|
98
|
+
|
99
|
+
last_index += 1
|
99
100
|
end
|
100
101
|
|
101
102
|
group_assignment
|
data/lib/kafka/ec2/version.rb
CHANGED