fluent-plugin-td 0.10.24 → 0.10.25

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: 46404732e76417f2f5110a8f97a219935c3c653c
4
- data.tar.gz: ae4a4ba457f7c7bd5097fa37a9cc955bd02914bd
3
+ metadata.gz: a1db60dd2b0ce33a5752790d6f586c86ecf5d5d1
4
+ data.tar.gz: 860714c30461e7bd0904b91355eba1c35571e212
5
5
  SHA512:
6
- metadata.gz: e9812f2997140c7470641d82666ec59ec4bae779fb435f24fca1a821e0bdcb67184a0151b93e92cd130045b1223a352e96fe4d553e2017a3ea787e963f91c1b6
7
- data.tar.gz: e332f546b28efe2446b7d820fe1f1fd9e74dd32bf2661c80640677b963fa194acba041e3597b22ef38fd91c4b14e2e0811f0d280c498fd64c0dd860cd512dc60
6
+ metadata.gz: 0b7a4e3c95a2180751bde7ae165f4e278aeb961907c16081fc6fba460b92841810dc1c3f5f1fe4b8b1a3c82e71bfc82558eb78121c0c98bc63bdf397549f4a40
7
+ data.tar.gz: cc08c575896bc7eb8361ee283391ae71db9e1a6dc3b6820d0327098c2c0347ad0e977a0d5044c7ce428d1dfac0d9865c83aae7828535cbef70e9e1016243f662
data/.travis.yml CHANGED
@@ -5,5 +5,6 @@ rvm:
5
5
 
6
6
  gemfile:
7
7
  - Gemfile
8
+ - Gemfile.msgpack.0.4
8
9
 
9
10
  script: bundle exec rake test
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ Release 0.10.25 - 2015/02/06
2
+
3
+ * Improve tempfile handling
4
+ * Fix Bigint handling to prevent broken msgpack stream
5
+
6
+
1
7
  Release 0.10.24 - 2015/02/05
2
8
 
3
9
  * Change log level and message when a broken record is skipped to make it clear that it is skipped
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org/'
2
+
3
+ gem 'msgpack', '= 0.4.7'
4
+ gem 'fluentd', '~> 0.10.55'
5
+ gemspec
@@ -216,6 +216,8 @@ module Fluent
216
216
  begin
217
217
  record.to_msgpack(out)
218
218
  rescue RangeError
219
+ # In msgpack v0.5, 'out' becomes String, not Buffer. This is not a problem because Buffer has a compatibility with String
220
+ out = out.to_s[0, off]
219
221
  TreasureData::API.normalized_msgpack(record, out)
220
222
  end
221
223
 
@@ -245,7 +247,7 @@ module Fluent
245
247
  database, table = chunk.key.split('.', 2)
246
248
 
247
249
  FileUtils.mkdir_p(@tmpdir) unless @tmpdir.nil?
248
- f = Tempfile.new("tdlog-", @tmpdir)
250
+ f = Tempfile.new("tdlog-#{chunk.key}-", @tmpdir)
249
251
  w = Zlib::GzipWriter.new(f)
250
252
 
251
253
  chunk.write_to(w)
@@ -258,7 +260,7 @@ module Fluent
258
260
 
259
261
  ensure
260
262
  w.close if w
261
- f.close if f
263
+ f.close(true) if f
262
264
  end
263
265
 
264
266
  def upload(database, table, io, size, unique_id)
@@ -1,5 +1,5 @@
1
1
  module Fluent
2
2
  module TreasureDataPlugin
3
- VERSION = '0.10.24'
3
+ VERSION = '0.10.25'
4
4
  end
5
5
  end
@@ -1,5 +1,6 @@
1
1
  require 'fluent/test'
2
2
  require 'fluent/plugin/out_tdlog'
3
+ require 'test_helper.rb'
3
4
 
4
5
  class TreasureDataLogOutputTest < Test::Unit::TestCase
5
6
  # BufferedOutputTestDriver uses module_eval, not inheritance.
@@ -75,6 +76,25 @@ class TreasureDataLogOutputTest < Test::Unit::TestCase
75
76
  }, 'nil record should be skipped'
76
77
  end
77
78
 
79
+ def test_emit_with_bigint_record
80
+ n = 100000000000000000000000
81
+ d = create_driver
82
+ time, records = stub_seed_values
83
+ records[1]['k'] = ['hogehoge' * 1000]
84
+ records[1]['kk'] = n.to_s # bigint is converted to string
85
+ database, table = d.instance.instance_variable_get(:@key).split(".", 2)
86
+ stub_td_table_create_request(database, table)
87
+ stub_td_import_request(stub_request_body(records, time), database, table)
88
+
89
+ test_time, test_records = stub_seed_values
90
+ test_records[1]['k'] = ['hogehoge' * 1000]
91
+ test_records[1]['kk'] = n
92
+ test_records.each { |record|
93
+ d.emit(record, test_time)
94
+ }
95
+ d.run
96
+ end
97
+
78
98
  def test_emit_with_time_symbole
79
99
  d = create_driver
80
100
  time, records = stub_seed_values
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-td
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.24
4
+ version: 0.10.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Treasure Data, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-04 00:00:00.000000000 Z
11
+ date: 2015-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -83,6 +83,7 @@ files:
83
83
  - AUTHORS
84
84
  - ChangeLog
85
85
  - Gemfile
86
+ - Gemfile.msgpack.0.4
86
87
  - README.rdoc
87
88
  - Rakefile
88
89
  - example.conf