fluent-plugin-mongo 1.6.0 → 1.6.1
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/.github/dependabot.yml +6 -0
- data/.github/workflows/linux.yml +4 -5
- data/ChangeLog +6 -0
- data/VERSION +1 -1
- data/fluent-plugin-mongo.gemspec +1 -0
- data/lib/fluent/plugin/out_mongo.rb +21 -0
- data/test/plugin/test_out_mongo.rb +14 -0
- metadata +23 -8
- data/.travis.yml +0 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0a7505d5d82e1fcf8aa0625efa3bd19f68d7ddd6a9ec8ef75050d5aba1b663a1
|
|
4
|
+
data.tar.gz: a0efb583886eb8e8880881d3727dd61e6e2d19c3d2a3d34e4e5d94f0d843b3c3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c26d8de1f5c46fbeec69a871fcd26ac83969b58b49990a458f8a25eff830a2b35197267a002d657d3ae751aced56d5637ed1fbc394635e2c59886b4ba2fbe82f
|
|
7
|
+
data.tar.gz: 4a33374071ca219f56bb3be9132c1e05d3c2bf1c4018d769fbf2cb7ea61b4eb8f0cabbb6e85baceea9dfcd44c80bc11e7fce75356abe7846fdb6b6a150d082b3
|
data/.github/workflows/linux.yml
CHANGED
|
@@ -11,8 +11,8 @@ jobs:
|
|
|
11
11
|
strategy:
|
|
12
12
|
fail-fast: false
|
|
13
13
|
matrix:
|
|
14
|
-
ruby: [ '3.
|
|
15
|
-
mongodb-version: ['5.0', '4.4', '4.2'
|
|
14
|
+
ruby: [ '4.0', '3.4', '3.3', '3.2', '3.1', '3.0', '2.7' ]
|
|
15
|
+
mongodb-version: ['5.0', '4.4', '4.2']
|
|
16
16
|
os:
|
|
17
17
|
- ubuntu-latest
|
|
18
18
|
experimental: [false]
|
|
@@ -32,18 +32,17 @@ jobs:
|
|
|
32
32
|
|
|
33
33
|
name: Ruby ${{ matrix.ruby }} and MongoDB ${{ matrix.mongodb-version }} on ${{ matrix.os }}
|
|
34
34
|
steps:
|
|
35
|
-
- uses: actions/checkout@
|
|
35
|
+
- uses: actions/checkout@v3
|
|
36
36
|
- uses: ruby/setup-ruby@v1
|
|
37
37
|
with:
|
|
38
38
|
ruby-version: ${{ matrix.ruby }}
|
|
39
39
|
- name: Start MongoDB
|
|
40
|
-
uses: supercharge/mongodb-github-action@1.
|
|
40
|
+
uses: supercharge/mongodb-github-action@1.8.0
|
|
41
41
|
with:
|
|
42
42
|
mongodb-version: ${{ matrix.mongodb-version }}
|
|
43
43
|
- name: unit testing
|
|
44
44
|
env:
|
|
45
45
|
CI: true
|
|
46
46
|
run: |
|
|
47
|
-
gem install bundler rake
|
|
48
47
|
bundle install --jobs 4 --retry 3
|
|
49
48
|
bundle exec rake test
|
data/ChangeLog
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.6.
|
|
1
|
+
1.6.1
|
data/fluent-plugin-mongo.gemspec
CHANGED
|
@@ -17,6 +17,7 @@ Gem::Specification.new do |gem|
|
|
|
17
17
|
gem.require_paths = ['lib']
|
|
18
18
|
|
|
19
19
|
gem.add_dependency "fluentd", [">= 0.14.22", "< 2"]
|
|
20
|
+
gem.add_dependency "bigdecimal", "~> 4.0"
|
|
20
21
|
gem.add_runtime_dependency "mongo", ">= 2.15.0", "< 2.19.0"
|
|
21
22
|
gem.add_development_dependency "rake", ">= 0.9.2"
|
|
22
23
|
gem.add_development_dependency "simplecov", ">= 0.5.4"
|
|
@@ -351,6 +351,9 @@ module Fluent::Plugin
|
|
|
351
351
|
replace_key_of_hash(r, /^\$/, @replace_dollar_in_key_with)
|
|
352
352
|
end
|
|
353
353
|
end
|
|
354
|
+
records.map! do |r|
|
|
355
|
+
replace_value_of_hash(r)
|
|
356
|
+
end
|
|
354
357
|
|
|
355
358
|
get_collection(database, collection, @collection_options).insert_many(records)
|
|
356
359
|
rescue Mongo::Error::BulkWriteError => e
|
|
@@ -384,5 +387,23 @@ module Fluent::Plugin
|
|
|
384
387
|
hash_or_array
|
|
385
388
|
end
|
|
386
389
|
end
|
|
390
|
+
|
|
391
|
+
INT64_MAX = (2 ** 63) - 1
|
|
392
|
+
def replace_value_of_hash(hash_or_array)
|
|
393
|
+
case hash_or_array
|
|
394
|
+
when Array
|
|
395
|
+
hash_or_array.map { |v| replace_value_of_hash(v) }
|
|
396
|
+
when Hash
|
|
397
|
+
hash_or_array.each_pair { |k, v| hash_or_array[k] = replace_value_of_hash(v) }
|
|
398
|
+
when Integer
|
|
399
|
+
if hash_or_array > INT64_MAX
|
|
400
|
+
BSON::Decimal128.new(hash_or_array.to_s)
|
|
401
|
+
else
|
|
402
|
+
hash_or_array
|
|
403
|
+
end
|
|
404
|
+
else
|
|
405
|
+
hash_or_array
|
|
406
|
+
end
|
|
407
|
+
end
|
|
387
408
|
end
|
|
388
409
|
end
|
|
@@ -249,6 +249,20 @@ class MongoOutputTest < ::Test::Unit::TestCase
|
|
|
249
249
|
assert_equal({"expireAfterSeconds"=>120.0}, expire_after_hash)
|
|
250
250
|
end
|
|
251
251
|
|
|
252
|
+
def test_overflow_integer_value
|
|
253
|
+
d = create_driver
|
|
254
|
+
d.run(default_tag: 'test') do
|
|
255
|
+
time = event_time("2011-01-02 13:14:15 UTC")
|
|
256
|
+
d.feed(time, {'overflow' => (2 ** 63)})
|
|
257
|
+
d.feed(time, {'nested' => {'overflow' => (2 ** 63)}})
|
|
258
|
+
d.feed(time, {'array' => [(2 ** 63)]})
|
|
259
|
+
end
|
|
260
|
+
documents = get_documents
|
|
261
|
+
assert_equal(BSON::Decimal128.new((2 ** 63).to_s), documents[0]['overflow'])
|
|
262
|
+
assert_equal(BSON::Decimal128.new((2 ** 63).to_s), documents[1]['nested']['overflow'])
|
|
263
|
+
assert_equal(BSON::Decimal128.new((2 ** 63).to_s), documents[2]['array'][0])
|
|
264
|
+
end
|
|
265
|
+
|
|
252
266
|
class WriteWithCollectionPlaceholder < self
|
|
253
267
|
def setup
|
|
254
268
|
@tag = 'custom'
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fluent-plugin-mongo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.6.
|
|
4
|
+
version: 1.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Masahiro Nakagawa
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: fluentd
|
|
@@ -30,6 +29,20 @@ dependencies:
|
|
|
30
29
|
- - "<"
|
|
31
30
|
- !ruby/object:Gem::Version
|
|
32
31
|
version: '2'
|
|
32
|
+
- !ruby/object:Gem::Dependency
|
|
33
|
+
name: bigdecimal
|
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - "~>"
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '4.0'
|
|
39
|
+
type: :runtime
|
|
40
|
+
prerelease: false
|
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
42
|
+
requirements:
|
|
43
|
+
- - "~>"
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '4.0'
|
|
33
46
|
- !ruby/object:Gem::Dependency
|
|
34
47
|
name: mongo
|
|
35
48
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -141,9 +154,9 @@ executables:
|
|
|
141
154
|
extensions: []
|
|
142
155
|
extra_rdoc_files: []
|
|
143
156
|
files:
|
|
157
|
+
- ".github/dependabot.yml"
|
|
144
158
|
- ".github/workflows/linux.yml"
|
|
145
159
|
- ".gitignore"
|
|
146
|
-
- ".travis.yml"
|
|
147
160
|
- AUTHORS
|
|
148
161
|
- ChangeLog
|
|
149
162
|
- Gemfile
|
|
@@ -165,7 +178,6 @@ homepage: https://github.com/fluent/fluent-plugin-mongo
|
|
|
165
178
|
licenses:
|
|
166
179
|
- Apache-2.0
|
|
167
180
|
metadata: {}
|
|
168
|
-
post_install_message:
|
|
169
181
|
rdoc_options: []
|
|
170
182
|
require_paths:
|
|
171
183
|
- lib
|
|
@@ -180,8 +192,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
180
192
|
- !ruby/object:Gem::Version
|
|
181
193
|
version: '0'
|
|
182
194
|
requirements: []
|
|
183
|
-
rubygems_version:
|
|
184
|
-
signing_key:
|
|
195
|
+
rubygems_version: 4.0.3
|
|
185
196
|
specification_version: 4
|
|
186
197
|
summary: MongoDB plugin for Fluentd
|
|
187
|
-
test_files:
|
|
198
|
+
test_files:
|
|
199
|
+
- test/helper.rb
|
|
200
|
+
- test/plugin/test_in_mongo_tail.rb
|
|
201
|
+
- test/plugin/test_out_mongo.rb
|
|
202
|
+
- test/plugin/test_out_mongo_replset.rb
|