ffwd-kafka 0.1.1 → 0.1.2

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 84c4a7fb542e7d55261f72ee82b249d326fec812
4
+ data.tar.gz: 39bd2c697d87fcd716dd18b7ce62d0857b8c15b9
5
+ SHA512:
6
+ metadata.gz: d36db430844b2ac92bbe38b3c95ebf2e8856d1480fbaf50add354f593dd3dfd20660ffd1e4a5dc63e080d89cf2f272cdd80af0c2cd2adb7495fd325695fc7735
7
+ data.tar.gz: 58e27c9e33728d566b53dfe5376bcae86ce0cadf228cd3c599220ccb0f26a18c95a739263b91f41c430ca16dc7d9bde7f3e9a0ceba54bcf99f59ee73194eb9eb
@@ -32,6 +32,15 @@ module FFWD::Plugin::Kafka
32
32
  class AttributePartitioner
33
33
  DEFAULT_ATTRIBUTE = :site
34
34
 
35
+ OPTIONS = [
36
+ FFWD::Plugin.option(
37
+ :attribute, :default => DEFAULT_ATTRIBUTE,
38
+ :help => [
39
+ "Attribute to use when the partitioner is set to :attribute."
40
+ ]
41
+ ),
42
+ ]
43
+
35
44
  def self.build opts
36
45
  attr = opts[:attribute] || DEFAULT_ATTRIBUTE
37
46
  new attr
@@ -13,6 +13,8 @@
13
13
  # License for the specific language governing permissions and limitations under
14
14
  # the License.
15
15
 
16
+ require 'ffwd/plugin'
17
+
16
18
  module FFWD::Plugin::Kafka
17
19
  # Use a custom attribute for partitioning.
18
20
  class AttributeRouter
@@ -20,6 +22,30 @@ module FFWD::Plugin::Kafka
20
22
  DEFAULT_EVENT_PATTERN = "events-%s"
21
23
  DEFAULT_ATTRIBUTE = :site
22
24
 
25
+ OPTIONS = [
26
+ FFWD::Plugin.option(
27
+ :metric_pattern, :default => DEFAULT_METRIC_PATTERN,
28
+ :help => [
29
+ "Only used with :attribute router.",
30
+ "Metric pattern to use, expects one %s placeholder for the value of the specified attribute."
31
+ ]
32
+ ),
33
+ FFWD::Plugin.option(
34
+ :event_pattern, :default => DEFAULT_METRIC_PATTERN,
35
+ :help => [
36
+ "Only used with :attribute router.",
37
+ "Event pattern to use, expects one %s placeholder for the value of the specified attribute."
38
+ ]
39
+ ),
40
+ FFWD::Plugin.option(
41
+ :attribute, :default => DEFAULT_ATTRIBUTE,
42
+ :help => [
43
+ "Only used with :attribute router.",
44
+ "Attribute name to use in pattern when router is :attribute."
45
+ ]
46
+ ),
47
+ ]
48
+
23
49
  def self.build opts
24
50
  metric_pattern = opts[:metric_pattern] || DEFAULT_METRIC_PATTERN
25
51
  event_pattern = opts[:event_pattern] || DEFAULT_EVENT_PATTERN
@@ -16,7 +16,7 @@
16
16
  module FFWD
17
17
  module Plugin
18
18
  module Kafka
19
- VERSION = "0.1.1"
19
+ VERSION = "0.1.2"
20
20
  end
21
21
  end
22
22
  end
@@ -28,15 +28,41 @@ module FFWD::Plugin
28
28
  include FFWD::Plugin
29
29
  include FFWD::Logging
30
30
 
31
- register_plugin "kafka"
32
-
33
31
  DEFAULT_PRODUCER = "ffwd"
34
- DEFAULT_ROUTING_METHOD = :attribute
35
- DEFAULT_ROUTING_KEY = :site
36
32
  DEFAULT_BROKERS = ["localhost:9092"]
37
33
  DEFAULT_PARTITIONER = :host
38
34
  DEFAULT_ROUTER = :attribute
39
35
 
36
+ register_plugin "kafka",
37
+ :description => "A plugin for the collectd binary protocol.",
38
+ :options => [
39
+ FFWD::Plugin.option(
40
+ :producer, :default => DEFAULT_PRODUCER,
41
+ :help => ["Name of the producer."]
42
+ ),
43
+ FFWD::Plugin.option(
44
+ :port, :default => DEFAULT_BROKERS,
45
+ :help => ["Brokers to connect to."]
46
+ ),
47
+ FFWD::Plugin.option(
48
+ :partitioner, :default => DEFAULT_PARTITIONER,
49
+ :help => [
50
+ "Partitioner to use, the partitioner decides what partition key is used for a specific message.",
51
+ ":host - Base partition key of the host of the event/metric.",
52
+ ":key - Base partition key of the key of the event/metric.",
53
+ ":attribute - Base partition key of a specific attribute of the event/metric."
54
+ ]
55
+ ),
56
+ FFWD::Plugin.option(
57
+ :router, :default => DEFAULT_ROUTER,
58
+ :help => [
59
+ "Router to use, the router decides which topic to use for a specific message."
60
+ ]
61
+ ),
62
+ ] +
63
+ FFWD::Plugin::Kafka::AttributePartitioner::OPTIONS +
64
+ FFWD::Plugin::Kafka::AttributeRouter::OPTIONS
65
+
40
66
  def self.setup_output opts, core
41
67
  producer = opts[:producer] || DEFAULT_PRODUCER
42
68
  brokers = opts[:brokers] || DEFAULT_BROKERS
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffwd-kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
5
- prerelease:
4
+ version: 0.1.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - John-John Tedro
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-03-02 00:00:00.000000000 Z
11
+ date: 2014-03-03 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: poseidon
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: ffwd
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  description:
@@ -50,35 +45,34 @@ executables: []
50
45
  extensions: []
51
46
  extra_rdoc_files: []
52
47
  files:
53
- - lib/ffwd/plugin/kafka.rb
54
- - lib/ffwd/plugin/kafka/version.rb
48
+ - lib/ffwd/plugin/kafka/output.rb
55
49
  - lib/ffwd/plugin/kafka/producer.rb
56
- - lib/ffwd/plugin/kafka/partitioners.rb
57
50
  - lib/ffwd/plugin/kafka/routers.rb
58
- - lib/ffwd/plugin/kafka/output.rb
51
+ - lib/ffwd/plugin/kafka/version.rb
52
+ - lib/ffwd/plugin/kafka/partitioners.rb
53
+ - lib/ffwd/plugin/kafka.rb
59
54
  homepage: https://github.com/spotify/ffwd
60
55
  licenses:
61
56
  - Apache 2.0
57
+ metadata: {}
62
58
  post_install_message:
63
59
  rdoc_options: []
64
60
  require_paths:
65
61
  - lib
66
62
  required_ruby_version: !ruby/object:Gem::Requirement
67
- none: false
68
63
  requirements:
69
- - - ! '>='
64
+ - - '>='
70
65
  - !ruby/object:Gem::Version
71
66
  version: '0'
72
67
  required_rubygems_version: !ruby/object:Gem::Requirement
73
- none: false
74
68
  requirements:
75
- - - ! '>='
69
+ - - '>='
76
70
  - !ruby/object:Gem::Version
77
71
  version: '0'
78
72
  requirements: []
79
73
  rubyforge_project:
80
- rubygems_version: 1.8.23
74
+ rubygems_version: 2.0.3
81
75
  signing_key:
82
- specification_version: 3
76
+ specification_version: 4
83
77
  summary: Kafka support for FFWD.
84
78
  test_files: []