fluent-plugin-td 0.10.18 → 0.10.19
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 +6 -0
- data/VERSION +1 -1
- data/fluent-plugin-td.gemspec +1 -1
- data/lib/fluent/plugin/out_tditem.rb +4 -11
- data/lib/fluent/plugin/out_tdlog.rb +4 -9
- data/test/plugin/test_out_tditem.rb +8 -6
- data/test/plugin/test_out_tdlog.rb +1 -1
- data/test/test_helper.rb +2 -2
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dcb9b62fef3cddea8e7a04a917f6057f93b776e
|
4
|
+
data.tar.gz: a1555081242c872eec4b0013226309f26b1e07ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3266182b98e85d552372919ee83458d6c54ecd5bac7e32cf9f960c9c415592c660a8c8078cec22f488711117c4e88d9373c2a6a0c71c42e9a24025ca30b0064d
|
7
|
+
data.tar.gz: c57828eab6f09ace85f39a4eb7c1b7328cfbd51706864ed6d827a75a82e65bc9374d841e3be39c5b1674faf179a5e50aa3877501d04ed87c68d1b656d512dfe7
|
data/ChangeLog
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.10.
|
1
|
+
0.10.19
|
data/fluent-plugin-td.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.require_paths = ['lib']
|
18
18
|
|
19
19
|
gem.add_dependency "fluentd", "~> 0.10.27"
|
20
|
-
gem.add_dependency "td-client", "~> 0.8.
|
20
|
+
gem.add_dependency "td-client", "~> 0.8.61"
|
21
21
|
gem.add_development_dependency "rake", ">= 0.9.2"
|
22
22
|
gem.add_development_dependency "webmock", "~> 1.16"
|
23
23
|
end
|
@@ -18,12 +18,14 @@ module Fluent
|
|
18
18
|
config_param :tmpdir, :string, :default => nil
|
19
19
|
#config_param :auto_create_table, :bool, :default => true # TODO: implement if user wants this feature
|
20
20
|
|
21
|
-
config_param :endpoint, :string, :default =>
|
21
|
+
config_param :endpoint, :string, :default => TreasureData::API::NEW_DEFAULT_ENDPOINT
|
22
22
|
config_param :use_ssl, :bool, :default => true
|
23
23
|
config_param :http_proxy, :string, :default => nil
|
24
24
|
config_param :connect_timeout, :integer, :default => nil
|
25
25
|
config_param :read_timeout, :integer, :default => nil
|
26
26
|
config_param :send_timeout, :integer, :default => nil
|
27
|
+
config_set_default :buffer_type, 'file'
|
28
|
+
config_set_default :flush_interval, 300
|
27
29
|
|
28
30
|
def initialize
|
29
31
|
super
|
@@ -33,11 +35,7 @@ module Fluent
|
|
33
35
|
@key_num_limit = 1024 # Item table default limitation
|
34
36
|
@record_size_limit = 32 * 1024 * 1024 # TODO
|
35
37
|
@empty_gz_data = TreasureData::API.create_empty_gz_data
|
36
|
-
@user_agent = "fluent-plugin-td-item: 0.10.
|
37
|
-
|
38
|
-
# overwrite default configurations
|
39
|
-
@buffer_type = 'file'
|
40
|
-
@flush_interval = 300
|
38
|
+
@user_agent = "fluent-plugin-td-item: 0.10.19".freeze # TODO: automatic increment version
|
41
39
|
end
|
42
40
|
|
43
41
|
def configure(conf)
|
@@ -52,11 +50,6 @@ module Fluent
|
|
52
50
|
@key = "#{@database}.#{@table}".freeze
|
53
51
|
@use_ssl = parse_bool_parameter(@use_ssl) if @use_ssl.instance_of?(String)
|
54
52
|
FileUtils.mkdir_p(@tmpdir) unless @tmpdir.nil?
|
55
|
-
|
56
|
-
if @endpoint.nil?
|
57
|
-
$log.warn "tditem plugin will change the API endpoint from api.treasure-data.com to api.treasuredata.com"
|
58
|
-
$log.warn "If want to keep api.treasure-data.com, please set 'endpoint api.treasure-data.com' in tditem configuration"
|
59
|
-
end
|
60
53
|
end
|
61
54
|
|
62
55
|
def start
|
@@ -65,11 +65,13 @@ class TreasureDataLogOutput < BufferedOutput
|
|
65
65
|
define_method(:log) { $log }
|
66
66
|
end
|
67
67
|
|
68
|
-
config_param :endpoint, :string, :default =>
|
68
|
+
config_param :endpoint, :string, :default => TreasureData::API::NEW_DEFAULT_ENDPOINT
|
69
69
|
|
70
70
|
config_param :connect_timeout, :integer, :default => nil
|
71
71
|
config_param :read_timeout, :integer, :default => nil
|
72
72
|
config_param :send_timeout, :integer, :default => nil
|
73
|
+
config_set_default :buffer_type, 'file'
|
74
|
+
config_set_default :flush_interval, 300
|
73
75
|
|
74
76
|
def initialize
|
75
77
|
require 'fileutils'
|
@@ -91,8 +93,6 @@ class TreasureDataLogOutput < BufferedOutput
|
|
91
93
|
@table_list = {}
|
92
94
|
@auto_create_table = true
|
93
95
|
@use_ssl = true
|
94
|
-
@buffer_type = 'file' # overwrite default buffer_type
|
95
|
-
@flush_interval = 300 # overwrite default flush_interval to 5mins
|
96
96
|
@empty_gz_data = create_empty_gz_data
|
97
97
|
end
|
98
98
|
|
@@ -166,12 +166,7 @@ class TreasureDataLogOutput < BufferedOutput
|
|
166
166
|
@anonymizes = nil if @anonymizes.empty?
|
167
167
|
|
168
168
|
@http_proxy = conf['http_proxy']
|
169
|
-
@user_agent = "fluent-plugin-td: 0.10.
|
170
|
-
|
171
|
-
if @endpoint.nil?
|
172
|
-
$log.warn "tdlog plugin will change the API endpoint from api.treasure-data.com to api.treasuredata.com"
|
173
|
-
$log.warn "If want to keep api.treasure-data.com, please set 'endpoint api.treasure-data.com' in tdlog configuration"
|
174
|
-
end
|
169
|
+
@user_agent = "fluent-plugin-td: 0.10.19" # TODO: automatic increment version
|
175
170
|
end
|
176
171
|
|
177
172
|
def start
|
@@ -29,10 +29,12 @@ class TreasureDataItemOutputTest < Test::Unit::TestCase
|
|
29
29
|
def test_configure
|
30
30
|
d = create_driver
|
31
31
|
|
32
|
-
assert_equal(d.instance.apikey
|
33
|
-
assert_equal(d.instance.database
|
34
|
-
assert_equal(d.instance.table
|
35
|
-
assert_equal(d.instance.use_ssl
|
32
|
+
assert_equal('testkey', d.instance.apikey)
|
33
|
+
assert_equal('test', d.instance.database)
|
34
|
+
assert_equal('table', d.instance.table)
|
35
|
+
assert_equal(true, d.instance.use_ssl)
|
36
|
+
assert_equal('memory', d.instance.buffer_type)
|
37
|
+
assert_equal(300, d.instance.flush_interval)
|
36
38
|
end
|
37
39
|
|
38
40
|
def test_configure_with_invalid_database
|
@@ -64,7 +66,7 @@ class TreasureDataItemOutputTest < Test::Unit::TestCase
|
|
64
66
|
}
|
65
67
|
d.run
|
66
68
|
|
67
|
-
assert_equal(
|
69
|
+
assert_equal('TD1 testkey', @auth_header)
|
68
70
|
end
|
69
71
|
|
70
72
|
def test_emit
|
@@ -79,6 +81,6 @@ class TreasureDataItemOutputTest < Test::Unit::TestCase
|
|
79
81
|
}
|
80
82
|
d.run
|
81
83
|
|
82
|
-
assert_equal(
|
84
|
+
assert_equal('TD1 testkey', @auth_header)
|
83
85
|
end
|
84
86
|
end
|
data/test/test_helper.rb
CHANGED
@@ -45,7 +45,7 @@ class Test::Unit::TestCase
|
|
45
45
|
opts[:use_ssl] = true unless opts.has_key?(:use_ssl)
|
46
46
|
schema = opts[:use_ssl] ? 'https' : 'http'
|
47
47
|
response = {"database" => database, "table" => table}.to_json
|
48
|
-
endpoint = opts[:endpoint] ? opts[:endpoint] : TreasureData::API::
|
48
|
+
endpoint = opts[:endpoint] ? opts[:endpoint] : TreasureData::API::NEW_DEFAULT_ENDPOINT
|
49
49
|
|
50
50
|
url = "#{schema}://#{endpoint}/v3/table/create/#{e(database)}/#{e(table)}/log"
|
51
51
|
stub_request(:post, url).to_return(:status => 200, :body => response)
|
@@ -56,7 +56,7 @@ class Test::Unit::TestCase
|
|
56
56
|
format = opts[:format] || 'msgpack.gz'
|
57
57
|
schema = opts[:use_ssl] ? 'https' : 'http'
|
58
58
|
response = {"database" => db, "table" => table, "elapsed_time" => 0}.to_json
|
59
|
-
endpoint = opts[:endpoint] ? opts[:endpoint] : TreasureData::API::
|
59
|
+
endpoint = opts[:endpoint] ? opts[:endpoint] : TreasureData::API::NEW_DEFAULT_IMPORT_ENDPOINT
|
60
60
|
|
61
61
|
# for check_table_existence
|
62
62
|
url_with_empty = "#{schema}://#{endpoint}//v3/table/import/#{e(db)}/#{e(table)}/#{format}"
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-td
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.19
|
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: 2014-
|
11
|
+
date: 2014-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.10.27
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.10.27
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: td-client
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.8.
|
33
|
+
version: 0.8.61
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.8.
|
40
|
+
version: 0.8.61
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 0.9.2
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.9.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: webmock
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '1.16'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.16'
|
69
69
|
description: Treasure Data Cloud Data Service plugin for Fluentd
|
@@ -72,8 +72,8 @@ executables: []
|
|
72
72
|
extensions: []
|
73
73
|
extra_rdoc_files: []
|
74
74
|
files:
|
75
|
-
- .gitignore
|
76
|
-
- .travis.yml
|
75
|
+
- ".gitignore"
|
76
|
+
- ".travis.yml"
|
77
77
|
- AUTHORS
|
78
78
|
- ChangeLog
|
79
79
|
- Gemfile
|
@@ -98,17 +98,17 @@ require_paths:
|
|
98
98
|
- lib
|
99
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
|
-
- -
|
106
|
+
- - ">="
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.
|
111
|
+
rubygems_version: 2.2.2
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Treasure Data Cloud Data Service plugin for Fluentd
|