hallelujah-cassandra-cql 1.0.4

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