fluent-plugin-cassandra-driver 0.0.3 → 0.0.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fa9360ff49643779a0c39ebc9813f1b5582ab74
|
4
|
+
data.tar.gz: 84a6538140f206f4747d0358cbb57eb48280da75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19f7040421c7df0c07b314be0d92341f63d13c394ff9cbc79c5d2e50ae304309fed6230f1723fe709fd9ab7940d9083f01204a9b31ddf60e86b560efdfaa5c22
|
7
|
+
data.tar.gz: 4f2ad26f097e0f793ed565e37951e72cab35d140cf34a59fd8dd251c194cb0efbe87d058e221304d1f343370b2d276f58d05ea68ce500b058397579ee6b2f402
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: fluent-plugin-cassandra-driver 0.0.
|
5
|
+
# stub: fluent-plugin-cassandra-driver 0.0.4 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "fluent-plugin-cassandra-driver".freeze
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.4"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
@@ -27,8 +27,6 @@ Gem::Specification.new do |s|
|
|
27
27
|
"Rakefile",
|
28
28
|
"VERSION",
|
29
29
|
"fluent-plugin-cassandra-driver.gemspec",
|
30
|
-
"lib/fluent/plugin/mutators/string_mutator.rb",
|
31
|
-
"lib/fluent/plugin/mutators/timeuuid_mutator.rb",
|
32
30
|
"lib/fluent/plugin/out_cassandra_driver.rb",
|
33
31
|
"spec/spec.opts",
|
34
32
|
"spec/spec_helper.rb"
|
@@ -78,8 +78,6 @@ module Fluent
|
|
78
78
|
|
79
79
|
private
|
80
80
|
|
81
|
-
@mutators_map = {:string => ::CassandraDriver::StringMutator.new, :timeuuid => ::CassandraDriver::TimeuuidMutator.new}
|
82
|
-
|
83
81
|
def get_session(hosts, keyspace)
|
84
82
|
cluster = ::Cassandra.cluster(hosts: hosts)
|
85
83
|
|
@@ -90,9 +88,16 @@ module Fluent
|
|
90
88
|
values = data_keys.map.with_index do |key, index|
|
91
89
|
value = pop_data_keys ? record.delete(key) : record[key]
|
92
90
|
type = self.schema[schema_keys[index]]
|
93
|
-
mutator = @mutators_map.key?(type) ? @mutators_map[type] : nil
|
94
91
|
|
95
|
-
|
92
|
+
case type
|
93
|
+
when :string
|
94
|
+
value = "'#{value}'"
|
95
|
+
when :timeuuid
|
96
|
+
value = Cassandra::Uuid::Generator.new.at(value).to_s
|
97
|
+
else
|
98
|
+
end
|
99
|
+
|
100
|
+
value
|
96
101
|
end
|
97
102
|
|
98
103
|
# if we have one more schema key than data keys,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-cassandra-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yaroslav Lukyanov
|
@@ -125,8 +125,6 @@ files:
|
|
125
125
|
- Rakefile
|
126
126
|
- VERSION
|
127
127
|
- fluent-plugin-cassandra-driver.gemspec
|
128
|
-
- lib/fluent/plugin/mutators/string_mutator.rb
|
129
|
-
- lib/fluent/plugin/mutators/timeuuid_mutator.rb
|
130
128
|
- lib/fluent/plugin/out_cassandra_driver.rb
|
131
129
|
- spec/spec.opts
|
132
130
|
- spec/spec_helper.rb
|