cassandra-driver 2.0.0-java → 2.0.1-java

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: ac564e933a3a1b1d04c14f96afa1ac994b458791
4
- data.tar.gz: 3b1dcfad7d8ef21c9aa36636315a7cb04c881c6b
3
+ metadata.gz: e7d782a7b9279adb3048c9016528c985711a1ff8
4
+ data.tar.gz: 7d34349798d149e436b0b15cd091cb5f843b100a
5
5
  SHA512:
6
- metadata.gz: e74e1b2f03f7b3c5d144018e5d50c290894369c01ee9d57afc072d1a75aed0a248bc931b56c941263ec754fb00e82c9d5ae024908ab00209b06eff30149d8a57
7
- data.tar.gz: 09f253218bf4355dba7c321565124800cdef73b3c764aa84d51f09b21f270c9cbe971c9b7e668e4871ca1390ad6f8acd0a573c50d827665e3d6a020397a4fd4b
6
+ metadata.gz: afe2e6d1a624d68f2e5b6912a23376b604f7535cd983693cfa58529e195cff5e19f7688557231855597ccc8c83a9614a67c7465dc51cf9bf0cf1d880c9d67a33
7
+ data.tar.gz: 2ac2b96751e6af10fc3f0377d8bcf3d5a0bc8c4a17a0b57bdcee3e2e2f4942259337433978d8281ca7b359f9665eb9df2a5e6242a62ba728336a77e3dfc90bf8
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: java
6
6
  authors:
7
7
  - Theo Hultberg
@@ -9,7 +9,7 @@ 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