fluent-plugin-mongo 0.7.6 → 0.7.7
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 +4 -4
- data/ChangeLog +5 -0
- data/VERSION +1 -1
- data/lib/fluent/plugin/in_mongo_tail.rb +37 -31
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1b44afa9a00bcc44e988c6ff186cef45226f59c
|
4
|
+
data.tar.gz: 72818ef49d77f1eb77c58a421a528a53142302fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f41c96c14b596e8bb394f5e94045f84272f104c2d8848f4f761c265c3c33ee69803638af0b7ada30a604574817bbca813f4326edad15f5607c16287cc23efc51
|
7
|
+
data.tar.gz: 6b31e68117d8ea3a5465ac02804c6e8a1d71f42cdb4b855c520eff1b9273a967acf3b12661113b93a265963ad1bfd4121cf7d6573a7894a71129bcddb7736bf4
|
data/ChangeLog
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.7
|
@@ -60,6 +60,7 @@ module Fluent
|
|
60
60
|
@file.close
|
61
61
|
end
|
62
62
|
|
63
|
+
@stop = true
|
63
64
|
@thread.join
|
64
65
|
@client.db.connection.close
|
65
66
|
super
|
@@ -67,7 +68,21 @@ module Fluent
|
|
67
68
|
|
68
69
|
def run
|
69
70
|
loop {
|
70
|
-
|
71
|
+
cursor = Mongo::Cursor.new(@client, cursor_conf)
|
72
|
+
begin
|
73
|
+
loop {
|
74
|
+
return if @stop
|
75
|
+
|
76
|
+
cursor = Mongo::Cursor.new(@client, cursor_conf) unless cursor.alive?
|
77
|
+
if doc = cursor.next_document
|
78
|
+
process_document(doc)
|
79
|
+
else
|
80
|
+
sleep @wait_time
|
81
|
+
end
|
82
|
+
}
|
83
|
+
rescue
|
84
|
+
# ignore Mongo::OperationFailuer at CURSOR_NOT_FOUND
|
85
|
+
end
|
71
86
|
}
|
72
87
|
end
|
73
88
|
|
@@ -89,36 +104,27 @@ module Fluent
|
|
89
104
|
end
|
90
105
|
end
|
91
106
|
|
92
|
-
def
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
# Should use MultiEventStream?
|
115
|
-
Engine.emit(tag, time, doc)
|
116
|
-
else
|
117
|
-
sleep @wait_time
|
118
|
-
end
|
119
|
-
}
|
120
|
-
rescue
|
121
|
-
# ignore Mongo::OperationFailuer at CURSOR_NOT_FOUND
|
107
|
+
def process_document(doc)
|
108
|
+
time = if @time_key
|
109
|
+
t = doc.delete(@time_key)
|
110
|
+
t.nil? ? Engine.now : t.to_i
|
111
|
+
else
|
112
|
+
Engine.now
|
113
|
+
end
|
114
|
+
tag = if @tag_key
|
115
|
+
t = doc.delete(@tag_key)
|
116
|
+
t.nil? ? 'mongo.missing_tag' : t
|
117
|
+
else
|
118
|
+
@tag
|
119
|
+
end
|
120
|
+
if id = doc.delete('_id')
|
121
|
+
@last_id = id.to_s
|
122
|
+
doc['_id_str'] = @last_id
|
123
|
+
save_last_id if @id_store_file
|
124
|
+
end
|
125
|
+
|
126
|
+
# Should use MultiEventStream?
|
127
|
+
Engine.emit(tag, time, doc)
|
122
128
|
end
|
123
129
|
|
124
130
|
def cursor_conf
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-mongo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro Nakagawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|