fluent-plugin-output-solr 1.0.2 → 1.0.3

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: 83c3ee7ee757f55da3c9605b0c292d31cb41ca97
4
- data.tar.gz: f01b0a4f320facb257e530772b5798ce38aa1c63
3
+ metadata.gz: a845a3fa9e869020162f98d77bcc3860a55b63b1
4
+ data.tar.gz: 0f29bfb48fac961ae1fd4c9ac48b3adcb9bf2aa3
5
5
  SHA512:
6
- metadata.gz: 5e957af523348177ef465b00f33762e9e566229afc980bf430f7aa59b6f82a1c72d027043077e204fd7b37b2984719eba055b2f7c2457795662570272a92707f
7
- data.tar.gz: 820719027d5dfe43a39d8ed9771a3d069b15ed151d316db2172df5c1c8840798ee10de3be569b85620dc6e55922b06e7cfc7bf5e1cae4bfd2850fb9b6f2e1109
6
+ metadata.gz: 286b5cf58e6123adb15066fdc5ac86779e72e1290d10d2837a451cf77f8ed61cd9a71cd5179a7cb3a61f70d9d953cf902122f80856d00338b2cf5f7e33db78c5
7
+ data.tar.gz: 4fd8ca2369b8a378c7ae53130bf71035de2eba422d8f45e05d6587266dafbc8faeb5fd81e73a22d57608b801707252c38194d1d30c60192fc6877b3172205dc9
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'fluent-plugin-output-solr'
7
- spec.version = '1.0.2'
7
+ spec.version = '1.0.3'
8
8
  spec.authors = ['Minoru Osuka']
9
9
  spec.email = ['minoru.osuka@gmail.com']
10
10
 
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_runtime_dependency 'rsolr', '~> 1.0.12'
25
25
  spec.add_runtime_dependency 'zk', '~> 1.9.5'
26
26
 
27
- spec.add_development_dependency 'bundler', '~> 1.15.1'
27
+ spec.add_development_dependency 'bundler', '~> 1.16.1'
28
28
  spec.add_development_dependency 'rake', '~> 11.1.2'
29
29
  spec.add_development_dependency 'test-unit', '~> 3.1.5'
30
30
  spec.add_development_dependency 'minitest', '~> 5.8.3'
@@ -93,6 +93,12 @@ module Fluent::Plugin
93
93
  cloud_connection = RSolr::Cloud::Connection.new(@zk)
94
94
  @solr = RSolr::Client.new(cloud_connection, read_timeout: 60, open_timeout: 60)
95
95
  end
96
+
97
+ # Get unique key field from Solr
98
+ @unique_key = get_unique_key
99
+
100
+ # Get fields from Solr
101
+ @fields = get_fields
96
102
  end
97
103
 
98
104
  def shutdown
@@ -118,12 +124,6 @@ module Fluent::Plugin
118
124
  def write(chunk)
119
125
  documents = []
120
126
 
121
- # Get fields from Solr
122
- fields = get_fields
123
-
124
- # Get unique key field from Solr
125
- unique_key = get_unique_key
126
-
127
127
  # Get fluentd tag
128
128
  tag = chunk.metadata.tag
129
129
 
@@ -131,8 +131,8 @@ module Fluent::Plugin
131
131
  record = inject_values_to_record(tag, time, record)
132
132
 
133
133
  # Set unique key and value
134
- unless record.has_key?(unique_key) then
135
- record.merge!({unique_key => SecureRandom.uuid})
134
+ unless record.has_key?(@unique_key) then
135
+ record.merge!({@unique_key => SecureRandom.uuid})
136
136
  end
137
137
 
138
138
  # Set Fluentd tag to Solr tag field
@@ -159,7 +159,7 @@ module Fluent::Plugin
159
159
  # Ignore undefined fields
160
160
  if @ignore_undefined_fields then
161
161
  record.each_key do |key|
162
- unless fields.include?(key) then
162
+ unless @fields.include?(key) then
163
163
  record.delete(key)
164
164
  end
165
165
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-output-solr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Minoru Osuka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-25 00:00:00.000000000 Z
11
+ date: 2018-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: 1.15.1
81
+ version: 1.16.1
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: 1.15.1
88
+ version: 1.16.1
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: rake
91
91
  requirement: !ruby/object:Gem::Requirement