cassandra 0.7.6 → 0.8.0

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.
@@ -7,6 +7,6 @@
7
7
  require 'cassandra_types'
8
8
 
9
9
  module CassandraThrift
10
- VERSION = %q"0.5-beta2"
10
+ VERSION = %q"2.1.0"
11
11
 
12
12
  end
@@ -13,8 +13,9 @@ module CassandraThrift
13
13
  DCQUORUM = 3
14
14
  DCQUORUMSYNC = 4
15
15
  ALL = 5
16
- VALUE_MAP = {0 => "ZERO", 1 => "ONE", 2 => "QUORUM", 3 => "DCQUORUM", 4 => "DCQUORUMSYNC", 5 => "ALL"}
17
- VALID_VALUES = Set.new([ZERO, ONE, QUORUM, DCQUORUM, DCQUORUMSYNC, ALL]).freeze
16
+ ANY = 6
17
+ VALUE_MAP = {0 => "ZERO", 1 => "ONE", 2 => "QUORUM", 3 => "DCQUORUM", 4 => "DCQUORUMSYNC", 5 => "ALL", 6 => "ANY"}
18
+ VALID_VALUES = Set.new([ZERO, ONE, QUORUM, DCQUORUM, DCQUORUMSYNC, ALL, ANY]).freeze
18
19
  end
19
20
 
20
21
  # Basic unit of data within a ColumnFamily.
@@ -166,6 +167,56 @@ module CassandraThrift
166
167
 
167
168
  end
168
169
 
170
+ # invalid authentication request (user does not exist or credentials invalid)
171
+ class AuthenticationException < ::Thrift::Exception
172
+ include ::Thrift::Struct
173
+ def initialize(message=nil)
174
+ super()
175
+ self.why = message
176
+ end
177
+
178
+ def message; why end
179
+
180
+ WHY = 1
181
+
182
+ ::Thrift::Struct.field_accessor self, :why
183
+ FIELDS = {
184
+ WHY => {:type => ::Thrift::Types::STRING, :name => 'why'}
185
+ }
186
+
187
+ def struct_fields; FIELDS; end
188
+
189
+ def validate
190
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field why is unset!') unless @why
191
+ end
192
+
193
+ end
194
+
195
+ # invalid authorization request (user does not have access to keyspace)
196
+ class AuthorizationException < ::Thrift::Exception
197
+ include ::Thrift::Struct
198
+ def initialize(message=nil)
199
+ super()
200
+ self.why = message
201
+ end
202
+
203
+ def message; why end
204
+
205
+ WHY = 1
206
+
207
+ ::Thrift::Struct.field_accessor self, :why
208
+ FIELDS = {
209
+ WHY => {:type => ::Thrift::Types::STRING, :name => 'why'}
210
+ }
211
+
212
+ def struct_fields; FIELDS; end
213
+
214
+ def validate
215
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field why is unset!') unless @why
216
+ end
217
+
218
+ end
219
+
169
220
  # ColumnParent is used when selecting groups of columns from the same ColumnFamily. In directory structure terms, imagine
170
221
  # ColumnParent as ColumnPath + '/../'.
171
222
  #
@@ -286,6 +337,37 @@ module CassandraThrift
286
337
 
287
338
  end
288
339
 
340
+ # The semantics of start keys and tokens are slightly different.
341
+ # Keys are start-inclusive; tokens are start-exclusive. Token
342
+ # ranges may also wrap -- that is, the end token may be less
343
+ # than the start one. Thus, a range from keyX to keyX is a
344
+ # one-element range, but a range from tokenY to tokenY is the
345
+ # full ring.
346
+ class KeyRange
347
+ include ::Thrift::Struct
348
+ START_KEY = 1
349
+ END_KEY = 2
350
+ START_TOKEN = 3
351
+ END_TOKEN = 4
352
+ COUNT = 5
353
+
354
+ ::Thrift::Struct.field_accessor self, :start_key, :end_key, :start_token, :end_token, :count
355
+ FIELDS = {
356
+ START_KEY => {:type => ::Thrift::Types::STRING, :name => 'start_key', :optional => true},
357
+ END_KEY => {:type => ::Thrift::Types::STRING, :name => 'end_key', :optional => true},
358
+ START_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'start_token', :optional => true},
359
+ END_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'end_token', :optional => true},
360
+ COUNT => {:type => ::Thrift::Types::I32, :name => 'count', :default => 100}
361
+ }
362
+
363
+ def struct_fields; FIELDS; end
364
+
365
+ def validate
366
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field count is unset!') unless @count
367
+ end
368
+
369
+ end
370
+
289
371
  # A KeySlice is key followed by the data it maps to. A collection of KeySlice is returned by the get_range_slice operation.
290
372
  #
291
373
  # @param key. a row key
@@ -311,4 +393,87 @@ module CassandraThrift
311
393
 
312
394
  end
313
395
 
396
+ class Deletion
397
+ include ::Thrift::Struct
398
+ TIMESTAMP = 1
399
+ SUPER_COLUMN = 2
400
+ PREDICATE = 3
401
+
402
+ ::Thrift::Struct.field_accessor self, :timestamp, :super_column, :predicate
403
+ FIELDS = {
404
+ TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'},
405
+ SUPER_COLUMN => {:type => ::Thrift::Types::STRING, :name => 'super_column', :optional => true},
406
+ PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate, :optional => true}
407
+ }
408
+
409
+ def struct_fields; FIELDS; end
410
+
411
+ def validate
412
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field timestamp is unset!') unless @timestamp
413
+ end
414
+
415
+ end
416
+
417
+ # A Mutation is either an insert, represented by filling column_or_supercolumn, or a deletion, represented by filling the deletion attribute.
418
+ # @param column_or_supercolumn. An insert to a column or supercolumn
419
+ # @param deletion. A deletion of a column or supercolumn
420
+ class Mutation
421
+ include ::Thrift::Struct
422
+ COLUMN_OR_SUPERCOLUMN = 1
423
+ DELETION = 2
424
+
425
+ ::Thrift::Struct.field_accessor self, :column_or_supercolumn, :deletion
426
+ FIELDS = {
427
+ COLUMN_OR_SUPERCOLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'column_or_supercolumn', :class => CassandraThrift::ColumnOrSuperColumn, :optional => true},
428
+ DELETION => {:type => ::Thrift::Types::STRUCT, :name => 'deletion', :class => CassandraThrift::Deletion, :optional => true}
429
+ }
430
+
431
+ def struct_fields; FIELDS; end
432
+
433
+ def validate
434
+ end
435
+
436
+ end
437
+
438
+ class TokenRange
439
+ include ::Thrift::Struct
440
+ START_TOKEN = 1
441
+ END_TOKEN = 2
442
+ ENDPOINTS = 3
443
+
444
+ ::Thrift::Struct.field_accessor self, :start_token, :end_token, :endpoints
445
+ FIELDS = {
446
+ START_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'start_token'},
447
+ END_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'end_token'},
448
+ ENDPOINTS => {:type => ::Thrift::Types::LIST, :name => 'endpoints', :element => {:type => ::Thrift::Types::STRING}}
449
+ }
450
+
451
+ def struct_fields; FIELDS; end
452
+
453
+ def validate
454
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field start_token is unset!') unless @start_token
455
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field end_token is unset!') unless @end_token
456
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field endpoints is unset!') unless @endpoints
457
+ end
458
+
459
+ end
460
+
461
+ # Authentication requests can contain any data, dependent on the AuthenticationBackend used
462
+ class AuthenticationRequest
463
+ include ::Thrift::Struct
464
+ CREDENTIALS = 1
465
+
466
+ ::Thrift::Struct.field_accessor self, :credentials
467
+ FIELDS = {
468
+ CREDENTIALS => {:type => ::Thrift::Types::MAP, :name => 'credentials', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}
469
+ }
470
+
471
+ def struct_fields; FIELDS; end
472
+
473
+ def validate
474
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field credentials is unset!') unless @credentials
475
+ end
476
+
477
+ end
478
+
314
479
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cassandra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Weaver, Ryan King
@@ -30,7 +30,7 @@ cert_chain:
30
30
  zyKMYVRO0z/58g==
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2010-03-01 00:00:00 -08:00
33
+ date: 2010-03-23 00:00:00 -07:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
@@ -40,9 +40,6 @@ dependencies:
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
42
  - - ">="
43
- - !ruby/object:Gem::Version
44
- version: "0"
45
- - - "="
46
43
  - !ruby/object:Gem::Version
47
44
  version: 0.4.0
48
45
  version:
@@ -73,9 +70,6 @@ dependencies:
73
70
  version_requirements: !ruby/object:Gem::Requirement
74
71
  requirements:
75
72
  - - ">="
76
- - !ruby/object:Gem::Version
77
- version: "0"
78
- - - "="
79
73
  - !ruby/object:Gem::Version
80
74
  version: 0.1.0
81
75
  version:
@@ -126,6 +120,7 @@ files:
126
120
  - lib/cassandra/ordered_hash.rb
127
121
  - lib/cassandra/protocol.rb
128
122
  - lib/cassandra/time.rb
123
+ - test/cassandra_client_test.rb
129
124
  - test/cassandra_mock_test.rb
130
125
  - test/cassandra_test.rb
131
126
  - test/comparable_types_test.rb
@@ -169,6 +164,7 @@ signing_key:
169
164
  specification_version: 3
170
165
  summary: A Ruby client for the Cassandra distributed database.
171
166
  test_files:
167
+ - test/cassandra_client_test.rb
172
168
  - test/cassandra_mock_test.rb
173
169
  - test/cassandra_test.rb
174
170
  - test/comparable_types_test.rb
metadata.gz.sig CHANGED
@@ -1,3 +1 @@
1
- ��� �R���2 ^M/[X*�'�|H�M�(��
2
- `��)z�Av�����j��%�V� j�TV�p�E;�?�k���|� ��[���x��F����}��̉���
3
- w�xpm�5{8y�,Bc����l}������+w:����43���嵚����9A
1
+ d+��k�KQ�����a�{�c#�&����1kѪ�Ty֛�����,���t�8��'����B$�߸���֞u?��w��k�(V�N�iٮ�f��t}��T����>��Sp�����H�j����US��EA�G���s�}�K�@��"��a�R)c��ɹ�kf��k#�Cܹ�-48|��o_�����Wk���13r�'J8�b�׾#)g�c�� ��ղ���\+Q@?PY�Z�-�M� ���4D�!