mcmire-cassandra 0.12.2 → 0.12.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,12 @@
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 'cassandra_types'
8
+
9
+ module CassandraThrift
10
+ VERSION = %q"19.17.0"
11
+
12
+ end
@@ -0,0 +1,857 @@
1
+ #
2
+ # Autogenerated by Thrift
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+
8
+ module CassandraThrift
9
+ module ConsistencyLevel
10
+ ONE = 1
11
+ QUORUM = 2
12
+ LOCAL_QUORUM = 3
13
+ EACH_QUORUM = 4
14
+ ALL = 5
15
+ ANY = 6
16
+ TWO = 7
17
+ THREE = 8
18
+ VALUE_MAP = {1 => "ONE", 2 => "QUORUM", 3 => "LOCAL_QUORUM", 4 => "EACH_QUORUM", 5 => "ALL", 6 => "ANY", 7 => "TWO", 8 => "THREE"}
19
+ VALID_VALUES = Set.new([ONE, QUORUM, LOCAL_QUORUM, EACH_QUORUM, ALL, ANY, TWO, THREE]).freeze
20
+ end
21
+
22
+ module IndexOperator
23
+ EQ = 0
24
+ GTE = 1
25
+ GT = 2
26
+ LTE = 3
27
+ LT = 4
28
+ VALUE_MAP = {0 => "EQ", 1 => "GTE", 2 => "GT", 3 => "LTE", 4 => "LT"}
29
+ VALID_VALUES = Set.new([EQ, GTE, GT, LTE, LT]).freeze
30
+ end
31
+
32
+ module IndexType
33
+ KEYS = 0
34
+ CUSTOM = 1
35
+ VALUE_MAP = {0 => "KEYS", 1 => "CUSTOM"}
36
+ VALID_VALUES = Set.new([KEYS, CUSTOM]).freeze
37
+ end
38
+
39
+ module Compression
40
+ GZIP = 1
41
+ NONE = 2
42
+ VALUE_MAP = {1 => "GZIP", 2 => "NONE"}
43
+ VALID_VALUES = Set.new([GZIP, NONE]).freeze
44
+ end
45
+
46
+ module CqlResultType
47
+ ROWS = 1
48
+ VOID = 2
49
+ INT = 3
50
+ VALUE_MAP = {1 => "ROWS", 2 => "VOID", 3 => "INT"}
51
+ VALID_VALUES = Set.new([ROWS, VOID, INT]).freeze
52
+ end
53
+
54
+ # Basic unit of data within a ColumnFamily.
55
+ # @param name, the name by which this column is set and retrieved. Maximum 64KB long.
56
+ # @param value. The data associated with the name. Maximum 2GB long, but in practice you should limit it to small numbers of MB (since Thrift must read the full value into memory to operate on it).
57
+ # @param timestamp. The timestamp is used for conflict detection/resolution when two columns with same name need to be compared.
58
+ # @param ttl. An optional, positive delay (in seconds) after which the column will be automatically deleted.
59
+ class Column
60
+ include ::Thrift::Struct, ::Thrift::Struct_Union
61
+ NAME = 1
62
+ VALUE = 2
63
+ TIMESTAMP = 3
64
+ TTL = 4
65
+
66
+ FIELDS = {
67
+ NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :binary => true},
68
+ VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true, :optional => true},
69
+ TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp', :optional => true},
70
+ TTL => {:type => ::Thrift::Types::I32, :name => 'ttl', :optional => true}
71
+ }
72
+
73
+ def struct_fields; FIELDS; end
74
+
75
+ def validate
76
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
77
+ end
78
+
79
+ ::Thrift::Struct.generate_accessors self
80
+ end
81
+
82
+ # A named list of columns.
83
+ # @param name. see Column.name.
84
+ # @param columns. A collection of standard Columns. The columns within a super column are defined in an adhoc manner.
85
+ # Columns within a super column do not have to have matching structures (similarly named child columns).
86
+ class SuperColumn
87
+ include ::Thrift::Struct, ::Thrift::Struct_Union
88
+ NAME = 1
89
+ COLUMNS = 2
90
+
91
+ FIELDS = {
92
+ NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :binary => true},
93
+ COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::Column}}
94
+ }
95
+
96
+ def struct_fields; FIELDS; end
97
+
98
+ def validate
99
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
100
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns
101
+ end
102
+
103
+ ::Thrift::Struct.generate_accessors self
104
+ end
105
+
106
+ class CounterColumn
107
+ include ::Thrift::Struct, ::Thrift::Struct_Union
108
+ NAME = 1
109
+ VALUE = 2
110
+
111
+ FIELDS = {
112
+ NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :binary => true},
113
+ VALUE => {:type => ::Thrift::Types::I64, :name => 'value'}
114
+ }
115
+
116
+ def struct_fields; FIELDS; end
117
+
118
+ def validate
119
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
120
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') unless @value
121
+ end
122
+
123
+ ::Thrift::Struct.generate_accessors self
124
+ end
125
+
126
+ class CounterSuperColumn
127
+ include ::Thrift::Struct, ::Thrift::Struct_Union
128
+ NAME = 1
129
+ COLUMNS = 2
130
+
131
+ FIELDS = {
132
+ NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :binary => true},
133
+ COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::CounterColumn}}
134
+ }
135
+
136
+ def struct_fields; FIELDS; end
137
+
138
+ def validate
139
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
140
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns
141
+ end
142
+
143
+ ::Thrift::Struct.generate_accessors self
144
+ end
145
+
146
+ # Methods for fetching rows/records from Cassandra will return either a single instance of ColumnOrSuperColumn or a list
147
+ # of ColumnOrSuperColumns (get_slice()). If you're looking up a SuperColumn (or list of SuperColumns) then the resulting
148
+ # instances of ColumnOrSuperColumn will have the requested SuperColumn in the attribute super_column. For queries resulting
149
+ # in Columns, those values will be in the attribute column. This change was made between 0.3 and 0.4 to standardize on
150
+ # single query methods that may return either a SuperColumn or Column.
151
+ #
152
+ # If the query was on a counter column family, you will either get a counter_column (instead of a column) or a
153
+ # counter_super_column (instead of a super_column)
154
+ #
155
+ # @param column. The Column returned by get() or get_slice().
156
+ # @param super_column. The SuperColumn returned by get() or get_slice().
157
+ # @param counter_column. The Counterolumn returned by get() or get_slice().
158
+ # @param counter_super_column. The CounterSuperColumn returned by get() or get_slice().
159
+ class ColumnOrSuperColumn
160
+ include ::Thrift::Struct, ::Thrift::Struct_Union
161
+ COLUMN = 1
162
+ SUPER_COLUMN = 2
163
+ COUNTER_COLUMN = 3
164
+ COUNTER_SUPER_COLUMN = 4
165
+
166
+ FIELDS = {
167
+ COLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'column', :class => CassandraThrift::Column, :optional => true},
168
+ SUPER_COLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'super_column', :class => CassandraThrift::SuperColumn, :optional => true},
169
+ COUNTER_COLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'counter_column', :class => CassandraThrift::CounterColumn, :optional => true},
170
+ COUNTER_SUPER_COLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'counter_super_column', :class => CassandraThrift::CounterSuperColumn, :optional => true}
171
+ }
172
+
173
+ def struct_fields; FIELDS; end
174
+
175
+ def validate
176
+ end
177
+
178
+ ::Thrift::Struct.generate_accessors self
179
+ end
180
+
181
+ # A specific column was requested that does not exist.
182
+ class NotFoundException < ::Thrift::Exception
183
+ include ::Thrift::Struct, ::Thrift::Struct_Union
184
+
185
+ FIELDS = {
186
+
187
+ }
188
+
189
+ def struct_fields; FIELDS; end
190
+
191
+ def validate
192
+ end
193
+
194
+ ::Thrift::Struct.generate_accessors self
195
+ end
196
+
197
+ # Invalid request could mean keyspace or column family does not exist, required parameters are missing, or a parameter is malformed.
198
+ # why contains an associated error message.
199
+ class InvalidRequestException < ::Thrift::Exception
200
+ include ::Thrift::Struct, ::Thrift::Struct_Union
201
+ def initialize(message=nil)
202
+ super()
203
+ self.why = message
204
+ end
205
+
206
+ def message; why end
207
+
208
+ WHY = 1
209
+
210
+ FIELDS = {
211
+ WHY => {:type => ::Thrift::Types::STRING, :name => 'why'}
212
+ }
213
+
214
+ def struct_fields; FIELDS; end
215
+
216
+ def validate
217
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field why is unset!') unless @why
218
+ end
219
+
220
+ ::Thrift::Struct.generate_accessors self
221
+ end
222
+
223
+ # Not all the replicas required could be created and/or read.
224
+ class UnavailableException < ::Thrift::Exception
225
+ include ::Thrift::Struct, ::Thrift::Struct_Union
226
+
227
+ FIELDS = {
228
+
229
+ }
230
+
231
+ def struct_fields; FIELDS; end
232
+
233
+ def validate
234
+ end
235
+
236
+ ::Thrift::Struct.generate_accessors self
237
+ end
238
+
239
+ # RPC timeout was exceeded. either a node failed mid-operation, or load was too high, or the requested op was too large.
240
+ class TimedOutException < ::Thrift::Exception
241
+ include ::Thrift::Struct, ::Thrift::Struct_Union
242
+
243
+ FIELDS = {
244
+
245
+ }
246
+
247
+ def struct_fields; FIELDS; end
248
+
249
+ def validate
250
+ end
251
+
252
+ ::Thrift::Struct.generate_accessors self
253
+ end
254
+
255
+ # invalid authentication request (invalid keyspace, user does not exist, or credentials invalid)
256
+ class AuthenticationException < ::Thrift::Exception
257
+ include ::Thrift::Struct, ::Thrift::Struct_Union
258
+ def initialize(message=nil)
259
+ super()
260
+ self.why = message
261
+ end
262
+
263
+ def message; why end
264
+
265
+ WHY = 1
266
+
267
+ FIELDS = {
268
+ WHY => {:type => ::Thrift::Types::STRING, :name => 'why'}
269
+ }
270
+
271
+ def struct_fields; FIELDS; end
272
+
273
+ def validate
274
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field why is unset!') unless @why
275
+ end
276
+
277
+ ::Thrift::Struct.generate_accessors self
278
+ end
279
+
280
+ # invalid authorization request (user does not have access to keyspace)
281
+ class AuthorizationException < ::Thrift::Exception
282
+ include ::Thrift::Struct, ::Thrift::Struct_Union
283
+ def initialize(message=nil)
284
+ super()
285
+ self.why = message
286
+ end
287
+
288
+ def message; why end
289
+
290
+ WHY = 1
291
+
292
+ FIELDS = {
293
+ WHY => {:type => ::Thrift::Types::STRING, :name => 'why'}
294
+ }
295
+
296
+ def struct_fields; FIELDS; end
297
+
298
+ def validate
299
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field why is unset!') unless @why
300
+ end
301
+
302
+ ::Thrift::Struct.generate_accessors self
303
+ end
304
+
305
+ # schemas are not in agreement across all nodes
306
+ class SchemaDisagreementException < ::Thrift::Exception
307
+ include ::Thrift::Struct, ::Thrift::Struct_Union
308
+
309
+ FIELDS = {
310
+
311
+ }
312
+
313
+ def struct_fields; FIELDS; end
314
+
315
+ def validate
316
+ end
317
+
318
+ ::Thrift::Struct.generate_accessors self
319
+ end
320
+
321
+ # ColumnParent is used when selecting groups of columns from the same ColumnFamily. In directory structure terms, imagine
322
+ # ColumnParent as ColumnPath + '/../'.
323
+ #
324
+ # See also <a href="cassandra.html#Struct_ColumnPath">ColumnPath</a>
325
+ class ColumnParent
326
+ include ::Thrift::Struct, ::Thrift::Struct_Union
327
+ COLUMN_FAMILY = 3
328
+ SUPER_COLUMN = 4
329
+
330
+ FIELDS = {
331
+ COLUMN_FAMILY => {:type => ::Thrift::Types::STRING, :name => 'column_family'},
332
+ SUPER_COLUMN => {:type => ::Thrift::Types::STRING, :name => 'super_column', :binary => true, :optional => true}
333
+ }
334
+
335
+ def struct_fields; FIELDS; end
336
+
337
+ def validate
338
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_family is unset!') unless @column_family
339
+ end
340
+
341
+ ::Thrift::Struct.generate_accessors self
342
+ end
343
+
344
+ # The ColumnPath is the path to a single column in Cassandra. It might make sense to think of ColumnPath and
345
+ # ColumnParent in terms of a directory structure.
346
+ #
347
+ # ColumnPath is used to looking up a single column.
348
+ #
349
+ # @param column_family. The name of the CF of the column being looked up.
350
+ # @param super_column. The super column name.
351
+ # @param column. The column name.
352
+ class ColumnPath
353
+ include ::Thrift::Struct, ::Thrift::Struct_Union
354
+ COLUMN_FAMILY = 3
355
+ SUPER_COLUMN = 4
356
+ COLUMN = 5
357
+
358
+ FIELDS = {
359
+ COLUMN_FAMILY => {:type => ::Thrift::Types::STRING, :name => 'column_family'},
360
+ SUPER_COLUMN => {:type => ::Thrift::Types::STRING, :name => 'super_column', :binary => true, :optional => true},
361
+ COLUMN => {:type => ::Thrift::Types::STRING, :name => 'column', :binary => true, :optional => true}
362
+ }
363
+
364
+ def struct_fields; FIELDS; end
365
+
366
+ def validate
367
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_family is unset!') unless @column_family
368
+ end
369
+
370
+ ::Thrift::Struct.generate_accessors self
371
+ end
372
+
373
+ # A slice range is a structure that stores basic range, ordering and limit information for a query that will return
374
+ # multiple columns. It could be thought of as Cassandra's version of LIMIT and ORDER BY
375
+ #
376
+ # @param start. The column name to start the slice with. This attribute is not required, though there is no default value,
377
+ # and can be safely set to '', i.e., an empty byte array, to start with the first column name. Otherwise, it
378
+ # must a valid value under the rules of the Comparator defined for the given ColumnFamily.
379
+ # @param finish. The column name to stop the slice at. This attribute is not required, though there is no default value,
380
+ # and can be safely set to an empty byte array to not stop until 'count' results are seen. Otherwise, it
381
+ # must also be a valid value to the ColumnFamily Comparator.
382
+ # @param reversed. Whether the results should be ordered in reversed order. Similar to ORDER BY blah DESC in SQL.
383
+ # @param count. How many columns to return. Similar to LIMIT in SQL. May be arbitrarily large, but Thrift will
384
+ # materialize the whole result into memory before returning it to the client, so be aware that you may
385
+ # be better served by iterating through slices by passing the last value of one call in as the 'start'
386
+ # of the next instead of increasing 'count' arbitrarily large.
387
+ class SliceRange
388
+ include ::Thrift::Struct, ::Thrift::Struct_Union
389
+ START = 1
390
+ FINISH = 2
391
+ REVERSED = 3
392
+ COUNT = 4
393
+
394
+ FIELDS = {
395
+ START => {:type => ::Thrift::Types::STRING, :name => 'start', :binary => true},
396
+ FINISH => {:type => ::Thrift::Types::STRING, :name => 'finish', :binary => true},
397
+ REVERSED => {:type => ::Thrift::Types::BOOL, :name => 'reversed', :default => false},
398
+ COUNT => {:type => ::Thrift::Types::I32, :name => 'count', :default => 100}
399
+ }
400
+
401
+ def struct_fields; FIELDS; end
402
+
403
+ def validate
404
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field start is unset!') unless @start
405
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field finish is unset!') unless @finish
406
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field reversed is unset!') if @reversed.nil?
407
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field count is unset!') unless @count
408
+ end
409
+
410
+ ::Thrift::Struct.generate_accessors self
411
+ end
412
+
413
+ # A SlicePredicate is similar to a mathematic predicate (see http://en.wikipedia.org/wiki/Predicate_(mathematical_logic)),
414
+ # which is described as "a property that the elements of a set have in common."
415
+ #
416
+ # SlicePredicate's in Cassandra are described with either a list of column_names or a SliceRange. If column_names is
417
+ # specified, slice_range is ignored.
418
+ #
419
+ # @param column_name. A list of column names to retrieve. This can be used similar to Memcached's "multi-get" feature
420
+ # to fetch N known column names. For instance, if you know you wish to fetch columns 'Joe', 'Jack',
421
+ # and 'Jim' you can pass those column names as a list to fetch all three at once.
422
+ # @param slice_range. A SliceRange describing how to range, order, and/or limit the slice.
423
+ class SlicePredicate
424
+ include ::Thrift::Struct, ::Thrift::Struct_Union
425
+ COLUMN_NAMES = 1
426
+ SLICE_RANGE = 2
427
+
428
+ FIELDS = {
429
+ COLUMN_NAMES => {:type => ::Thrift::Types::LIST, :name => 'column_names', :element => {:type => ::Thrift::Types::STRING, :binary => true}, :optional => true},
430
+ SLICE_RANGE => {:type => ::Thrift::Types::STRUCT, :name => 'slice_range', :class => CassandraThrift::SliceRange, :optional => true}
431
+ }
432
+
433
+ def struct_fields; FIELDS; end
434
+
435
+ def validate
436
+ end
437
+
438
+ ::Thrift::Struct.generate_accessors self
439
+ end
440
+
441
+ class IndexExpression
442
+ include ::Thrift::Struct, ::Thrift::Struct_Union
443
+ COLUMN_NAME = 1
444
+ OP = 2
445
+ VALUE = 3
446
+
447
+ FIELDS = {
448
+ COLUMN_NAME => {:type => ::Thrift::Types::STRING, :name => 'column_name', :binary => true},
449
+ OP => {:type => ::Thrift::Types::I32, :name => 'op', :enum_class => CassandraThrift::IndexOperator},
450
+ VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true}
451
+ }
452
+
453
+ def struct_fields; FIELDS; end
454
+
455
+ def validate
456
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_name is unset!') unless @column_name
457
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field op is unset!') unless @op
458
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') unless @value
459
+ unless @op.nil? || CassandraThrift::IndexOperator::VALID_VALUES.include?(@op)
460
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field op!')
461
+ end
462
+ end
463
+
464
+ ::Thrift::Struct.generate_accessors self
465
+ end
466
+
467
+ class IndexClause
468
+ include ::Thrift::Struct, ::Thrift::Struct_Union
469
+ EXPRESSIONS = 1
470
+ START_KEY = 2
471
+ COUNT = 3
472
+
473
+ FIELDS = {
474
+ EXPRESSIONS => {:type => ::Thrift::Types::LIST, :name => 'expressions', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::IndexExpression}},
475
+ START_KEY => {:type => ::Thrift::Types::STRING, :name => 'start_key', :binary => true},
476
+ COUNT => {:type => ::Thrift::Types::I32, :name => 'count', :default => 100}
477
+ }
478
+
479
+ def struct_fields; FIELDS; end
480
+
481
+ def validate
482
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field expressions is unset!') unless @expressions
483
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field start_key is unset!') unless @start_key
484
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field count is unset!') unless @count
485
+ end
486
+
487
+ ::Thrift::Struct.generate_accessors self
488
+ end
489
+
490
+ # The semantics of start keys and tokens are slightly different.
491
+ # Keys are start-inclusive; tokens are start-exclusive. Token
492
+ # ranges may also wrap -- that is, the end token may be less
493
+ # than the start one. Thus, a range from keyX to keyX is a
494
+ # one-element range, but a range from tokenY to tokenY is the
495
+ # full ring.
496
+ class KeyRange
497
+ include ::Thrift::Struct, ::Thrift::Struct_Union
498
+ START_KEY = 1
499
+ END_KEY = 2
500
+ START_TOKEN = 3
501
+ END_TOKEN = 4
502
+ COUNT = 5
503
+
504
+ FIELDS = {
505
+ START_KEY => {:type => ::Thrift::Types::STRING, :name => 'start_key', :binary => true, :optional => true},
506
+ END_KEY => {:type => ::Thrift::Types::STRING, :name => 'end_key', :binary => true, :optional => true},
507
+ START_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'start_token', :optional => true},
508
+ END_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'end_token', :optional => true},
509
+ COUNT => {:type => ::Thrift::Types::I32, :name => 'count', :default => 100}
510
+ }
511
+
512
+ def struct_fields; FIELDS; end
513
+
514
+ def validate
515
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field count is unset!') unless @count
516
+ end
517
+
518
+ ::Thrift::Struct.generate_accessors self
519
+ end
520
+
521
+ # A KeySlice is key followed by the data it maps to. A collection of KeySlice is returned by the get_range_slice operation.
522
+ #
523
+ # @param key. a row key
524
+ # @param columns. List of data represented by the key. Typically, the list is pared down to only the columns specified by
525
+ # a SlicePredicate.
526
+ class KeySlice
527
+ include ::Thrift::Struct, ::Thrift::Struct_Union
528
+ KEY = 1
529
+ COLUMNS = 2
530
+
531
+ FIELDS = {
532
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key', :binary => true},
533
+ COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}}
534
+ }
535
+
536
+ def struct_fields; FIELDS; end
537
+
538
+ def validate
539
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key
540
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns
541
+ end
542
+
543
+ ::Thrift::Struct.generate_accessors self
544
+ end
545
+
546
+ class KeyCount
547
+ include ::Thrift::Struct, ::Thrift::Struct_Union
548
+ KEY = 1
549
+ COUNT = 2
550
+
551
+ FIELDS = {
552
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key', :binary => true},
553
+ COUNT => {:type => ::Thrift::Types::I32, :name => 'count'}
554
+ }
555
+
556
+ def struct_fields; FIELDS; end
557
+
558
+ def validate
559
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key
560
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field count is unset!') unless @count
561
+ end
562
+
563
+ ::Thrift::Struct.generate_accessors self
564
+ end
565
+
566
+ # Note that the timestamp is only optional in case of counter deletion.
567
+ class Deletion
568
+ include ::Thrift::Struct, ::Thrift::Struct_Union
569
+ TIMESTAMP = 1
570
+ SUPER_COLUMN = 2
571
+ PREDICATE = 3
572
+
573
+ FIELDS = {
574
+ TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp', :optional => true},
575
+ SUPER_COLUMN => {:type => ::Thrift::Types::STRING, :name => 'super_column', :binary => true, :optional => true},
576
+ PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate, :optional => true}
577
+ }
578
+
579
+ def struct_fields; FIELDS; end
580
+
581
+ def validate
582
+ end
583
+
584
+ ::Thrift::Struct.generate_accessors self
585
+ end
586
+
587
+ # A Mutation is either an insert (represented by filling column_or_supercolumn) or a deletion (represented by filling the deletion attribute).
588
+ # @param column_or_supercolumn. An insert to a column or supercolumn (possibly counter column or supercolumn)
589
+ # @param deletion. A deletion of a column or supercolumn
590
+ class Mutation
591
+ include ::Thrift::Struct, ::Thrift::Struct_Union
592
+ COLUMN_OR_SUPERCOLUMN = 1
593
+ DELETION = 2
594
+
595
+ FIELDS = {
596
+ COLUMN_OR_SUPERCOLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'column_or_supercolumn', :class => CassandraThrift::ColumnOrSuperColumn, :optional => true},
597
+ DELETION => {:type => ::Thrift::Types::STRUCT, :name => 'deletion', :class => CassandraThrift::Deletion, :optional => true}
598
+ }
599
+
600
+ def struct_fields; FIELDS; end
601
+
602
+ def validate
603
+ end
604
+
605
+ ::Thrift::Struct.generate_accessors self
606
+ end
607
+
608
+ # A TokenRange describes part of the Cassandra ring, it is a mapping from a range to
609
+ # endpoints responsible for that range.
610
+ # @param start_token The first token in the range
611
+ # @param end_token The last token in the range
612
+ # @param endpoints The endpoints responsible for the range (listed by their configured listen_address)
613
+ # @param rpc_endpoints The endpoints responsible for the range (listed by their configured rpc_address)
614
+ class TokenRange
615
+ include ::Thrift::Struct, ::Thrift::Struct_Union
616
+ START_TOKEN = 1
617
+ END_TOKEN = 2
618
+ ENDPOINTS = 3
619
+ RPC_ENDPOINTS = 4
620
+
621
+ FIELDS = {
622
+ START_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'start_token'},
623
+ END_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'end_token'},
624
+ ENDPOINTS => {:type => ::Thrift::Types::LIST, :name => 'endpoints', :element => {:type => ::Thrift::Types::STRING}},
625
+ RPC_ENDPOINTS => {:type => ::Thrift::Types::LIST, :name => 'rpc_endpoints', :element => {:type => ::Thrift::Types::STRING}, :optional => true}
626
+ }
627
+
628
+ def struct_fields; FIELDS; end
629
+
630
+ def validate
631
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field start_token is unset!') unless @start_token
632
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field end_token is unset!') unless @end_token
633
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field endpoints is unset!') unless @endpoints
634
+ end
635
+
636
+ ::Thrift::Struct.generate_accessors self
637
+ end
638
+
639
+ # Authentication requests can contain any data, dependent on the IAuthenticator used
640
+ class AuthenticationRequest
641
+ include ::Thrift::Struct, ::Thrift::Struct_Union
642
+ CREDENTIALS = 1
643
+
644
+ FIELDS = {
645
+ CREDENTIALS => {:type => ::Thrift::Types::MAP, :name => 'credentials', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}
646
+ }
647
+
648
+ def struct_fields; FIELDS; end
649
+
650
+ def validate
651
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field credentials is unset!') unless @credentials
652
+ end
653
+
654
+ ::Thrift::Struct.generate_accessors self
655
+ end
656
+
657
+ class ColumnDef
658
+ include ::Thrift::Struct, ::Thrift::Struct_Union
659
+ NAME = 1
660
+ VALIDATION_CLASS = 2
661
+ INDEX_TYPE = 3
662
+ INDEX_NAME = 4
663
+ INDEX_OPTIONS = 5
664
+
665
+ FIELDS = {
666
+ NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :binary => true},
667
+ VALIDATION_CLASS => {:type => ::Thrift::Types::STRING, :name => 'validation_class'},
668
+ INDEX_TYPE => {:type => ::Thrift::Types::I32, :name => 'index_type', :optional => true, :enum_class => CassandraThrift::IndexType},
669
+ INDEX_NAME => {:type => ::Thrift::Types::STRING, :name => 'index_name', :optional => true},
670
+ INDEX_OPTIONS => {:type => ::Thrift::Types::MAP, :name => 'index_options', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true}
671
+ }
672
+
673
+ def struct_fields; FIELDS; end
674
+
675
+ def validate
676
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
677
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field validation_class is unset!') unless @validation_class
678
+ unless @index_type.nil? || CassandraThrift::IndexType::VALID_VALUES.include?(@index_type)
679
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field index_type!')
680
+ end
681
+ end
682
+
683
+ ::Thrift::Struct.generate_accessors self
684
+ end
685
+
686
+ class CfDef
687
+ include ::Thrift::Struct, ::Thrift::Struct_Union
688
+ KEYSPACE = 1
689
+ NAME = 2
690
+ COLUMN_TYPE = 3
691
+ COMPARATOR_TYPE = 5
692
+ SUBCOMPARATOR_TYPE = 6
693
+ COMMENT = 8
694
+ ROW_CACHE_SIZE = 9
695
+ KEY_CACHE_SIZE = 11
696
+ READ_REPAIR_CHANCE = 12
697
+ COLUMN_METADATA = 13
698
+ GC_GRACE_SECONDS = 14
699
+ DEFAULT_VALIDATION_CLASS = 15
700
+ ID = 16
701
+ MIN_COMPACTION_THRESHOLD = 17
702
+ MAX_COMPACTION_THRESHOLD = 18
703
+ ROW_CACHE_SAVE_PERIOD_IN_SECONDS = 19
704
+ KEY_CACHE_SAVE_PERIOD_IN_SECONDS = 20
705
+ REPLICATE_ON_WRITE = 24
706
+ MERGE_SHARDS_CHANCE = 25
707
+ KEY_VALIDATION_CLASS = 26
708
+ ROW_CACHE_PROVIDER = 27
709
+ KEY_ALIAS = 28
710
+ COMPACTION_STRATEGY = 29
711
+ COMPACTION_STRATEGY_OPTIONS = 30
712
+ ROW_CACHE_KEYS_TO_SAVE = 31
713
+ COMPRESSION_OPTIONS = 32
714
+
715
+ FIELDS = {
716
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
717
+ NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
718
+ COLUMN_TYPE => {:type => ::Thrift::Types::STRING, :name => 'column_type', :default => %q"Standard", :optional => true},
719
+ COMPARATOR_TYPE => {:type => ::Thrift::Types::STRING, :name => 'comparator_type', :default => %q"BytesType", :optional => true},
720
+ SUBCOMPARATOR_TYPE => {:type => ::Thrift::Types::STRING, :name => 'subcomparator_type', :optional => true},
721
+ COMMENT => {:type => ::Thrift::Types::STRING, :name => 'comment', :optional => true},
722
+ ROW_CACHE_SIZE => {:type => ::Thrift::Types::DOUBLE, :name => 'row_cache_size', :default => 0, :optional => true},
723
+ KEY_CACHE_SIZE => {:type => ::Thrift::Types::DOUBLE, :name => 'key_cache_size', :default => 200000, :optional => true},
724
+ READ_REPAIR_CHANCE => {:type => ::Thrift::Types::DOUBLE, :name => 'read_repair_chance', :default => 1, :optional => true},
725
+ COLUMN_METADATA => {:type => ::Thrift::Types::LIST, :name => 'column_metadata', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnDef}, :optional => true},
726
+ GC_GRACE_SECONDS => {:type => ::Thrift::Types::I32, :name => 'gc_grace_seconds', :optional => true},
727
+ DEFAULT_VALIDATION_CLASS => {:type => ::Thrift::Types::STRING, :name => 'default_validation_class', :optional => true},
728
+ ID => {:type => ::Thrift::Types::I32, :name => 'id', :optional => true},
729
+ MIN_COMPACTION_THRESHOLD => {:type => ::Thrift::Types::I32, :name => 'min_compaction_threshold', :optional => true},
730
+ MAX_COMPACTION_THRESHOLD => {:type => ::Thrift::Types::I32, :name => 'max_compaction_threshold', :optional => true},
731
+ ROW_CACHE_SAVE_PERIOD_IN_SECONDS => {:type => ::Thrift::Types::I32, :name => 'row_cache_save_period_in_seconds', :optional => true},
732
+ KEY_CACHE_SAVE_PERIOD_IN_SECONDS => {:type => ::Thrift::Types::I32, :name => 'key_cache_save_period_in_seconds', :optional => true},
733
+ REPLICATE_ON_WRITE => {:type => ::Thrift::Types::BOOL, :name => 'replicate_on_write', :optional => true},
734
+ MERGE_SHARDS_CHANCE => {:type => ::Thrift::Types::DOUBLE, :name => 'merge_shards_chance', :optional => true},
735
+ KEY_VALIDATION_CLASS => {:type => ::Thrift::Types::STRING, :name => 'key_validation_class', :optional => true},
736
+ ROW_CACHE_PROVIDER => {:type => ::Thrift::Types::STRING, :name => 'row_cache_provider', :optional => true},
737
+ KEY_ALIAS => {:type => ::Thrift::Types::STRING, :name => 'key_alias', :binary => true, :optional => true},
738
+ COMPACTION_STRATEGY => {:type => ::Thrift::Types::STRING, :name => 'compaction_strategy', :optional => true},
739
+ COMPACTION_STRATEGY_OPTIONS => {:type => ::Thrift::Types::MAP, :name => 'compaction_strategy_options', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true},
740
+ ROW_CACHE_KEYS_TO_SAVE => {:type => ::Thrift::Types::I32, :name => 'row_cache_keys_to_save', :optional => true},
741
+ COMPRESSION_OPTIONS => {:type => ::Thrift::Types::MAP, :name => 'compression_options', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true}
742
+ }
743
+
744
+ def struct_fields; FIELDS; end
745
+
746
+ def validate
747
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
748
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
749
+ end
750
+
751
+ ::Thrift::Struct.generate_accessors self
752
+ end
753
+
754
+ class KsDef
755
+ include ::Thrift::Struct, ::Thrift::Struct_Union
756
+ NAME = 1
757
+ STRATEGY_CLASS = 2
758
+ STRATEGY_OPTIONS = 3
759
+ REPLICATION_FACTOR = 4
760
+ CF_DEFS = 5
761
+ DURABLE_WRITES = 6
762
+
763
+ FIELDS = {
764
+ NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
765
+ STRATEGY_CLASS => {:type => ::Thrift::Types::STRING, :name => 'strategy_class'},
766
+ STRATEGY_OPTIONS => {:type => ::Thrift::Types::MAP, :name => 'strategy_options', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true},
767
+ # @deprecated
768
+ REPLICATION_FACTOR => {:type => ::Thrift::Types::I32, :name => 'replication_factor', :optional => true},
769
+ CF_DEFS => {:type => ::Thrift::Types::LIST, :name => 'cf_defs', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::CfDef}},
770
+ DURABLE_WRITES => {:type => ::Thrift::Types::BOOL, :name => 'durable_writes', :default => true, :optional => true}
771
+ }
772
+
773
+ def struct_fields; FIELDS; end
774
+
775
+ def validate
776
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
777
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field strategy_class is unset!') unless @strategy_class
778
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field cf_defs is unset!') unless @cf_defs
779
+ end
780
+
781
+ ::Thrift::Struct.generate_accessors self
782
+ end
783
+
784
+ # Row returned from a CQL query
785
+ class CqlRow
786
+ include ::Thrift::Struct, ::Thrift::Struct_Union
787
+ KEY = 1
788
+ COLUMNS = 2
789
+
790
+ FIELDS = {
791
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key', :binary => true},
792
+ COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::Column}}
793
+ }
794
+
795
+ def struct_fields; FIELDS; end
796
+
797
+ def validate
798
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key
799
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns
800
+ end
801
+
802
+ ::Thrift::Struct.generate_accessors self
803
+ end
804
+
805
+ class CqlMetadata
806
+ include ::Thrift::Struct, ::Thrift::Struct_Union
807
+ NAME_TYPES = 1
808
+ VALUE_TYPES = 2
809
+ DEFAULT_NAME_TYPE = 3
810
+ DEFAULT_VALUE_TYPE = 4
811
+
812
+ FIELDS = {
813
+ NAME_TYPES => {:type => ::Thrift::Types::MAP, :name => 'name_types', :key => {:type => ::Thrift::Types::STRING, :binary => true}, :value => {:type => ::Thrift::Types::STRING}},
814
+ VALUE_TYPES => {:type => ::Thrift::Types::MAP, :name => 'value_types', :key => {:type => ::Thrift::Types::STRING, :binary => true}, :value => {:type => ::Thrift::Types::STRING}},
815
+ DEFAULT_NAME_TYPE => {:type => ::Thrift::Types::STRING, :name => 'default_name_type'},
816
+ DEFAULT_VALUE_TYPE => {:type => ::Thrift::Types::STRING, :name => 'default_value_type'}
817
+ }
818
+
819
+ def struct_fields; FIELDS; end
820
+
821
+ def validate
822
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name_types is unset!') unless @name_types
823
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value_types is unset!') unless @value_types
824
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field default_name_type is unset!') unless @default_name_type
825
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field default_value_type is unset!') unless @default_value_type
826
+ end
827
+
828
+ ::Thrift::Struct.generate_accessors self
829
+ end
830
+
831
+ class CqlResult
832
+ include ::Thrift::Struct, ::Thrift::Struct_Union
833
+ TYPE = 1
834
+ ROWS = 2
835
+ NUM = 3
836
+ SCHEMA = 4
837
+
838
+ FIELDS = {
839
+ TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => CassandraThrift::CqlResultType},
840
+ ROWS => {:type => ::Thrift::Types::LIST, :name => 'rows', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::CqlRow}, :optional => true},
841
+ NUM => {:type => ::Thrift::Types::I32, :name => 'num', :optional => true},
842
+ SCHEMA => {:type => ::Thrift::Types::STRUCT, :name => 'schema', :class => CassandraThrift::CqlMetadata, :optional => true}
843
+ }
844
+
845
+ def struct_fields; FIELDS; end
846
+
847
+ def validate
848
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field type is unset!') unless @type
849
+ unless @type.nil? || CassandraThrift::CqlResultType::VALID_VALUES.include?(@type)
850
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
851
+ end
852
+ end
853
+
854
+ ::Thrift::Struct.generate_accessors self
855
+ end
856
+
857
+ end