fluent-plugin-cassandra-json 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/fluent-plugin-cassandra-json.gemspec +1 -1
- data/lib/fluent/plugin/out_cassandra_json.rb +7 -3
- data/test/plugin/test_out_cassandra_json.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 124d011ac7e9cef45d13531d991010f90583bc7d121ec8dcfa0ef48997582aa0
|
4
|
+
data.tar.gz: 46ea571783aee03416d936d992673869fa117e4fbefc14616c636560f0cd536e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a138f83bf458a88754680f515a28631984b5f44b2fdea011a270a4c1a57df4c02fdff4f0b6782b4a5c669b4071bd11abcf6996c7edd515ca00ef586d00bc4bc
|
7
|
+
data.tar.gz: bd7aa50cbf401906f39d4b0bdfad226d59022cdb122c87211a270998bead1e802df59ec7ccb8d35c5aa4779b7b8a4490b096bea1821f28415bbf3d29ad0266df
|
data/README.md
CHANGED
@@ -83,6 +83,10 @@ Use IF NOT EXIST option on INSERT
|
|
83
83
|
|
84
84
|
Use TTL option on INSERT
|
85
85
|
|
86
|
+
### idempotent (bool) (optional)
|
87
|
+
|
88
|
+
Specify whether this statement can be retried safely on timeout
|
89
|
+
|
86
90
|
### skip_invalid_rows (bool) (optional)
|
87
91
|
|
88
92
|
Treat request as success, even if invalid rows exist
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = "fluent-plugin-cassandra-json"
|
6
|
-
spec.version = "0.1.
|
6
|
+
spec.version = "0.1.3"
|
7
7
|
spec.authors = ["joker1007"]
|
8
8
|
spec.email = ["kakyoin.hierophant@gmail.com"]
|
9
9
|
|
@@ -48,6 +48,8 @@ module Fluent
|
|
48
48
|
desc: "Use IF NOT EXIST option on INSERT"
|
49
49
|
config_param :ttl, :integer, default: nil,
|
50
50
|
desc: "Use TTL option on INSERT"
|
51
|
+
config_param :idempotent, :bool, default: false,
|
52
|
+
desc: "Specify whether this statement can be retried safely on timeout"
|
51
53
|
|
52
54
|
config_param :skip_invalid_rows, :bool, default: true,
|
53
55
|
desc: "Treat request as success, even if invalid rows exist"
|
@@ -76,13 +78,15 @@ module Fluent
|
|
76
78
|
super
|
77
79
|
|
78
80
|
@cluster = Cassandra.cluster(@cluster_options)
|
79
|
-
|
81
|
+
end
|
82
|
+
|
83
|
+
def session
|
84
|
+
Thread.current[:session] ||= @cluster.connect(@keyspace)
|
80
85
|
end
|
81
86
|
|
82
87
|
def close
|
83
88
|
super
|
84
89
|
|
85
|
-
@session.close
|
86
90
|
@cluster.close
|
87
91
|
end
|
88
92
|
|
@@ -110,7 +114,7 @@ module Fluent
|
|
110
114
|
cql << " IF NOT EXISTS" if @if_not_exists
|
111
115
|
cql << " USING TTL #{@ttl}" if @ttl && @ttl > 0
|
112
116
|
@log.debug(cql)
|
113
|
-
future =
|
117
|
+
future = session.execute_async(cql, consistency: @consistency, idempotent: @idempotent)
|
114
118
|
future.on_failure do |error|
|
115
119
|
if @skip_invalid_rows
|
116
120
|
@log.warn("failed to insert", record: line, error: error)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-cassandra-json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joker1007
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.7.
|
140
|
+
rubygems_version: 2.7.7
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Insert data to cassandra plugin for fluentd (Use INSERT JSON).
|