fluent-plugin-kafka-enchanced 0.5.23 → 0.5.24

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: f117fec2e6d0ac33b1e1d2270fd21c4013562cfa
4
- data.tar.gz: f2104f837d4df4b90d33bbccdd7528ae63e56022
3
+ metadata.gz: f35defdd99f3e6a7dba54ec745060af34b22c48d
4
+ data.tar.gz: 040094192d9236af720a90fcc8c33b20327c97b4
5
5
  SHA512:
6
- metadata.gz: e0572826643b078a4cd798c201752bedfb83320add347d8e4f833b0bb1d2cd983ffbb37375609072bc863e85933ddc3a6e4fb6ad65bf32d891a2a731623576eb
7
- data.tar.gz: 3b611cee1ae3383734f90e2c45a43dfa6ea58db9067d676363a104f4d04407ebc317bd2182682c3ceb9cd377d4d0a333ca232edc59d39f34a7b8d8d0ba8cf0fd
6
+ metadata.gz: f388fee7e2887aa1900391307e2722901bb785b749893cceefaa6bc9628d3fa469481a0b041b79c3a008fc3f03a07bd3bec485758fc9a122f62d24bf6c5bec29
7
+ data.tar.gz: 943b48a4f8dd017721d2b0510032b295cf8de6178f8fee277ed2896097d6a14b4af4332509aefa113d4bdedf62f8aa2379b5099f787bef0f2e9d7fbe8eaa78b9
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
12
12
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
13
  gem.name = "fluent-plugin-kafka-enchanced"
14
14
  gem.require_paths = ["lib"]
15
- gem.version = '0.5.23'
15
+ gem.version = '0.5.24'
16
16
  gem.required_ruby_version = ">= 2.1.0"
17
17
 
18
18
  gem.add_dependency "fluentd", [">= 0.10.58", "< 2"]
@@ -147,11 +147,12 @@ DESC
147
147
  require 'avro_turf/messaging'
148
148
  require "avro/builder"
149
149
  Proc.new do |tag, time, record|
150
- record = record.select{|key, value| !key.nil? && !key.empty?}.map{|k, v| [k.tr('[]-', '_').delete('$'), v.to_s.force_encoding("UTF-8")]}.to_h
150
+ record = record.select{|key, value| !key.nil? && !key.empty?}.map{|k, v| [k.tr('[]-', '_').delete('$'), (v.is_a?(String) ? v.to_s.force_encoding("UTF-8") : v)]}.to_h
151
151
  timestamp = Time.new
152
- record['enchilada_timestamp'] = timestamp.strftime('%s%3N')
152
+ record['enchilada_timestamp'] = timestamp.strftime('%s%3N').to_i
153
153
  record['enchilada_time_with_format'] = timestamp.strftime("%Y-%m-%dT%H:%M:%S.%LZ")
154
- fields = record.keys.map{|key| {'name' => key, 'type' => 'string'}}
154
+
155
+ fields = record.map{|key, value| {'name' => key, 'type' => (value.is_a?(Fixnum) ? 'int' : (value.is_a?(Float) ? 'float' : 'string'))}}
155
156
  @topic_name = schema_name = "#{tag.to_s.tr('.$:', '_')}_#{Digest::MD5.new.hexdigest(fields.to_s)[0..5]}"
156
157
  schema_json = {
157
158
  "type": "record",
@@ -159,7 +160,6 @@ DESC
159
160
  "fields": fields
160
161
  }.to_json
161
162
  schema = Avro::Schema.parse(schema_json)
162
-
163
163
  avro = AvroTurf::Messaging.new(registry_url: @schema_registry)
164
164
  avro.encode(record.map{|key, value| [key, value.to_s]}.to_h, schema: schema, subject: "#{schema_name}-value")
165
165
  end
@@ -228,3 +228,4 @@ end
228
228
 
229
229
 
230
230
 
231
+
@@ -200,11 +200,12 @@ DESC
200
200
  require 'avro_turf/messaging'
201
201
  require "avro/builder"
202
202
  Proc.new do |tag, time, record|
203
- record = record.select{|key, value| !key.nil? && !key.empty?}.map{|k, v| [k.tr('[]-', '_').delete('$'), v.to_s.force_encoding("UTF-8")]}.to_h
203
+ record = record.select{|key, value| !key.nil? && !key.empty?}.map{|k, v| [k.tr('[]-', '_').delete('$'), (v.is_a?(String) ? v.to_s.force_encoding("UTF-8") : v)]}.to_h
204
204
  timestamp = Time.new
205
- record['enchilada_timestamp'] = timestamp.strftime('%s%3N')
205
+ record['enchilada_timestamp'] = timestamp.strftime('%s%3N').to_i
206
206
  record['enchilada_time_with_format'] = timestamp.strftime("%Y-%m-%dT%H:%M:%S.%LZ")
207
- fields = record.keys.map{|key| {'name' => key, 'type' => 'string'}}
207
+
208
+ fields = record.map{|key, value| {'name' => key, 'type' => (value.is_a?(Fixnum) ? 'int' : (value.is_a?(Float) ? 'float' : 'string'))}}
208
209
  @topic_name = schema_name = "#{tag.to_s.tr('.$:', '_')}_#{Digest::MD5.new.hexdigest(fields.to_s)[0..5]}"
209
210
  schema_json = {
210
211
  "type": "record",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-kafka-enchanced
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.23
4
+ version: 0.5.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paschenko Konstantin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-10 00:00:00.000000000 Z
11
+ date: 2017-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd