cassandra 0.7 → 0.7.1

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.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.7.1 update thrift-generated code to 0.5
2
+
1
3
  v0.7 Various improvements.
2
4
  - Compatibility with Cassandra 0.5.
3
5
  - performance improvements
data/cassandra.gemspec CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{cassandra}
5
- s.version = "0.7"
5
+ s.version = "0.7.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0.8") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Evan Weaver"]
9
9
  s.cert_chain = ["/Users/ryan/.gemkeys/gem-public_cert.pem"]
10
- s.date = %q{2010-01-08}
10
+ s.date = %q{2010-01-11}
11
11
  s.default_executable = %q{cassandra_helper}
12
12
  s.description = %q{A Ruby client for the Cassandra distributed database.}
13
13
  s.email = %q{}
@@ -27,6 +27,7 @@ require 'cassandra_types'
27
27
  raise result.ire unless result.ire.nil?
28
28
  raise result.nfe unless result.nfe.nil?
29
29
  raise result.ue unless result.ue.nil?
30
+ raise result.te unless result.te.nil?
30
31
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get failed: unknown result')
31
32
  end
32
33
 
@@ -43,8 +44,8 @@ require 'cassandra_types'
43
44
  result = receive_message(Get_slice_result)
44
45
  return result.success unless result.success.nil?
45
46
  raise result.ire unless result.ire.nil?
46
- raise result.nfe unless result.nfe.nil?
47
47
  raise result.ue unless result.ue.nil?
48
+ raise result.te unless result.te.nil?
48
49
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_slice failed: unknown result')
49
50
  end
50
51
 
@@ -62,6 +63,7 @@ require 'cassandra_types'
62
63
  return result.success unless result.success.nil?
63
64
  raise result.ire unless result.ire.nil?
64
65
  raise result.ue unless result.ue.nil?
66
+ raise result.te unless result.te.nil?
65
67
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'multiget failed: unknown result')
66
68
  end
67
69
 
@@ -79,6 +81,7 @@ require 'cassandra_types'
79
81
  return result.success unless result.success.nil?
80
82
  raise result.ire unless result.ire.nil?
81
83
  raise result.ue unless result.ue.nil?
84
+ raise result.te unless result.te.nil?
82
85
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'multiget_slice failed: unknown result')
83
86
  end
84
87
 
@@ -96,11 +99,11 @@ require 'cassandra_types'
96
99
  return result.success unless result.success.nil?
97
100
  raise result.ire unless result.ire.nil?
98
101
  raise result.ue unless result.ue.nil?
102
+ raise result.te unless result.te.nil?
99
103
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_count failed: unknown result')
100
104
  end
101
105
 
102
106
  def get_key_range(keyspace, column_family, start, finish, count, consistency_level)
103
-
104
107
  send_get_key_range(keyspace, column_family, start, finish, count, consistency_level)
105
108
  return recv_get_key_range()
106
109
  end
@@ -114,9 +117,28 @@ require 'cassandra_types'
114
117
  return result.success unless result.success.nil?
115
118
  raise result.ire unless result.ire.nil?
116
119
  raise result.ue unless result.ue.nil?
120
+ raise result.te unless result.te.nil?
117
121
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_key_range failed: unknown result')
118
122
  end
119
123
 
124
+ def get_range_slice(keyspace, column_parent, predicate, start_key, finish_key, row_count, consistency_level)
125
+ send_get_range_slice(keyspace, column_parent, predicate, start_key, finish_key, row_count, consistency_level)
126
+ return recv_get_range_slice()
127
+ end
128
+
129
+ def send_get_range_slice(keyspace, column_parent, predicate, start_key, finish_key, row_count, consistency_level)
130
+ send_message('get_range_slice', Get_range_slice_args, :keyspace => keyspace, :column_parent => column_parent, :predicate => predicate, :start_key => start_key, :finish_key => finish_key, :row_count => row_count, :consistency_level => consistency_level)
131
+ end
132
+
133
+ def recv_get_range_slice()
134
+ result = receive_message(Get_range_slice_result)
135
+ return result.success unless result.success.nil?
136
+ raise result.ire unless result.ire.nil?
137
+ raise result.ue unless result.ue.nil?
138
+ raise result.te unless result.te.nil?
139
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_range_slice failed: unknown result')
140
+ end
141
+
120
142
  def insert(keyspace, key, column_path, value, timestamp, consistency_level)
121
143
  send_insert(keyspace, key, column_path, value, timestamp, consistency_level)
122
144
  recv_insert()
@@ -130,6 +152,7 @@ require 'cassandra_types'
130
152
  result = receive_message(Insert_result)
131
153
  raise result.ire unless result.ire.nil?
132
154
  raise result.ue unless result.ue.nil?
155
+ raise result.te unless result.te.nil?
133
156
  return
134
157
  end
135
158
 
@@ -146,6 +169,7 @@ require 'cassandra_types'
146
169
  result = receive_message(Batch_insert_result)
147
170
  raise result.ire unless result.ire.nil?
148
171
  raise result.ue unless result.ue.nil?
172
+ raise result.te unless result.te.nil?
149
173
  return
150
174
  end
151
175
 
@@ -162,6 +186,7 @@ require 'cassandra_types'
162
186
  result = receive_message(Remove_result)
163
187
  raise result.ire unless result.ire.nil?
164
188
  raise result.ue unless result.ue.nil?
189
+ raise result.te unless result.te.nil?
165
190
  return
166
191
  end
167
192
 
@@ -227,6 +252,8 @@ require 'cassandra_types'
227
252
  result.nfe = nfe
228
253
  rescue CassandraThrift::UnavailableException => ue
229
254
  result.ue = ue
255
+ rescue CassandraThrift::TimedOutException => te
256
+ result.te = te
230
257
  end
231
258
  write_result(result, oprot, 'get', seqid)
232
259
  end
@@ -238,10 +265,10 @@ require 'cassandra_types'
238
265
  result.success = @handler.get_slice(args.keyspace, args.key, args.column_parent, args.predicate, args.consistency_level)
239
266
  rescue CassandraThrift::InvalidRequestException => ire
240
267
  result.ire = ire
241
- rescue CassandraThrift::NotFoundException => nfe
242
- result.nfe = nfe
243
268
  rescue CassandraThrift::UnavailableException => ue
244
269
  result.ue = ue
270
+ rescue CassandraThrift::TimedOutException => te
271
+ result.te = te
245
272
  end
246
273
  write_result(result, oprot, 'get_slice', seqid)
247
274
  end
@@ -255,6 +282,8 @@ require 'cassandra_types'
255
282
  result.ire = ire
256
283
  rescue CassandraThrift::UnavailableException => ue
257
284
  result.ue = ue
285
+ rescue CassandraThrift::TimedOutException => te
286
+ result.te = te
258
287
  end
259
288
  write_result(result, oprot, 'multiget', seqid)
260
289
  end
@@ -268,6 +297,8 @@ require 'cassandra_types'
268
297
  result.ire = ire
269
298
  rescue CassandraThrift::UnavailableException => ue
270
299
  result.ue = ue
300
+ rescue CassandraThrift::TimedOutException => te
301
+ result.te = te
271
302
  end
272
303
  write_result(result, oprot, 'multiget_slice', seqid)
273
304
  end
@@ -281,6 +312,8 @@ require 'cassandra_types'
281
312
  result.ire = ire
282
313
  rescue CassandraThrift::UnavailableException => ue
283
314
  result.ue = ue
315
+ rescue CassandraThrift::TimedOutException => te
316
+ result.te = te
284
317
  end
285
318
  write_result(result, oprot, 'get_count', seqid)
286
319
  end
@@ -294,10 +327,27 @@ require 'cassandra_types'
294
327
  result.ire = ire
295
328
  rescue CassandraThrift::UnavailableException => ue
296
329
  result.ue = ue
330
+ rescue CassandraThrift::TimedOutException => te
331
+ result.te = te
297
332
  end
298
333
  write_result(result, oprot, 'get_key_range', seqid)
299
334
  end
300
335
 
336
+ def process_get_range_slice(seqid, iprot, oprot)
337
+ args = read_args(iprot, Get_range_slice_args)
338
+ result = Get_range_slice_result.new()
339
+ begin
340
+ result.success = @handler.get_range_slice(args.keyspace, args.column_parent, args.predicate, args.start_key, args.finish_key, args.row_count, args.consistency_level)
341
+ rescue CassandraThrift::InvalidRequestException => ire
342
+ result.ire = ire
343
+ rescue CassandraThrift::UnavailableException => ue
344
+ result.ue = ue
345
+ rescue CassandraThrift::TimedOutException => te
346
+ result.te = te
347
+ end
348
+ write_result(result, oprot, 'get_range_slice', seqid)
349
+ end
350
+
301
351
  def process_insert(seqid, iprot, oprot)
302
352
  args = read_args(iprot, Insert_args)
303
353
  result = Insert_result.new()
@@ -307,6 +357,8 @@ require 'cassandra_types'
307
357
  result.ire = ire
308
358
  rescue CassandraThrift::UnavailableException => ue
309
359
  result.ue = ue
360
+ rescue CassandraThrift::TimedOutException => te
361
+ result.te = te
310
362
  end
311
363
  write_result(result, oprot, 'insert', seqid)
312
364
  end
@@ -320,6 +372,8 @@ require 'cassandra_types'
320
372
  result.ire = ire
321
373
  rescue CassandraThrift::UnavailableException => ue
322
374
  result.ue = ue
375
+ rescue CassandraThrift::TimedOutException => te
376
+ result.te = te
323
377
  end
324
378
  write_result(result, oprot, 'batch_insert', seqid)
325
379
  end
@@ -333,6 +387,8 @@ require 'cassandra_types'
333
387
  result.ire = ire
334
388
  rescue CassandraThrift::UnavailableException => ue
335
389
  result.ue = ue
390
+ rescue CassandraThrift::TimedOutException => te
391
+ result.te = te
336
392
  end
337
393
  write_result(result, oprot, 'remove', seqid)
338
394
  end
@@ -397,13 +453,15 @@ require 'cassandra_types'
397
453
  IRE = 1
398
454
  NFE = 2
399
455
  UE = 3
456
+ TE = 4
400
457
 
401
- ::Thrift::Struct.field_accessor self, :success, :ire, :nfe, :ue
458
+ ::Thrift::Struct.field_accessor self, :success, :ire, :nfe, :ue, :te
402
459
  FIELDS = {
403
460
  SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => CassandraThrift::ColumnOrSuperColumn},
404
461
  IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
405
462
  NFE => {:type => ::Thrift::Types::STRUCT, :name => 'nfe', :class => CassandraThrift::NotFoundException},
406
- UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}
463
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
464
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
407
465
  }
408
466
 
409
467
  def struct_fields; FIELDS; end
@@ -444,15 +502,15 @@ require 'cassandra_types'
444
502
  include ::Thrift::Struct
445
503
  SUCCESS = 0
446
504
  IRE = 1
447
- NFE = 2
448
- UE = 3
505
+ UE = 2
506
+ TE = 3
449
507
 
450
- ::Thrift::Struct.field_accessor self, :success, :ire, :nfe, :ue
508
+ ::Thrift::Struct.field_accessor self, :success, :ire, :ue, :te
451
509
  FIELDS = {
452
510
  SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}},
453
511
  IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
454
- NFE => {:type => ::Thrift::Types::STRUCT, :name => 'nfe', :class => CassandraThrift::NotFoundException},
455
- UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}
512
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
513
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
456
514
  }
457
515
 
458
516
  def struct_fields; FIELDS; end
@@ -492,12 +550,14 @@ require 'cassandra_types'
492
550
  SUCCESS = 0
493
551
  IRE = 1
494
552
  UE = 2
553
+ TE = 3
495
554
 
496
- ::Thrift::Struct.field_accessor self, :success, :ire, :ue
555
+ ::Thrift::Struct.field_accessor self, :success, :ire, :ue, :te
497
556
  FIELDS = {
498
557
  SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}},
499
558
  IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
500
- UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}
559
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
560
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
501
561
  }
502
562
 
503
563
  def struct_fields; FIELDS; end
@@ -539,12 +599,14 @@ require 'cassandra_types'
539
599
  SUCCESS = 0
540
600
  IRE = 1
541
601
  UE = 2
602
+ TE = 3
542
603
 
543
- ::Thrift::Struct.field_accessor self, :success, :ire, :ue
604
+ ::Thrift::Struct.field_accessor self, :success, :ire, :ue, :te
544
605
  FIELDS = {
545
606
  SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}}},
546
607
  IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
547
- UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}
608
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
609
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
548
610
  }
549
611
 
550
612
  def struct_fields; FIELDS; end
@@ -584,12 +646,14 @@ require 'cassandra_types'
584
646
  SUCCESS = 0
585
647
  IRE = 1
586
648
  UE = 2
649
+ TE = 3
587
650
 
588
- ::Thrift::Struct.field_accessor self, :success, :ire, :ue
651
+ ::Thrift::Struct.field_accessor self, :success, :ire, :ue, :te
589
652
  FIELDS = {
590
653
  SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success'},
591
654
  IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
592
- UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}
655
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
656
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
593
657
  }
594
658
 
595
659
  def struct_fields; FIELDS; end
@@ -633,12 +697,67 @@ require 'cassandra_types'
633
697
  SUCCESS = 0
634
698
  IRE = 1
635
699
  UE = 2
700
+ TE = 3
636
701
 
637
- ::Thrift::Struct.field_accessor self, :success, :ire, :ue
702
+ ::Thrift::Struct.field_accessor self, :success, :ire, :ue, :te
638
703
  FIELDS = {
639
704
  SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRING}},
640
705
  IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
641
- UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}
706
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
707
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
708
+ }
709
+
710
+ def struct_fields; FIELDS; end
711
+
712
+ def validate
713
+ end
714
+
715
+ end
716
+
717
+ class Get_range_slice_args
718
+ include ::Thrift::Struct
719
+ KEYSPACE = 1
720
+ COLUMN_PARENT = 2
721
+ PREDICATE = 3
722
+ START_KEY = 4
723
+ FINISH_KEY = 5
724
+ ROW_COUNT = 6
725
+ CONSISTENCY_LEVEL = 7
726
+
727
+ ::Thrift::Struct.field_accessor self, :keyspace, :column_parent, :predicate, :start_key, :finish_key, :row_count, :consistency_level
728
+ FIELDS = {
729
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
730
+ COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent},
731
+ PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate},
732
+ START_KEY => {:type => ::Thrift::Types::STRING, :name => 'start_key', :default => %q""},
733
+ FINISH_KEY => {:type => ::Thrift::Types::STRING, :name => 'finish_key', :default => %q""},
734
+ ROW_COUNT => {:type => ::Thrift::Types::I32, :name => 'row_count', :default => 100},
735
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel}
736
+ }
737
+
738
+ def struct_fields; FIELDS; end
739
+
740
+ def validate
741
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
742
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
743
+ end
744
+ end
745
+
746
+ end
747
+
748
+ class Get_range_slice_result
749
+ include ::Thrift::Struct
750
+ SUCCESS = 0
751
+ IRE = 1
752
+ UE = 2
753
+ TE = 3
754
+
755
+ ::Thrift::Struct.field_accessor self, :success, :ire, :ue, :te
756
+ FIELDS = {
757
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::KeySlice}},
758
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
759
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
760
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
642
761
  }
643
762
 
644
763
  def struct_fields; FIELDS; end
@@ -681,11 +800,13 @@ require 'cassandra_types'
681
800
  include ::Thrift::Struct
682
801
  IRE = 1
683
802
  UE = 2
803
+ TE = 3
684
804
 
685
- ::Thrift::Struct.field_accessor self, :ire, :ue
805
+ ::Thrift::Struct.field_accessor self, :ire, :ue, :te
686
806
  FIELDS = {
687
807
  IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
688
- UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}
808
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
809
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
689
810
  }
690
811
 
691
812
  def struct_fields; FIELDS; end
@@ -724,11 +845,13 @@ require 'cassandra_types'
724
845
  include ::Thrift::Struct
725
846
  IRE = 1
726
847
  UE = 2
848
+ TE = 3
727
849
 
728
- ::Thrift::Struct.field_accessor self, :ire, :ue
850
+ ::Thrift::Struct.field_accessor self, :ire, :ue, :te
729
851
  FIELDS = {
730
852
  IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
731
- UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}
853
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
854
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
732
855
  }
733
856
 
734
857
  def struct_fields; FIELDS; end
@@ -769,11 +892,13 @@ require 'cassandra_types'
769
892
  include ::Thrift::Struct
770
893
  IRE = 1
771
894
  UE = 2
895
+ TE = 3
772
896
 
773
- ::Thrift::Struct.field_accessor self, :ire, :ue
897
+ ::Thrift::Struct.field_accessor self, :ire, :ue, :te
774
898
  FIELDS = {
775
899
  IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
776
- UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}
900
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
901
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
777
902
  }
778
903
 
779
904
  def struct_fields; FIELDS; end
@@ -7,4 +7,6 @@
7
7
  require 'cassandra_types'
8
8
 
9
9
  module CassandraThrift
10
+ VERSION = %q"0.5-beta2"
11
+
10
12
  end
@@ -10,11 +10,18 @@ module CassandraThrift
10
10
  ZERO = 0
11
11
  ONE = 1
12
12
  QUORUM = 2
13
- ALL = 3
14
- VALUE_MAP = {0 => "ZERO", 1 => "ONE", 2 => "QUORUM", 3 => "ALL"}
15
- VALID_VALUES = Set.new([ZERO, ONE, QUORUM, ALL]).freeze
13
+ DCQUORUM = 3
14
+ DCQUORUMSYNC = 4
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
18
  end
17
19
 
20
+ # Basic unit of data within a ColumnFamily.
21
+ # @param name. A column name can act both as structure (a label) or as data (like value). Regardless, the name of the column
22
+ # is used as a key to its value.
23
+ # @param value. Some data
24
+ # @param timestamp. Used to record when data was sent to be written.
18
25
  class Column
19
26
  include ::Thrift::Struct
20
27
  NAME = 1
@@ -38,6 +45,10 @@ module CassandraThrift
38
45
 
39
46
  end
40
47
 
48
+ # A named list of columns.
49
+ # @param name. see Column.name.
50
+ # @param columns. A collection of standard Columns. The columns within a super column are defined in an adhoc manner.
51
+ # Columns within a super column do not have to have matching structures (similarly named child columns).
41
52
  class SuperColumn
42
53
  include ::Thrift::Struct
43
54
  NAME = 1
@@ -58,6 +69,14 @@ module CassandraThrift
58
69
 
59
70
  end
60
71
 
72
+ # Methods for fetching rows/records from Cassandra will return either a single instance of ColumnOrSuperColumn or a list
73
+ # of ColumnOrSuperColumns (get_slice()). If you're looking up a SuperColumn (or list of SuperColumns) then the resulting
74
+ # instances of ColumnOrSuperColumn will have the requested SuperColumn in the attribute super_column. For queries resulting
75
+ # in Columns, those values will be in the attribute column. This change was made between 0.3 and 0.4 to standardize on
76
+ # single query methods that may return either a SuperColumn or Column.
77
+ #
78
+ # @param column. The Column returned by get() or get_slice().
79
+ # @param super_column. The SuperColumn returned by get() or get_slice().
61
80
  class ColumnOrSuperColumn
62
81
  include ::Thrift::Struct
63
82
  COLUMN = 1
@@ -76,6 +95,7 @@ module CassandraThrift
76
95
 
77
96
  end
78
97
 
98
+ # A specific column was requested that does not exist.
79
99
  class NotFoundException < ::Thrift::Exception
80
100
  include ::Thrift::Struct
81
101
 
@@ -90,6 +110,8 @@ module CassandraThrift
90
110
 
91
111
  end
92
112
 
113
+ # Invalid request could mean keyspace or column family does not exist, required parameters are missing, or a parameter is malformed.
114
+ # why contains an associated error message.
93
115
  class InvalidRequestException < ::Thrift::Exception
94
116
  include ::Thrift::Struct
95
117
  def initialize(message=nil)
@@ -114,6 +136,7 @@ module CassandraThrift
114
136
 
115
137
  end
116
138
 
139
+ # Not all the replicas required could be created and/or read.
117
140
  class UnavailableException < ::Thrift::Exception
118
141
  include ::Thrift::Struct
119
142
 
@@ -128,6 +151,25 @@ module CassandraThrift
128
151
 
129
152
  end
130
153
 
154
+ # RPC timeout was exceeded. either a node failed mid-operation, or load was too high, or the requested op was too large.
155
+ class TimedOutException < ::Thrift::Exception
156
+ include ::Thrift::Struct
157
+
158
+ FIELDS = {
159
+
160
+ }
161
+
162
+ def struct_fields; FIELDS; end
163
+
164
+ def validate
165
+ end
166
+
167
+ end
168
+
169
+ # ColumnParent is used when selecting groups of columns from the same ColumnFamily. In directory structure terms, imagine
170
+ # ColumnParent as ColumnPath + '/../'.
171
+ #
172
+ # See also <a href="cassandra.html#Struct_ColumnPath">ColumnPath</a>
131
173
  class ColumnParent
132
174
  include ::Thrift::Struct
133
175
  COLUMN_FAMILY = 3
@@ -147,6 +189,14 @@ module CassandraThrift
147
189
 
148
190
  end
149
191
 
192
+ # The ColumnPath is the path to a single column in Cassandra. It might make sense to think of ColumnPath and
193
+ # ColumnParent in terms of a directory structure.
194
+ #
195
+ # ColumnPath is used to looking up a single column.
196
+ #
197
+ # @param column_family. The name of the CF of the column being looked up.
198
+ # @param super_column. The super column name.
199
+ # @param column. The column name.
150
200
  class ColumnPath
151
201
  include ::Thrift::Struct
152
202
  COLUMN_FAMILY = 3
@@ -168,6 +218,20 @@ module CassandraThrift
168
218
 
169
219
  end
170
220
 
221
+ # A slice range is a structure that stores basic range, ordering and limit information for a query that will return
222
+ # multiple columns. It could be thought of as Cassandra's version of LIMIT and ORDER BY
223
+ #
224
+ # @param start. The column name to start the slice with. This attribute is not required, though there is no default value,
225
+ # and can be safely set to '', i.e., an empty byte array, to start with the first column name. Otherwise, it
226
+ # must a valid value under the rules of the Comparator defined for the given ColumnFamily.
227
+ # @param finish. The column name to stop the slice at. This attribute is not required, though there is no default value,
228
+ # and can be safely set to an empty byte array to not stop until 'count' results are seen. Otherwise, it
229
+ # must also be a value value to the ColumnFamily Comparator.
230
+ # @param reversed. Whether the results should be ordered in reversed order. Similar to ORDER BY blah DESC in SQL.
231
+ # @param count. How many keys to return. Similar to LIMIT 100 in SQL. May be arbitrarily large, but Thrift will
232
+ # materialize the whole result into memory before returning it to the client, so be aware that you may
233
+ # be better served by iterating through slices by passing the last value of one call in as the 'start'
234
+ # of the next instead of increasing 'count' arbitrarily large.
171
235
  class SliceRange
172
236
  include ::Thrift::Struct
173
237
  START = 1
@@ -194,6 +258,16 @@ module CassandraThrift
194
258
 
195
259
  end
196
260
 
261
+ # A SlicePredicate is similar to a mathematic predicate (see http://en.wikipedia.org/wiki/Predicate_(mathematical_logic)),
262
+ # which is described as "a property that the elements of a set have in common."
263
+ #
264
+ # SlicePredicate's in Cassandra are described with either a list of column_names or a SliceRange. If column_names is
265
+ # specified, slice_range is ignored.
266
+ #
267
+ # @param column_name. A list of column names to retrieve. This can be used similar to Memcached's "multi-get" feature
268
+ # to fetch N known column names. For instance, if you know you wish to fetch columns 'Joe', 'Jack',
269
+ # and 'Jim' you can pass those column names as a list to fetch all three at once.
270
+ # @param slice_range. A SliceRange describing how to range, order, and/or limit the slice.
197
271
  class SlicePredicate
198
272
  include ::Thrift::Struct
199
273
  COLUMN_NAMES = 1
@@ -212,4 +286,29 @@ module CassandraThrift
212
286
 
213
287
  end
214
288
 
289
+ # A KeySlice is key followed by the data it maps to. A collection of KeySlice is returned by the get_range_slice operation.
290
+ #
291
+ # @param key. a row key
292
+ # @param columns. List of data represented by the key. Typically, the list is pared down to only the columns specified by
293
+ # a SlicePredicate.
294
+ class KeySlice
295
+ include ::Thrift::Struct
296
+ KEY = 1
297
+ COLUMNS = 2
298
+
299
+ ::Thrift::Struct.field_accessor self, :key, :columns
300
+ FIELDS = {
301
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
302
+ COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}}
303
+ }
304
+
305
+ def struct_fields; FIELDS; end
306
+
307
+ def validate
308
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key
309
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns
310
+ end
311
+
312
+ end
313
+
215
314
  end
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- g~�t�DS�{�憟ٚ+��^��!���>5G�}B��*���6�ڠ��]����*�b��%7�+�`66���c�H��V�?�M�enڌ� ��6��#�,�[7
2
- ��DM�p�L�0/�e��m/�n)곜�0*�f�l���(E.�<�?��᮱����N��*<��]�ZI��* �(%�y��#���\ME���2�U)Q��{��}1O-�-Lq9^
1
+ Ta
2
+ x&Vt�`gj=�Ӌ��w�����]�'-Ot ���ui�T"XK���2:b,#�hYl��M�^������BO�Ϭn����ϫIг�9Bd F�K��H$�p�GA��>.��.��Nhh��ۜJD:3
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"
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Weaver
@@ -30,7 +30,7 @@ cert_chain:
30
30
  zyKMYVRO0z/58g==
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2010-01-08 00:00:00 -08:00
33
+ date: 2010-01-11 00:00:00 -08:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file