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