cassandra-driver 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZjdmNmQxODlhMTcwZjMyMmU3N2Y4NWFhMmU4Y2NkNThiMTE5MmFiYw==
5
- data.tar.gz: !binary |-
6
- MzAzNzNjMmZiZDgyMDgzNjM3ZDllOWE0MDg0YzRlZDc5NDEwY2ViZA==
2
+ SHA1:
3
+ metadata.gz: e1b5e23c6268565e84412e6d619c2bb80793b1a4
4
+ data.tar.gz: 72d07dc35f8834d15d53720c1bdddabc62f94d03
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MGUxNTIzZjc1ZWUxMTMwYjYxN2QwYjM5ZGRkZDY1YzdkZWRjYzQ1MDRkOTAx
10
- Nzk5NjI5ODMxYWM3MWEzZmQ2NWM2YmQ3NWRkYzI2ZWRkMjhmMTMzMTIxYjY0
11
- ODAyYjQxYjg5ZTE0MTZiNjc4NWM3Y2NmODZjNGM3NzM4MWMyNTQ=
12
- data.tar.gz: !binary |-
13
- NjZkOWZjYzdiM2IyYmU3YWVmOGNhODk0MjA3NWZlYzhjOGUxN2RhOTgzZGZm
14
- YmM3NTFhYTA1YjQ1ZTY2MzJmOGQ3MzI3NGVkYzRjZDA5YmU1N2ZlODg2ZDI2
15
- ZGY5MmI4MjcyYmI5NTRkOTA3NmI2OGFiNjc4MTY5ZjY4YTU0YjA=
6
+ metadata.gz: a6981ebeea62b7448aac6a522c74703678249435eda440f6ba368d5426a5d66fe53bc8059a975e141e187c152db90ff171d1359b1947334f786990daacb3808d
7
+ data.tar.gz: 0b1d48e7d85c5170069733d6932586ed418bd4d1c18d67180ece0d4740dea23953b666557aba6c818b4945415491babcbb568a86f2549651a2b3879312860b0c
data/README.md CHANGED
@@ -93,7 +93,7 @@ __Note__: if you want to use compression you should also install [snappy](http:/
93
93
 
94
94
  Some of the new features added to the driver have unfortunately led to changes in the original cql-rb API. In the examples directory, you can find [an example of how to wrap the ruby driver to achieve almost complete interface parity with cql-rb](https://github.com/datastax/ruby-driver/blob/master/examples/cql-rb-wrapper.rb) to assist you with gradual upgrade.
95
95
 
96
- ## What's new in v2.0.0
96
+ ## What's new in v2.0.1
97
97
 
98
98
  Current release lays groundwork for the upcoming support of native protocol v3 and Apache Cassandra 2.1. This release introduces the following major public API changes:
99
99
 
@@ -1,3 +1,4 @@
1
+ #--
1
2
  # Copyright 2013-2014 DataStax, Inc.
2
3
  #
3
4
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,3 +1,4 @@
1
+ #--
1
2
  # Copyright 2013-2014 DataStax, Inc.
2
3
  #
3
4
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -187,7 +187,9 @@ module Cassandra
187
187
  end
188
188
 
189
189
  def read_type_v1(buffer)
190
- case buffer.read_unsigned_short
190
+ kind = buffer.read_unsigned_short
191
+
192
+ case kind
191
193
  when 0x0000 then [:custom, buffer.read_string]
192
194
  when 0x0001 then :ascii
193
195
  when 0x0002 then :bigint
@@ -209,7 +211,7 @@ module Cassandra
209
211
  when 0x0021 then [:map, read_type_v1(buffer), read_type_v1(buffer)]
210
212
  when 0x0022 then [:set, read_type_v1(buffer)]
211
213
  else
212
- raise Errors::DecodingError, %(Unsupported column type: #{id})
214
+ raise Errors::DecodingError, %(Unsupported column type: #{kind})
213
215
  end
214
216
  end
215
217
 
@@ -18,6 +18,7 @@
18
18
 
19
19
  module Cassandra
20
20
  module Protocol
21
+ # @private
21
22
  module V1
22
23
  class Encoder
23
24
  HEADER_FORMAT = 'c4N'.freeze
@@ -68,11 +69,9 @@ module Cassandra
68
69
  READY = ReadyResponse.new
69
70
 
70
71
  def decode_header(buffer)
71
- loop do
72
- buffer_length = buffer.length
73
-
74
- return if buffer_length < 8
72
+ buffer_length = buffer.length
75
73
 
74
+ while buffer_length >= 8
76
75
  frame_header = buffer.read_int
77
76
  frame_length = buffer.read_int
78
77
 
@@ -85,23 +84,22 @@ module Cassandra
85
84
  end
86
85
 
87
86
  actual_decode(buffer, frame_header, frame_length)
87
+ buffer_length = buffer.length
88
88
  end
89
89
 
90
90
  nil
91
91
  end
92
92
 
93
93
  def decode_body(buffer)
94
- frame_header = @header
95
- frame_length = @length
96
-
97
- loop do
98
- buffer_length = buffer.length
99
-
100
- return if buffer_length < frame_length
94
+ frame_header = @header
95
+ frame_length = @length
96
+ buffer_length = buffer.length
101
97
 
98
+ until buffer_length < frame_length
102
99
  actual_decode(buffer, frame_header, frame_length)
100
+ buffer_length = buffer.length
103
101
 
104
- if (buffer_length - frame_length) < 8
102
+ if buffer_length < 8
105
103
  @header = nil
106
104
  @length = nil
107
105
  @state = :header
@@ -109,8 +107,9 @@ module Cassandra
109
107
  return
110
108
  end
111
109
 
112
- frame_header = buffer.read_int
113
- frame_length = buffer.read_int
110
+ frame_header = buffer.read_int
111
+ frame_length = buffer.read_int
112
+ buffer_length -= 8
114
113
  end
115
114
 
116
115
  @header = frame_header
@@ -17,5 +17,5 @@
17
17
  #++
18
18
 
19
19
  module Cassandra
20
- VERSION = '2.0.0'.freeze
20
+ VERSION = '2.0.1'.freeze
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cassandra-driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theo Hultberg
@@ -9,48 +9,48 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-22 00:00:00.000000000 Z
12
+ date: 2015-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ione
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
20
  version: '1.2'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ~>
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '1.2'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ~>
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
34
  version: '1.6'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ~>
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: '1.6'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ~>
46
+ - - "~>"
47
47
  - !ruby/object:Gem::Version
48
48
  version: '10.0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ~>
53
+ - - "~>"
54
54
  - !ruby/object:Gem::Version
55
55
  version: '10.0'
56
56
  description: A pure Ruby driver for Apache Cassandra
@@ -63,7 +63,7 @@ extensions:
63
63
  extra_rdoc_files:
64
64
  - README.md
65
65
  files:
66
- - .yardopts
66
+ - ".yardopts"
67
67
  - README.md
68
68
  - ext/cassandra_murmur3/cassandra_murmur3.c
69
69
  - ext/cassandra_murmur3/extconf.rb
@@ -184,26 +184,26 @@ licenses:
184
184
  metadata: {}
185
185
  post_install_message:
186
186
  rdoc_options:
187
- - --title
187
+ - "--title"
188
188
  - Datastax Ruby Driver
189
- - --main
189
+ - "--main"
190
190
  - README.md
191
- - --line-numbers
191
+ - "--line-numbers"
192
192
  require_paths:
193
193
  - lib
194
194
  required_ruby_version: !ruby/object:Gem::Requirement
195
195
  requirements:
196
- - - ! '>='
196
+ - - ">="
197
197
  - !ruby/object:Gem::Version
198
198
  version: 1.9.3
199
199
  required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  requirements:
201
- - - ! '>='
201
+ - - ">="
202
202
  - !ruby/object:Gem::Version
203
203
  version: '0'
204
204
  requirements: []
205
205
  rubyforge_project:
206
- rubygems_version: 2.4.2
206
+ rubygems_version: 2.2.2
207
207
  signing_key:
208
208
  specification_version: 4
209
209
  summary: Datastax Ruby Driver for Apache Cassandra