sessionm-cassandra 1.0.0

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