fluent-plugin-keep-forward 0.1.6 → 0.1.7

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: 75c69e5a185b2fd2c114c9c3956eae071db46ad9
4
- data.tar.gz: 1c33c34aaaa7cd4034a2e94f3de1fd579e7dcd70
3
+ metadata.gz: c82dd50496df657920e79640a4980d573a167f5a
4
+ data.tar.gz: 2e9ba3b06152cf3dbbd8d9eb4fbca6c6a8f3dab2
5
5
  SHA512:
6
- metadata.gz: 30ea2dc8ba742bffa43ab6c7d1df6e97884ad8225fde1a7c7b423d63cccdc76ea9eda70dc3035a71a54b8383d917691446664a374410b49e43c49bc093f4775d
7
- data.tar.gz: 1093a335e42d0aa96834807c082b7524c5fd56c61a0d4640939be1d28085576c2b04a252f01b4ef8fefaacb8d9e95e039646a03757a219ff826336d7f90bf63e
6
+ metadata.gz: 470977d9926f02f76030f2502784e8c87cf449f167591f996b4307d69826ccda6a566d2533f13c9bf01ac8d4da83d59a80879a4db7b4bf5bcdc4dc069b0d3885
7
+ data.tar.gz: 2d120d7f776b2fc8535a4773d02b84b49ad0ff2507fd8c4a5b2d93377a8c51410ad0f4943275153f222e49692656a34d3ce7ef93004022cc8479aa514eb9cba2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.1.7 (2014/04/06)
2
+
3
+ Enhancements:
4
+
5
+ * Add `keepforward thread` option
6
+
1
7
  ## 0.1.6 (2014/03/28)
2
8
 
3
9
  Enhancements:
data/README.md CHANGED
@@ -28,6 +28,7 @@ Following parameters are additionally available:
28
28
  - keepforward
29
29
 
30
30
  `one` for keep forwarding all data to the one node.
31
+ `thread` for keep forwarding to the different node in each thread.
31
32
  `tag` for keep forwarding data with the same tag to the same node.
32
33
  Default is `one`.
33
34
 
@@ -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-keep-forward"
6
- s.version = "0.1.6"
6
+ s.version = "0.1.7"
7
7
  s.authors = ["Naotoshi Seo"]
8
8
  s.email = ["sonots@gmail.com"]
9
9
  s.homepage = "https://github.com/sonots/fluent-plugin-keep-forward"
@@ -17,8 +17,10 @@ class Fluent::KeepForwardOutput < Fluent::ForwardOutput
17
17
  :one
18
18
  when 'tag'
19
19
  :tag
20
+ when 'thread'
21
+ :thread
20
22
  else
21
- raise ::Fluent::ConfigError, "out_keep_forward keepforward should be 'one' or 'tag'"
23
+ raise ::Fluent::ConfigError, "out_keep_forward keepforward should be 'one' or 'thread', or 'tag'"
22
24
  end
23
25
  end
24
26
  config_param :heartbeat_type, :default => :udp do |val|
@@ -51,18 +53,6 @@ class Fluent::KeepForwardOutput < Fluent::ForwardOutput
51
53
  @watcher_interval = 1
52
54
  end
53
55
 
54
- def get_node(tag)
55
- @node[keepforward(tag)]
56
- end
57
-
58
- def keepforward(tag)
59
- @keepforward == :one ? :one : tag
60
- end
61
-
62
- def cache_node(tag, node)
63
- @node[keepforward(tag)] = node
64
- end
65
-
66
56
  def start
67
57
  super
68
58
  start_watcher
@@ -253,6 +243,25 @@ class Fluent::KeepForwardOutput < Fluent::ForwardOutput
253
243
  end
254
244
  end
255
245
 
246
+ def keepforward(tag)
247
+ case @keepforward
248
+ when :tag
249
+ tag
250
+ when :thread
251
+ Thread.current.object_id
252
+ else # :one
253
+ :one
254
+ end
255
+ end
256
+
257
+ def cache_node(tag, node)
258
+ @node[keepforward(tag)] = node
259
+ end
260
+
261
+ def get_node(tag)
262
+ @node[keepforward(tag)]
263
+ end
264
+
256
265
  def get_mutex(node)
257
266
  thread_id = Thread.current.object_id
258
267
  @mutex[thread_id] ||= {}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-keep-forward
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-28 00:00:00.000000000 Z
11
+ date: 2014-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd