fluent-plugin-kafka 0.0.14 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8cfb2bcd144f0b7025ff278383db1ff29495d7ac
4
- data.tar.gz: 630b5829301e2521ea22046702357e96a17776da
3
+ metadata.gz: ea8e8c26bed79cf08bcf26e11213a6aec0757741
4
+ data.tar.gz: 40df9fd993cd1f5daf1f7f10331c2370986df549
5
5
  SHA512:
6
- metadata.gz: fd2e8367a7ccd8e9dcf38fed3b061286af56de6795506963a0eac3157e7ed58b247637a3b3cb25f812cb4ea72e5b48c7f7b1e28120886ac7fc60d0b055edc5e9
7
- data.tar.gz: b10b51433c160cd96a97fd11188e3645528f82e93a124e7689ead5ab297fbc2448f20e350b3af2dddaa437f6044c2b6e51447c07a765540a487e9ff58f2f0313
6
+ metadata.gz: f360beef321eeee7dc4dec739d3386e205bf81878ef8777e1970aee147f681dcf930b345efb46bc5a5bdf037caab07ea1a6f7a0abbec21e70581e44c32fb44b9
7
+ data.tar.gz: 89b381653212a2a4ac66e69df57033f80206d3e2d6c5c48bc4bb5653e548c4a1f61aa85a7427703a30e544c1de429d0457fd1dfd12ea798a81ae13b824813952
data/README.md CHANGED
@@ -29,8 +29,21 @@ Or install it yourself as:
29
29
  format <input text type (text|json|ltsv|msgpack)>
30
30
  add_prefix <tag prefix (Optional)>
31
31
  add_suffix <tag suffix (Optional)>
32
+ max_bytes (integer) :default => nil (Use default of Poseidon)
33
+ max_wait_ms (integer) :default => nil (Use default of Poseidon)
34
+ min_bytes (integer) :default => nil (Use default of Poseidon)
35
+ socket_timeout_ms (integer) :default => nil (Use default of Poseidon)
32
36
  </source>
33
37
 
38
+ Supports following Poseidon::PartitionConsumer options.
39
+
40
+ - max_bytes — default: 1048576 (1MB) — Maximum number of bytes to fetch
41
+ - max_wait_ms — default: 100 (100ms) — How long to block until the server sends us data.
42
+ - min_bytes — default: 1 (Send us data as soon as it is ready) — Smallest amount of data the server should send us.
43
+ - socket_timeout_ms - default: 10000 (10s) - How long to wait for reply from server. Should be higher than max_wait_ms.
44
+
45
+ See also [Poseidon::PartitionConsumer](http://www.rubydoc.info/github/bpot/poseidon/Poseidon/PartitionConsumer) for more detailed documentation about Poseidon.
46
+
34
47
  ### Output plugin (non-buffered)
35
48
 
36
49
  <match *.**>
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
12
12
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
13
  gem.name = "fluent-plugin-kafka"
14
14
  gem.require_paths = ["lib"]
15
- gem.version = '0.0.14'
15
+ gem.version = '0.0.15'
16
16
  gem.add_dependency 'fluentd'
17
17
  gem.add_dependency 'poseidon'
18
18
  gem.add_dependency 'ltsv'
@@ -14,6 +14,12 @@ class KafkaInput < Input
14
14
  config_param :add_prefix, :string, :default => nil
15
15
  config_param :add_suffix, :string, :default => nil
16
16
 
17
+ # poseidon PartitionConsumer options
18
+ config_param :max_bytes, :integer, :default => nil
19
+ config_param :max_wait_ms, :integer, :default => nil
20
+ config_param :min_bytes, :integer, :default => nil
21
+ config_param :socket_timeout_ms, :integer, :default => nil
22
+
17
23
  def initialize
18
24
  super
19
25
  require 'poseidon'
@@ -38,8 +44,14 @@ class KafkaInput < Input
38
44
 
39
45
  def start
40
46
  @loop = Coolio::Loop.new
47
+ opt = {}
48
+ opt[:max_bytes] = @max_bytes if @max_bytes
49
+ opt[:max_wait_ms] = @max_wait_ms if @max_wait_ms
50
+ opt[:min_bytes] = @min_bytes if @min_bytes
51
+ opt[:socket_timeout_ms] = @socket_timeout_ms if @socket_timeout_ms
52
+
41
53
  @topic_watchers = @topic_list.map {|topic|
42
- TopicWatcher.new(topic, @host, @port, @client_id, @partition, @offset, interval, @format, @add_prefix, @add_suffix)
54
+ TopicWatcher.new(topic, @host, @port, @client_id, @partition, @offset, interval, @format, @add_prefix, @add_suffix, opt)
43
55
  }
44
56
  @topic_watchers.each {|tw|
45
57
  tw.attach(@loop)
@@ -59,7 +71,7 @@ class KafkaInput < Input
59
71
  end
60
72
 
61
73
  class TopicWatcher < Coolio::TimerWatcher
62
- def initialize(topic, host, port, client_id, partition, offset, interval, format, add_prefix, add_suffix)
74
+ def initialize(topic, host, port, client_id, partition, offset, interval, format, add_prefix, add_suffix, options={})
63
75
  @topic = topic
64
76
  @callback = method(:consume)
65
77
  @format = format
@@ -71,7 +83,8 @@ class KafkaInput < Input
71
83
  port, # port
72
84
  topic, # topic
73
85
  partition, # partition
74
- offset # offset
86
+ offset, # offset
87
+ options # options
75
88
  )
76
89
 
77
90
  super(interval, true)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hidemasa Togashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-06 00:00:00.000000000 Z
11
+ date: 2015-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd