cassandra 0.5.6 → 0.5.6.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.
@@ -0,0 +1,11 @@
1
+
2
+ class Time
3
+ def self.stamp
4
+ Time.now.stamp
5
+ end
6
+
7
+ def stamp
8
+ to_i * 1_000_000 + usec
9
+ end
10
+ end
11
+
@@ -0,0 +1,111 @@
1
+
2
+ class Cassandra
3
+
4
+ # UUID format version 1, as specified in RFC 4122, with jitter in place of the mac address and sequence counter.
5
+ class UUID < Comparable
6
+
7
+ class InvalidVersion < StandardError #:nodoc:
8
+ end
9
+
10
+ GREGORIAN_EPOCH_OFFSET = 0x01B2_1DD2_1381_4000 # Oct 15, 1582
11
+
12
+ VARIANT = 0b1000_0000_0000_0000
13
+
14
+ def initialize(bytes = nil)
15
+ case bytes
16
+ when self.class # UUID
17
+ @bytes = bytes.to_s
18
+ when String
19
+ case bytes.size
20
+ when 16 # Raw byte array
21
+ @bytes = bytes
22
+ when 36 # Human-readable UUID representation; inverse of #to_guid
23
+ elements = bytes.split("-")
24
+ raise TypeError, "Expected #{bytes.inspect} to cast to a #{self.class} (malformed UUID representation)" if elements.size != 5
25
+ @bytes = elements.join.to_a.pack('H32')
26
+ else
27
+ raise TypeError, "Expected #{bytes.inspect} to cast to a #{self.class} (invalid bytecount)"
28
+ end
29
+
30
+ when Integer
31
+ raise TypeError, "Expected #{bytes.inspect} to cast to a #{self.class} (integer out of range)" if bytes < 0 or bytes > 2**128
32
+ @bytes = [
33
+ (bytes >> 96) & 0xFFFF_FFFF,
34
+ (bytes >> 64) & 0xFFFF_FFFF,
35
+ (bytes >> 32) & 0xFFFF_FFFF,
36
+ bytes & 0xFFFF_FFFF
37
+ ].pack("NNNN")
38
+
39
+ when NilClass, Time
40
+ time = (bytes || Time).stamp * 10 + GREGORIAN_EPOCH_OFFSET
41
+ # See http://github.com/spectra/ruby-uuid/
42
+ @bytes = [
43
+ time & 0xFFFF_FFFF,
44
+ time >> 32,
45
+ ((time >> 48) & 0x0FFF) | 0x1000,
46
+ # Top 3 bytes reserved
47
+ rand(2**13) | VARIANT,
48
+ rand(2**16),
49
+ rand(2**32)
50
+ ].pack("NnnnnN")
51
+
52
+ else
53
+ raise TypeError, "Expected #{bytes.inspect} to cast to a #{self.class} (unknown source class)"
54
+ end
55
+ end
56
+
57
+ def to_i
58
+ ints = @bytes.unpack("NNNN")
59
+ (ints[0] << 96) +
60
+ (ints[1] << 64) +
61
+ (ints[2] << 32) +
62
+ ints[3]
63
+ end
64
+
65
+ def version
66
+ time_high = @bytes.unpack("NnnQ")[2]
67
+ version = (time_high & 0xF000).to_s(16)[0].chr.to_i
68
+ version > 0 and version < 6 ? version : -1
69
+ end
70
+
71
+ def variant
72
+ @bytes.unpack('QnnN')[1] >> 13
73
+ end
74
+
75
+ def to_guid
76
+ elements = @bytes.unpack("NnnCCa6")
77
+ node = elements[-1].unpack('C*')
78
+ elements[-1] = '%02x%02x%02x%02x%02x%02x' % node
79
+ "%08x-%04x-%04x-%02x%02x-%s" % elements
80
+ end
81
+
82
+ def seconds
83
+ total_usecs / 1_000_000
84
+ end
85
+
86
+ def usecs
87
+ total_usecs % 1_000_000
88
+ end
89
+
90
+ def <=>(other)
91
+ total_usecs <=> other.send(:total_usecs)
92
+ end
93
+
94
+ def inspect(long = false)
95
+ "<Cassandra::UUID##{object_id} time: #{
96
+ Time.at(seconds).inspect
97
+ }, usecs: #{
98
+ usecs
99
+ } jitter: #{
100
+ @bytes.unpack('QQ')[1]
101
+ }" + (long ? ", version: #{version}, variant: #{variant}, guid: #{to_guid}>" : ">")
102
+ end
103
+
104
+ private
105
+
106
+ def total_usecs
107
+ elements = @bytes.unpack("NnnQ")
108
+ (elements[0] + (elements[1] << 32) + ((elements[2] & 0x0FFF) << 48) - GREGORIAN_EPOCH_OFFSET) / 10
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,853 @@
1
+ #
2
+ # Autogenerated by Thrift
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'thrift'
8
+ require 'cassandra_types'
9
+
10
+ module CassandraThrift
11
+ module Cassandra
12
+ class Client
13
+ include ::Thrift::Client
14
+
15
+ def get(keyspace, key, column_path, consistency_level)
16
+ send_get(keyspace, key, column_path, consistency_level)
17
+ return recv_get()
18
+ end
19
+
20
+ def send_get(keyspace, key, column_path, consistency_level)
21
+ send_message('get', Get_args, :keyspace => keyspace, :key => key, :column_path => column_path, :consistency_level => consistency_level)
22
+ end
23
+
24
+ def recv_get()
25
+ result = receive_message(Get_result)
26
+ return result.success unless result.success.nil?
27
+ raise result.ire unless result.ire.nil?
28
+ raise result.nfe unless result.nfe.nil?
29
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get failed: unknown result')
30
+ end
31
+
32
+ def get_slice(keyspace, key, column_parent, predicate, consistency_level)
33
+ send_get_slice(keyspace, key, column_parent, predicate, consistency_level)
34
+ return recv_get_slice()
35
+ end
36
+
37
+ def send_get_slice(keyspace, key, column_parent, predicate, consistency_level)
38
+ send_message('get_slice', Get_slice_args, :keyspace => keyspace, :key => key, :column_parent => column_parent, :predicate => predicate, :consistency_level => consistency_level)
39
+ end
40
+
41
+ def recv_get_slice()
42
+ result = receive_message(Get_slice_result)
43
+ return result.success unless result.success.nil?
44
+ raise result.ire unless result.ire.nil?
45
+ raise result.nfe unless result.nfe.nil?
46
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_slice failed: unknown result')
47
+ end
48
+
49
+ def multiget(keyspace, keys, column_path, consistency_level)
50
+ send_multiget(keyspace, keys, column_path, consistency_level)
51
+ return recv_multiget()
52
+ end
53
+
54
+ def send_multiget(keyspace, keys, column_path, consistency_level)
55
+ send_message('multiget', Multiget_args, :keyspace => keyspace, :keys => keys, :column_path => column_path, :consistency_level => consistency_level)
56
+ end
57
+
58
+ def recv_multiget()
59
+ result = receive_message(Multiget_result)
60
+ return result.success unless result.success.nil?
61
+ raise result.ire unless result.ire.nil?
62
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'multiget failed: unknown result')
63
+ end
64
+
65
+ def multiget_slice(keyspace, keys, column_parent, predicate, consistency_level)
66
+ send_multiget_slice(keyspace, keys, column_parent, predicate, consistency_level)
67
+ return recv_multiget_slice()
68
+ end
69
+
70
+ def send_multiget_slice(keyspace, keys, column_parent, predicate, consistency_level)
71
+ send_message('multiget_slice', Multiget_slice_args, :keyspace => keyspace, :keys => keys, :column_parent => column_parent, :predicate => predicate, :consistency_level => consistency_level)
72
+ end
73
+
74
+ def recv_multiget_slice()
75
+ result = receive_message(Multiget_slice_result)
76
+ return result.success unless result.success.nil?
77
+ raise result.ire unless result.ire.nil?
78
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'multiget_slice failed: unknown result')
79
+ end
80
+
81
+ def get_count(keyspace, key, column_parent, consistency_level)
82
+ send_get_count(keyspace, key, column_parent, consistency_level)
83
+ return recv_get_count()
84
+ end
85
+
86
+ def send_get_count(keyspace, key, column_parent, consistency_level)
87
+ send_message('get_count', Get_count_args, :keyspace => keyspace, :key => key, :column_parent => column_parent, :consistency_level => consistency_level)
88
+ end
89
+
90
+ def recv_get_count()
91
+ result = receive_message(Get_count_result)
92
+ return result.success unless result.success.nil?
93
+ raise result.ire unless result.ire.nil?
94
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_count failed: unknown result')
95
+ end
96
+
97
+ def get_key_range(keyspace, column_family, start, finish, count, consistency_level)
98
+ send_get_key_range(keyspace, column_family, start, finish, count, consistency_level)
99
+ return recv_get_key_range()
100
+ end
101
+
102
+ def send_get_key_range(keyspace, column_family, start, finish, count, consistency_level)
103
+ send_message('get_key_range', Get_key_range_args, :keyspace => keyspace, :column_family => column_family, :start => start, :finish => finish, :count => count, :consistency_level => consistency_level)
104
+ end
105
+
106
+ def recv_get_key_range()
107
+ result = receive_message(Get_key_range_result)
108
+ return result.success unless result.success.nil?
109
+ raise result.ire unless result.ire.nil?
110
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_key_range failed: unknown result')
111
+ end
112
+
113
+ def insert(keyspace, key, column_path, value, timestamp, consistency_level)
114
+ send_insert(keyspace, key, column_path, value, timestamp, consistency_level)
115
+ recv_insert()
116
+ end
117
+
118
+ def send_insert(keyspace, key, column_path, value, timestamp, consistency_level)
119
+ send_message('insert', Insert_args, :keyspace => keyspace, :key => key, :column_path => column_path, :value => value, :timestamp => timestamp, :consistency_level => consistency_level)
120
+ end
121
+
122
+ def recv_insert()
123
+ result = receive_message(Insert_result)
124
+ raise result.ire unless result.ire.nil?
125
+ raise result.ue unless result.ue.nil?
126
+ return
127
+ end
128
+
129
+ def batch_mutate(keyspace, batch_mutations, consistency_level)
130
+ send_batch_mutate(keyspace, batch_mutations, consistency_level)
131
+ recv_batch_mutate()
132
+ end
133
+
134
+ def send_batch_mutate(keyspace, batch_mutations, consistency_level)
135
+ send_message('batch_mutate', Batch_mutate_args, :keyspace => keyspace, :batch_mutations => batch_mutations, :consistency_level => consistency_level)
136
+ end
137
+
138
+ def recv_batch_mutate()
139
+ result = receive_message(Batch_mutate_result)
140
+ raise result.ire unless result.ire.nil?
141
+ raise result.ue unless result.ue.nil?
142
+ return
143
+ end
144
+
145
+ def remove(keyspace, key, column_path, timestamp, consistency_level)
146
+ send_remove(keyspace, key, column_path, timestamp, consistency_level)
147
+ recv_remove()
148
+ end
149
+
150
+ def send_remove(keyspace, key, column_path, timestamp, consistency_level)
151
+ send_message('remove', Remove_args, :keyspace => keyspace, :key => key, :column_path => column_path, :timestamp => timestamp, :consistency_level => consistency_level)
152
+ end
153
+
154
+ def recv_remove()
155
+ result = receive_message(Remove_result)
156
+ raise result.ire unless result.ire.nil?
157
+ raise result.ue unless result.ue.nil?
158
+ return
159
+ end
160
+
161
+ def get_string_property(property)
162
+ send_get_string_property(property)
163
+ return recv_get_string_property()
164
+ end
165
+
166
+ def send_get_string_property(property)
167
+ send_message('get_string_property', Get_string_property_args, :property => property)
168
+ end
169
+
170
+ def recv_get_string_property()
171
+ result = receive_message(Get_string_property_result)
172
+ return result.success unless result.success.nil?
173
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_string_property failed: unknown result')
174
+ end
175
+
176
+ def get_string_list_property(property)
177
+ send_get_string_list_property(property)
178
+ return recv_get_string_list_property()
179
+ end
180
+
181
+ def send_get_string_list_property(property)
182
+ send_message('get_string_list_property', Get_string_list_property_args, :property => property)
183
+ end
184
+
185
+ def recv_get_string_list_property()
186
+ result = receive_message(Get_string_list_property_result)
187
+ return result.success unless result.success.nil?
188
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_string_list_property failed: unknown result')
189
+ end
190
+
191
+ def describe_keyspace(keyspace)
192
+ send_describe_keyspace(keyspace)
193
+ return recv_describe_keyspace()
194
+ end
195
+
196
+ def send_describe_keyspace(keyspace)
197
+ send_message('describe_keyspace', Describe_keyspace_args, :keyspace => keyspace)
198
+ end
199
+
200
+ def recv_describe_keyspace()
201
+ result = receive_message(Describe_keyspace_result)
202
+ return result.success unless result.success.nil?
203
+ raise result.nfe unless result.nfe.nil?
204
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_keyspace failed: unknown result')
205
+ end
206
+
207
+ end
208
+
209
+ class Processor
210
+ include ::Thrift::Processor
211
+
212
+ def process_get(seqid, iprot, oprot)
213
+ args = read_args(iprot, Get_args)
214
+ result = Get_result.new()
215
+ begin
216
+ result.success = @handler.get(args.keyspace, args.key, args.column_path, args.consistency_level)
217
+ rescue CassandraThrift::InvalidRequestException => ire
218
+ result.ire = ire
219
+ rescue CassandraThrift::NotFoundException => nfe
220
+ result.nfe = nfe
221
+ end
222
+ write_result(result, oprot, 'get', seqid)
223
+ end
224
+
225
+ def process_get_slice(seqid, iprot, oprot)
226
+ args = read_args(iprot, Get_slice_args)
227
+ result = Get_slice_result.new()
228
+ begin
229
+ result.success = @handler.get_slice(args.keyspace, args.key, args.column_parent, args.predicate, args.consistency_level)
230
+ rescue CassandraThrift::InvalidRequestException => ire
231
+ result.ire = ire
232
+ rescue CassandraThrift::NotFoundException => nfe
233
+ result.nfe = nfe
234
+ end
235
+ write_result(result, oprot, 'get_slice', seqid)
236
+ end
237
+
238
+ def process_multiget(seqid, iprot, oprot)
239
+ args = read_args(iprot, Multiget_args)
240
+ result = Multiget_result.new()
241
+ begin
242
+ result.success = @handler.multiget(args.keyspace, args.keys, args.column_path, args.consistency_level)
243
+ rescue CassandraThrift::InvalidRequestException => ire
244
+ result.ire = ire
245
+ end
246
+ write_result(result, oprot, 'multiget', seqid)
247
+ end
248
+
249
+ def process_multiget_slice(seqid, iprot, oprot)
250
+ args = read_args(iprot, Multiget_slice_args)
251
+ result = Multiget_slice_result.new()
252
+ begin
253
+ result.success = @handler.multiget_slice(args.keyspace, args.keys, args.column_parent, args.predicate, args.consistency_level)
254
+ rescue CassandraThrift::InvalidRequestException => ire
255
+ result.ire = ire
256
+ end
257
+ write_result(result, oprot, 'multiget_slice', seqid)
258
+ end
259
+
260
+ def process_get_count(seqid, iprot, oprot)
261
+ args = read_args(iprot, Get_count_args)
262
+ result = Get_count_result.new()
263
+ begin
264
+ result.success = @handler.get_count(args.keyspace, args.key, args.column_parent, args.consistency_level)
265
+ rescue CassandraThrift::InvalidRequestException => ire
266
+ result.ire = ire
267
+ end
268
+ write_result(result, oprot, 'get_count', seqid)
269
+ end
270
+
271
+ def process_get_key_range(seqid, iprot, oprot)
272
+ args = read_args(iprot, Get_key_range_args)
273
+ result = Get_key_range_result.new()
274
+ begin
275
+ result.success = @handler.get_key_range(args.keyspace, args.column_family, args.start, args.finish, args.count, args.consistency_level)
276
+ rescue CassandraThrift::InvalidRequestException => ire
277
+ result.ire = ire
278
+ end
279
+ write_result(result, oprot, 'get_key_range', seqid)
280
+ end
281
+
282
+ def process_insert(seqid, iprot, oprot)
283
+ args = read_args(iprot, Insert_args)
284
+ result = Insert_result.new()
285
+ begin
286
+ @handler.insert(args.keyspace, args.key, args.column_path, args.value, args.timestamp, args.consistency_level)
287
+ rescue CassandraThrift::InvalidRequestException => ire
288
+ result.ire = ire
289
+ rescue CassandraThrift::UnavailableException => ue
290
+ result.ue = ue
291
+ end
292
+ write_result(result, oprot, 'insert', seqid)
293
+ end
294
+
295
+ def process_batch_mutate(seqid, iprot, oprot)
296
+ args = read_args(iprot, Batch_mutate_args)
297
+ result = Batch_mutate_result.new()
298
+ begin
299
+ @handler.batch_mutate(args.keyspace, args.batch_mutations, args.consistency_level)
300
+ rescue CassandraThrift::InvalidRequestException => ire
301
+ result.ire = ire
302
+ rescue CassandraThrift::UnavailableException => ue
303
+ result.ue = ue
304
+ end
305
+ write_result(result, oprot, 'batch_mutate', seqid)
306
+ end
307
+
308
+ def process_remove(seqid, iprot, oprot)
309
+ args = read_args(iprot, Remove_args)
310
+ result = Remove_result.new()
311
+ begin
312
+ @handler.remove(args.keyspace, args.key, args.column_path, args.timestamp, args.consistency_level)
313
+ rescue CassandraThrift::InvalidRequestException => ire
314
+ result.ire = ire
315
+ rescue CassandraThrift::UnavailableException => ue
316
+ result.ue = ue
317
+ end
318
+ write_result(result, oprot, 'remove', seqid)
319
+ end
320
+
321
+ def process_get_string_property(seqid, iprot, oprot)
322
+ args = read_args(iprot, Get_string_property_args)
323
+ result = Get_string_property_result.new()
324
+ result.success = @handler.get_string_property(args.property)
325
+ write_result(result, oprot, 'get_string_property', seqid)
326
+ end
327
+
328
+ def process_get_string_list_property(seqid, iprot, oprot)
329
+ args = read_args(iprot, Get_string_list_property_args)
330
+ result = Get_string_list_property_result.new()
331
+ result.success = @handler.get_string_list_property(args.property)
332
+ write_result(result, oprot, 'get_string_list_property', seqid)
333
+ end
334
+
335
+ def process_describe_keyspace(seqid, iprot, oprot)
336
+ args = read_args(iprot, Describe_keyspace_args)
337
+ result = Describe_keyspace_result.new()
338
+ begin
339
+ result.success = @handler.describe_keyspace(args.keyspace)
340
+ rescue CassandraThrift::NotFoundException => nfe
341
+ result.nfe = nfe
342
+ end
343
+ write_result(result, oprot, 'describe_keyspace', seqid)
344
+ end
345
+
346
+ end
347
+
348
+ # HELPER FUNCTIONS AND STRUCTURES
349
+
350
+ class Get_args
351
+ include ::Thrift::Struct
352
+ KEYSPACE = 1
353
+ KEY = 2
354
+ COLUMN_PATH = 3
355
+ CONSISTENCY_LEVEL = 4
356
+
357
+ ::Thrift::Struct.field_accessor self, :keyspace, :key, :column_path, :consistency_level
358
+ FIELDS = {
359
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
360
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
361
+ COLUMN_PATH => {:type => ::Thrift::Types::STRUCT, :name => 'column_path', :class => CassandraThrift::ColumnPath},
362
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel}
363
+ }
364
+
365
+ def struct_fields; FIELDS; end
366
+
367
+ def validate
368
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
369
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
370
+ end
371
+ end
372
+
373
+ end
374
+
375
+ class Get_result
376
+ include ::Thrift::Struct
377
+ SUCCESS = 0
378
+ IRE = 1
379
+ NFE = 2
380
+
381
+ ::Thrift::Struct.field_accessor self, :success, :ire, :nfe
382
+ FIELDS = {
383
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => CassandraThrift::ColumnOrSuperColumn},
384
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
385
+ NFE => {:type => ::Thrift::Types::STRUCT, :name => 'nfe', :class => CassandraThrift::NotFoundException}
386
+ }
387
+
388
+ def struct_fields; FIELDS; end
389
+
390
+ def validate
391
+ end
392
+
393
+ end
394
+
395
+ class Get_slice_args
396
+ include ::Thrift::Struct
397
+ KEYSPACE = 1
398
+ KEY = 2
399
+ COLUMN_PARENT = 3
400
+ PREDICATE = 4
401
+ CONSISTENCY_LEVEL = 5
402
+
403
+ ::Thrift::Struct.field_accessor self, :keyspace, :key, :column_parent, :predicate, :consistency_level
404
+ FIELDS = {
405
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
406
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
407
+ COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent},
408
+ PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate},
409
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel}
410
+ }
411
+
412
+ def struct_fields; FIELDS; end
413
+
414
+ def validate
415
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
416
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
417
+ end
418
+ end
419
+
420
+ end
421
+
422
+ class Get_slice_result
423
+ include ::Thrift::Struct
424
+ SUCCESS = 0
425
+ IRE = 1
426
+ NFE = 2
427
+
428
+ ::Thrift::Struct.field_accessor self, :success, :ire, :nfe
429
+ FIELDS = {
430
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}},
431
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
432
+ NFE => {:type => ::Thrift::Types::STRUCT, :name => 'nfe', :class => CassandraThrift::NotFoundException}
433
+ }
434
+
435
+ def struct_fields; FIELDS; end
436
+
437
+ def validate
438
+ end
439
+
440
+ end
441
+
442
+ class Multiget_args
443
+ include ::Thrift::Struct
444
+ KEYSPACE = 1
445
+ KEYS = 2
446
+ COLUMN_PATH = 3
447
+ CONSISTENCY_LEVEL = 4
448
+
449
+ ::Thrift::Struct.field_accessor self, :keyspace, :keys, :column_path, :consistency_level
450
+ FIELDS = {
451
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
452
+ KEYS => {:type => ::Thrift::Types::LIST, :name => 'keys', :element => {:type => ::Thrift::Types::STRING}},
453
+ COLUMN_PATH => {:type => ::Thrift::Types::STRUCT, :name => 'column_path', :class => CassandraThrift::ColumnPath},
454
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel}
455
+ }
456
+
457
+ def struct_fields; FIELDS; end
458
+
459
+ def validate
460
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
461
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
462
+ end
463
+ end
464
+
465
+ end
466
+
467
+ class Multiget_result
468
+ include ::Thrift::Struct
469
+ SUCCESS = 0
470
+ IRE = 1
471
+
472
+ ::Thrift::Struct.field_accessor self, :success, :ire
473
+ FIELDS = {
474
+ SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}},
475
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}
476
+ }
477
+
478
+ def struct_fields; FIELDS; end
479
+
480
+ def validate
481
+ end
482
+
483
+ end
484
+
485
+ class Multiget_slice_args
486
+ include ::Thrift::Struct
487
+ KEYSPACE = 1
488
+ KEYS = 2
489
+ COLUMN_PARENT = 3
490
+ PREDICATE = 4
491
+ CONSISTENCY_LEVEL = 5
492
+
493
+ ::Thrift::Struct.field_accessor self, :keyspace, :keys, :column_parent, :predicate, :consistency_level
494
+ FIELDS = {
495
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
496
+ KEYS => {:type => ::Thrift::Types::LIST, :name => 'keys', :element => {:type => ::Thrift::Types::STRING}},
497
+ COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent},
498
+ PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate},
499
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel}
500
+ }
501
+
502
+ def struct_fields; FIELDS; end
503
+
504
+ def validate
505
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
506
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
507
+ end
508
+ end
509
+
510
+ end
511
+
512
+ class Multiget_slice_result
513
+ include ::Thrift::Struct
514
+ SUCCESS = 0
515
+ IRE = 1
516
+
517
+ ::Thrift::Struct.field_accessor self, :success, :ire
518
+ FIELDS = {
519
+ 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}}},
520
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}
521
+ }
522
+
523
+ def struct_fields; FIELDS; end
524
+
525
+ def validate
526
+ end
527
+
528
+ end
529
+
530
+ class Get_count_args
531
+ include ::Thrift::Struct
532
+ KEYSPACE = 1
533
+ KEY = 2
534
+ COLUMN_PARENT = 3
535
+ CONSISTENCY_LEVEL = 5
536
+
537
+ ::Thrift::Struct.field_accessor self, :keyspace, :key, :column_parent, :consistency_level
538
+ FIELDS = {
539
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
540
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
541
+ COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent},
542
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel}
543
+ }
544
+
545
+ def struct_fields; FIELDS; end
546
+
547
+ def validate
548
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
549
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
550
+ end
551
+ end
552
+
553
+ end
554
+
555
+ class Get_count_result
556
+ include ::Thrift::Struct
557
+ SUCCESS = 0
558
+ IRE = 1
559
+
560
+ ::Thrift::Struct.field_accessor self, :success, :ire
561
+ FIELDS = {
562
+ SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success'},
563
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}
564
+ }
565
+
566
+ def struct_fields; FIELDS; end
567
+
568
+ def validate
569
+ end
570
+
571
+ end
572
+
573
+ class Get_key_range_args
574
+ include ::Thrift::Struct
575
+ KEYSPACE = 1
576
+ COLUMN_FAMILY = 2
577
+ START = 3
578
+ FINISH = 4
579
+ COUNT = 5
580
+ CONSISTENCY_LEVEL = 6
581
+
582
+ ::Thrift::Struct.field_accessor self, :keyspace, :column_family, :start, :finish, :count, :consistency_level
583
+ FIELDS = {
584
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
585
+ COLUMN_FAMILY => {:type => ::Thrift::Types::STRING, :name => 'column_family'},
586
+ START => {:type => ::Thrift::Types::STRING, :name => 'start', :default => %q""},
587
+ FINISH => {:type => ::Thrift::Types::STRING, :name => 'finish', :default => %q""},
588
+ COUNT => {:type => ::Thrift::Types::I32, :name => 'count', :default => 100},
589
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel}
590
+ }
591
+
592
+ def struct_fields; FIELDS; end
593
+
594
+ def validate
595
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
596
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
597
+ end
598
+ end
599
+
600
+ end
601
+
602
+ class Get_key_range_result
603
+ include ::Thrift::Struct
604
+ SUCCESS = 0
605
+ IRE = 1
606
+
607
+ ::Thrift::Struct.field_accessor self, :success, :ire
608
+ FIELDS = {
609
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRING}},
610
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}
611
+ }
612
+
613
+ def struct_fields; FIELDS; end
614
+
615
+ def validate
616
+ end
617
+
618
+ end
619
+
620
+ class Insert_args
621
+ include ::Thrift::Struct
622
+ KEYSPACE = 1
623
+ KEY = 2
624
+ COLUMN_PATH = 3
625
+ VALUE = 4
626
+ TIMESTAMP = 5
627
+ CONSISTENCY_LEVEL = 6
628
+
629
+ ::Thrift::Struct.field_accessor self, :keyspace, :key, :column_path, :value, :timestamp, :consistency_level
630
+ FIELDS = {
631
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
632
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
633
+ COLUMN_PATH => {:type => ::Thrift::Types::STRUCT, :name => 'column_path', :class => CassandraThrift::ColumnPath},
634
+ VALUE => {:type => ::Thrift::Types::STRING, :name => 'value'},
635
+ TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'},
636
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 0, :enum_class => CassandraThrift::ConsistencyLevel}
637
+ }
638
+
639
+ def struct_fields; FIELDS; end
640
+
641
+ def validate
642
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
643
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
644
+ end
645
+ end
646
+
647
+ end
648
+
649
+ class Insert_result
650
+ include ::Thrift::Struct
651
+ IRE = 1
652
+ UE = 2
653
+
654
+ ::Thrift::Struct.field_accessor self, :ire, :ue
655
+ FIELDS = {
656
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
657
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}
658
+ }
659
+
660
+ def struct_fields; FIELDS; end
661
+
662
+ def validate
663
+ end
664
+
665
+ end
666
+
667
+ class Batch_mutate_args
668
+ include ::Thrift::Struct
669
+ KEYSPACE = 1
670
+ BATCH_MUTATIONS = 2
671
+ CONSISTENCY_LEVEL = 3
672
+
673
+ ::Thrift::Struct.field_accessor self, :keyspace, :batch_mutations, :consistency_level
674
+ FIELDS = {
675
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
676
+ BATCH_MUTATIONS => {:type => ::Thrift::Types::LIST, :name => 'batch_mutations', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::BatchMutation}},
677
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 0, :enum_class => CassandraThrift::ConsistencyLevel}
678
+ }
679
+
680
+ def struct_fields; FIELDS; end
681
+
682
+ def validate
683
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
684
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
685
+ end
686
+ end
687
+
688
+ end
689
+
690
+ class Batch_mutate_result
691
+ include ::Thrift::Struct
692
+ IRE = 1
693
+ UE = 2
694
+
695
+ ::Thrift::Struct.field_accessor self, :ire, :ue
696
+ FIELDS = {
697
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
698
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}
699
+ }
700
+
701
+ def struct_fields; FIELDS; end
702
+
703
+ def validate
704
+ end
705
+
706
+ end
707
+
708
+ class Remove_args
709
+ include ::Thrift::Struct
710
+ KEYSPACE = 1
711
+ KEY = 2
712
+ COLUMN_PATH = 3
713
+ TIMESTAMP = 4
714
+ CONSISTENCY_LEVEL = 5
715
+
716
+ ::Thrift::Struct.field_accessor self, :keyspace, :key, :column_path, :timestamp, :consistency_level
717
+ FIELDS = {
718
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
719
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
720
+ COLUMN_PATH => {:type => ::Thrift::Types::STRUCT, :name => 'column_path', :class => CassandraThrift::ColumnPath},
721
+ TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'},
722
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 0, :enum_class => CassandraThrift::ConsistencyLevel}
723
+ }
724
+
725
+ def struct_fields; FIELDS; end
726
+
727
+ def validate
728
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
729
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
730
+ end
731
+ end
732
+
733
+ end
734
+
735
+ class Remove_result
736
+ include ::Thrift::Struct
737
+ IRE = 1
738
+ UE = 2
739
+
740
+ ::Thrift::Struct.field_accessor self, :ire, :ue
741
+ FIELDS = {
742
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
743
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException}
744
+ }
745
+
746
+ def struct_fields; FIELDS; end
747
+
748
+ def validate
749
+ end
750
+
751
+ end
752
+
753
+ class Get_string_property_args
754
+ include ::Thrift::Struct
755
+ PROPERTY = 1
756
+
757
+ ::Thrift::Struct.field_accessor self, :property
758
+ FIELDS = {
759
+ PROPERTY => {:type => ::Thrift::Types::STRING, :name => 'property'}
760
+ }
761
+
762
+ def struct_fields; FIELDS; end
763
+
764
+ def validate
765
+ end
766
+
767
+ end
768
+
769
+ class Get_string_property_result
770
+ include ::Thrift::Struct
771
+ SUCCESS = 0
772
+
773
+ ::Thrift::Struct.field_accessor self, :success
774
+ FIELDS = {
775
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
776
+ }
777
+
778
+ def struct_fields; FIELDS; end
779
+
780
+ def validate
781
+ end
782
+
783
+ end
784
+
785
+ class Get_string_list_property_args
786
+ include ::Thrift::Struct
787
+ PROPERTY = 1
788
+
789
+ ::Thrift::Struct.field_accessor self, :property
790
+ FIELDS = {
791
+ PROPERTY => {:type => ::Thrift::Types::STRING, :name => 'property'}
792
+ }
793
+
794
+ def struct_fields; FIELDS; end
795
+
796
+ def validate
797
+ end
798
+
799
+ end
800
+
801
+ class Get_string_list_property_result
802
+ include ::Thrift::Struct
803
+ SUCCESS = 0
804
+
805
+ ::Thrift::Struct.field_accessor self, :success
806
+ FIELDS = {
807
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRING}}
808
+ }
809
+
810
+ def struct_fields; FIELDS; end
811
+
812
+ def validate
813
+ end
814
+
815
+ end
816
+
817
+ class Describe_keyspace_args
818
+ include ::Thrift::Struct
819
+ KEYSPACE = 1
820
+
821
+ ::Thrift::Struct.field_accessor self, :keyspace
822
+ FIELDS = {
823
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'}
824
+ }
825
+
826
+ def struct_fields; FIELDS; end
827
+
828
+ def validate
829
+ end
830
+
831
+ end
832
+
833
+ class Describe_keyspace_result
834
+ include ::Thrift::Struct
835
+ SUCCESS = 0
836
+ NFE = 1
837
+
838
+ ::Thrift::Struct.field_accessor self, :success, :nfe
839
+ FIELDS = {
840
+ SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::MAP, :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}},
841
+ NFE => {:type => ::Thrift::Types::STRUCT, :name => 'nfe', :class => CassandraThrift::NotFoundException}
842
+ }
843
+
844
+ def struct_fields; FIELDS; end
845
+
846
+ def validate
847
+ end
848
+
849
+ end
850
+
851
+ end
852
+
853
+ end