poseidon 0.0.2 → 0.0.3

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: 768653a82da925b840342126faf304153c1b1455
4
- data.tar.gz: 82c3ed1cd5746d582666e7e04aec8cecca986b91
3
+ metadata.gz: 3d5bb4f86848c948a0395678c366213e43a69129
4
+ data.tar.gz: f9ef623ef716cfe2197c55cb50031c41eb45f785
5
5
  SHA512:
6
- metadata.gz: e67ed28694dcb0c8f1596ada7a61b6c53ddaf36c639eaf6cbd69fa95390daefdef901cf587057778aa6776ad769f9046bc66db34e1731ea1efff4f0d6f58a04f
7
- data.tar.gz: 861af0b1788b241e59de63a87514d3af0a60d04f6d9b14dca22966a4172a5c45c19888bd0ff1da0aa9df575829d1879d9e1e3c3cf3aebff4a7243a02fc65707e
6
+ metadata.gz: ff293ca0f11064c40e3411a57ab8df729013524cf2afb9c2dd018153457f34e200bd8fdfd6ee32aaf4a7af3fa2ce6e19447f9a70275c8bda8332285180e2b509
7
+ data.tar.gz: 4c4ab22ed0aa8d84cdfce68051788c0cdfb5fb60d468c64740285af4bda8b217473c11e1974aaa4c4220f4fe6ca7542e8c9a71de5e081a8d2e33aa83323bb91f
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.0.3
2
+
3
+ * Better distribute messages across partitions.
4
+ * Handle broken connections better.
5
+ * Gracefully handle attempts to send an empty set of messages.
6
+
1
7
  # 0.0.2
2
8
 
3
9
  * Added ability to create a partitioner consumer for a topic+partition using topic metadata.
@@ -116,7 +116,7 @@ module Poseidon
116
116
  buffer = Protocol::RequestBuffer.new
117
117
  request.write(buffer)
118
118
  @socket.write([buffer.to_s.size].pack("N") + buffer.to_s)
119
- rescue Errno::EPIPE
119
+ rescue Errno::EPIPE, Errno::ECONNRESET
120
120
  @socket = nil
121
121
  raise ConnectionFailedError
122
122
  end
@@ -12,7 +12,9 @@ module Poseidon
12
12
  def initialize(cluster_metadata, partitioner)
13
13
  @cluster_metadata = cluster_metadata
14
14
  @partitioner = partitioner
15
- @partition_counter = -1
15
+
16
+ # Don't always start from partition 0
17
+ @partition_counter = rand(65536)
16
18
  end
17
19
 
18
20
  # Determines which partition a message should be sent to.
@@ -36,6 +36,8 @@ module Poseidon
36
36
  end
37
37
 
38
38
  def send_messages(messages)
39
+ return if messages.empty?
40
+
39
41
  messages_to_send = MessagesToSend.new(messages, @cluster_metadata)
40
42
 
41
43
  (@max_send_retries+1).times do
@@ -1,4 +1,4 @@
1
1
  module Poseidon
2
2
  # Unstable! API May Change!
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poseidon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Potter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-19 00:00:00.000000000 Z
11
+ date: 2013-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec