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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +0 -4
- data/fluent-plugin-hash-forward.gemspec +1 -2
- data/lib/fluent/plugin/out_hash_forward.rb +6 -2
- data/spec/out_hash_forward_spec.rb +2 -2
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67c2e4d3c4371b6f3ee286355aa263c508d5ac3a
|
4
|
+
data.tar.gz: bace3f46951ee47745f783dab9b49e42cee52944
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7271456aad10bb6d15a707cc076e6a1391cf34cef41d347848a3033e171d54be0d3270f5c189aaf66a5e2f2e7056540dbc5ee032250ed7fe319ba20e30791deb
|
7
|
+
data.tar.gz: a808d47d2c9c64ea383f3c2e50599a5c95ee946c7f04665d02013ca761b3101174a1321f1d11353b01fe89116bd1a32cffea6c1ced9cd8cc7e7a0b032ba9d3e5
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -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.
|
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
|
-
|
72
|
-
|
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
|
-
|
119
|
-
|
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.
|
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-
|
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
|