fluent-plugin-hash-forward 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: 38bfa4c2b8ecb078ef39859c02f535d445f6abc5
4
- data.tar.gz: 14a48e69abed66f8ed07ae185286d82d91c3aa21
3
+ metadata.gz: 67c2e4d3c4371b6f3ee286355aa263c508d5ac3a
4
+ data.tar.gz: bace3f46951ee47745f783dab9b49e42cee52944
5
5
  SHA512:
6
- metadata.gz: 993925c2ddb9e8909c7f1bd508f14b6d0ab22b63d4c267b01808d8bd9c3dd4789b871cc7388e20db5d132469fe19c8d00749a37b116e6d2841572c024c0ef441
7
- data.tar.gz: e738d73bdc48f65f64e23287ba1fa8c941a6a5d777686aff5f6c7c82e144919494e9ec925f130cbd4f050420ac744c846fe9b86ebff5bd913347f3bdfb05a2c5
6
+ metadata.gz: 7271456aad10bb6d15a707cc076e6a1391cf34cef41d347848a3033e171d54be0d3270f5c189aaf66a5e2f2e7056540dbc5ee032250ed7fe319ba20e30791deb
7
+ data.tar.gz: a808d47d2c9c64ea383f3c2e50599a5c95ee946c7f04665d02013ca761b3101174a1321f1d11353b01fe89116bd1a32cffea6c1ced9cd8cc7e7a0b032ba9d3e5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.0.3 (2013/11/01)
2
+
3
+ Changes
4
+
5
+ * No dependency on murmurhash3 any more
6
+
1
7
  # 0.0.2 (2013/10/31)
2
8
 
3
9
  Changes
data/README.md CHANGED
@@ -2,10 +2,6 @@
2
2
 
3
3
  Fluentd plugin to keep forwarding messages of a specific tag pattern to a specific node
4
4
 
5
- - Forward some servers
6
- - Same tag messages forward to the same server
7
- - Using Murmurhash
8
-
9
5
  ## Configuration
10
6
 
11
7
  Example:
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "fluent-plugin-hash-forward"
6
- s.version = "0.0.2"
6
+ s.version = "0.0.3"
7
7
  s.authors = ["Ryosuke IWANAGA", "Naotoshi SEO"]
8
8
  s.email = ["riywo.jp@gmail.com", "sonots@gmail.com"]
9
9
  s.homepage = "https://github.com/riywo/fluent-plugin-hash-forward"
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  s.add_runtime_dependency "fluentd"
22
- s.add_runtime_dependency "murmurhash3"
23
22
  s.add_development_dependency "rake"
24
23
  s.add_development_dependency "rspec"
25
24
  s.add_development_dependency "pry"
@@ -68,8 +68,12 @@ class Fluent::HashForwardOutput < Fluent::ForwardOutput
68
68
 
69
69
  # hashing(key) mod N
70
70
  def get_index(key, size)
71
- require 'murmurhash3'
72
- MurmurHash3::V32.str_hash(key) % size
71
+ str_hash(key) % size
72
+ end
73
+
74
+ # the simplest hashing ever
75
+ def str_hash(key)
76
+ key.bytes.inject(&:+)
73
77
  end
74
78
 
75
79
  def perform_hash_key_slice(tag)
@@ -115,8 +115,8 @@ describe Fluent::HashForwardOutput do
115
115
  let(:tag1) { 'test.tag1' }
116
116
  let(:tag2) { 'test.tag2' }
117
117
  before do
118
- MurmurHash3::V32.stub(:str_hash).with(tag1).and_return(0)
119
- MurmurHash3::V32.stub(:str_hash).with(tag2).and_return(1)
118
+ driver.instance.stub(:str_hash).with(tag1).and_return(0)
119
+ driver.instance.stub(:str_hash).with(tag2).and_return(1)
120
120
  @node1 = driver.instance.nodes(tag1).first
121
121
  end
122
122
  it 'should forward to the different node' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-hash-forward
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
  - Ryosuke IWANAGA
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-31 00:00:00.000000000 Z
12
+ date: 2013-11-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -25,20 +25,6 @@ dependencies:
25
25
  - - '>='
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
- - !ruby/object:Gem::Dependency
29
- name: murmurhash3
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - '>='
33
- - !ruby/object:Gem::Version
34
- version: '0'
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - '>='
40
- - !ruby/object:Gem::Version
41
- version: '0'
42
28
  - !ruby/object:Gem::Dependency
43
29
  name: rake
44
30
  requirement: !ruby/object:Gem::Requirement