cassandra-mavericks 0.21.1

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