franz 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/franz/output/kafka.rb +7 -6
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3daab71d5207b3f6b7e32c4799ada5d1c1597f64
4
- data.tar.gz: f5440a6bff60093e02925e6e0e81804a97ff730c
3
+ metadata.gz: fd20ae601a812f14da2e9d9146e9d74970659581
4
+ data.tar.gz: 69e9d35c516f2cf92a318f8bc33ffc63f7639429
5
5
  SHA512:
6
- metadata.gz: a8e79de017d808a8ea074a313d7fa80de03946174dcb9533afee6d2480a595f882abd829f5c75b100a5ee0f725c36d9dfd438407f7377ad051035fc18e045fd2
7
- data.tar.gz: 5911d098549d5afa4061bb6e7327355bdabc094d096b3c9b1bc9fa7d839b95e20b07bf857ec04f8b645e05a08b384cc89dd705917e0cb51d1298396391a97ca8
6
+ metadata.gz: 73af588b20cba91ff0c5cacd024976b003cec1a9ed0e3950652e0684ab8041393351b88d09d25199b996a844ffd8760f99da19f8ed418332d2d105443ba4a763
7
+ data.tar.gz: a9b99b414f778002471fc9ef24c133f57a06091304ba2c644decb6c1707d86ec323b7c7bd8730e523ac26aabe9724f997bbbfac438605f3d9427bfd176a3d871
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0
1
+ 2.0.1
@@ -28,7 +28,6 @@ module Franz
28
28
  flush_interval: 10,
29
29
  flush_size: 500,
30
30
  client_id: @@host,
31
- cluster: %w[ localhost:9092 ],
32
31
  type: 'sync',
33
32
  compression_codec: 'snappy',
34
33
  metadata_refresh_interval_ms: 600000,
@@ -51,12 +50,14 @@ module Franz
51
50
  @flush_size = opts[:output].delete :flush_size
52
51
  @flush_interval = opts[:output].delete :flush_interval
53
52
 
54
- kafka_cluster = opts[:output].delete :cluster
53
+ kafka_brokers = opts[:output].delete(:brokers) || %w[ localhost:9092 ]
55
54
  kafka_client_id = opts[:output].delete :client_id
56
- kafka_config = opts[:output].map { |k,v| v.is_a?(String) ? v.to_sym : v }
55
+ kafka_config = opts[:output].map { |k,v|
56
+ [ k, v.is_a?(String) ? v.to_sym : v ]
57
+ }
57
58
 
58
59
  @kafka = Poseidon::Producer.new \
59
- kafka_cluster,
60
+ kafka_brokers,
60
61
  kafka_client_id,
61
62
  Hash[kafka_config]
62
63
 
@@ -93,8 +94,8 @@ module Franz
93
94
 
94
95
  @statz.inc :num_output
95
96
 
96
- if @statz.get(:num_output) % @flush_size == 0
97
- @kafka.send_messages @messages unless @messages.empty?
97
+ if @messages.size >= @flush_size
98
+ @kafka.send_messages @messages
98
99
  log.debug \
99
100
  event: 'flush',
100
101
  num_messages: @messages.size
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: franz
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Clemmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-06 00:00:00.000000000 Z
11
+ date: 2015-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slog