Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit bb791a5

Browse files
authored
Merge pull request #4 from PerimeterX/dev-cass-3
Cassandra 3 compatibility
2 parents 114cfab + bb5629c commit bb791a5

File tree

6 files changed

+5
-8
lines changed

6 files changed

+5
-8
lines changed

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ Contributors:
66
* Elad Amit (eladamitpxi, amitelad7)
77
* Valentin Fischer (valentinul)
88
* tansinee
9+
* Pitsanu Swangpheaw (roongr2k7)

lib/logstash/outputs/cassandra/event_parser.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ def convert_value_to_cassandra_type(event_data, cassandra_type)
122122
return ::Cassandra::Types::Inet.new(event_data)
123123
when 'float'
124124
return ::Cassandra::Types::Float.new(event_data)
125-
when 'varchar'
126-
return ::Cassandra::Types::Varchar.new(event_data)
127125
when 'text'
128126
return ::Cassandra::Types::Text.new(event_data)
129127
when 'blob'

logstash-output-cassandra.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |s|
22

33
s.name = 'logstash-output-cassandra'
4-
s.version = '0.9.2'
4+
s.version = '1.0.0'
55
s.licenses = [ 'Apache License (2.0)' ]
66
s.summary = 'Store events into Cassandra'
77
s.description = 'This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program'
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
2121
# Gem dependencies
2222
s.add_runtime_dependency 'concurrent-ruby'
2323
s.add_runtime_dependency 'logstash-core', '>= 2.0.0', '< 3.0.0'
24-
s.add_runtime_dependency 'cassandra-driver', '>= 2.0.0', '< 3.0.0'
24+
s.add_runtime_dependency 'cassandra-driver', '>= 3.0.0'
2525
s.add_development_dependency 'cabin', ['~> 0.6']
2626
s.add_development_dependency 'longshoreman'
2727
s.add_development_dependency 'logstash-devutils'

spec/integration/outputs/cassandra_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def assert_proper_insert(type_to_test)
8686
{ type: 'timestamp', value: 1457606758, assert_override: Helper::get_assert_timestamp_equallity() },
8787
{ type: 'inet', value: '192.168.99.100' },
8888
{ type: 'float', value: '10.050000190734863' },
89-
{ type: 'varchar', value: 'some chars' },
9089
{ type: 'text', value: 'some text' },
9190
{ type: 'blob', value: 'a blob' },
9291
{ type: 'ascii', value: 'some ascii' },

spec/integration/outputs/integration_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
CONTAINER_NAME = "logstash-output-cassandra-#{rand(999).to_s}"
77
CONTAINER_IMAGE = 'cassandra'
8-
CONTAINER_TAG = '2.2'
8+
CONTAINER_TAG = '3'
99

1010
module CassandraHelper
1111
def get_host_ip

spec/unit/outputs/event_parser_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@
108108
{ :name => 'timestamp', :type => ::Cassandra::Types::Timestamp, :value => 1457606758, expected: Time.at(1457606758) },
109109
{ :name => 'inet', :type => ::Cassandra::Types::Inet, :value => '0.0.0.0' },
110110
{ :name => 'float', :type => ::Cassandra::Types::Float, :value => '10.15' },
111-
{ :name => 'varchar', :type => ::Cassandra::Types::Varchar, :value => 'a varchar' },
112111
{ :name => 'text', :type => ::Cassandra::Types::Text, :value => 'some text' },
113112
{ :name => 'blob', :type => ::Cassandra::Types::Blob, :value => '12345678' },
114113
{ :name => 'ascii', :type => ::Cassandra::Types::Ascii, :value => 'some ascii' },
@@ -261,7 +260,7 @@
261260

262261
describe 'ignore_bad_values is turned on' do
263262
[
264-
{ :name => 'timestamp', :value => 'i dont have to_time', :expected => Time::parse('1970-01-01 00:00:00 +0000') },
263+
{ :name => 'timestamp', :value => 'i dont have to_time', :expected => Time::parse('1970-01-01 00:00:00 +0000').localtime },
265264
{ :name => 'inet', :value => 'i am not an inet address', :expected => '0.0.0.0' },
266265
{ :name => 'float', :value => 'i am not a float', :expected => 0.0 },
267266
{ :name => 'bigint', :value => 'i am not a bigint', :expected => 0 },

0 commit comments

Comments
 (0)