cassilds 0.9.2 → 0.12.1

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