jamesgolick-cassandra 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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"2.1.0"
11
+
12
+ end
@@ -0,0 +1,479 @@
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
+ ZERO = 0
11
+ ONE = 1
12
+ QUORUM = 2
13
+ DCQUORUM = 3
14
+ DCQUORUMSYNC = 4
15
+ ALL = 5
16
+ ANY = 6
17
+ VALUE_MAP = {0 => "ZERO", 1 => "ONE", 2 => "QUORUM", 3 => "DCQUORUM", 4 => "DCQUORUMSYNC", 5 => "ALL", 6 => "ANY"}
18
+ VALID_VALUES = Set.new([ZERO, ONE, QUORUM, DCQUORUM, DCQUORUMSYNC, ALL, ANY]).freeze
19
+ end
20
+
21
+ # Basic unit of data within a ColumnFamily.
22
+ # @param name. A column name can act both as structure (a label) or as data (like value). Regardless, the name of the column
23
+ # is used as a key to its value.
24
+ # @param value. Some data
25
+ # @param timestamp. Used to record when data was sent to be written.
26
+ class Column
27
+ include ::Thrift::Struct
28
+ NAME = 1
29
+ VALUE = 2
30
+ TIMESTAMP = 3
31
+
32
+ ::Thrift::Struct.field_accessor self, :name, :value, :timestamp
33
+ FIELDS = {
34
+ NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
35
+ VALUE => {:type => ::Thrift::Types::STRING, :name => 'value'},
36
+ TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'}
37
+ }
38
+
39
+ def struct_fields; FIELDS; end
40
+
41
+ def validate
42
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
43
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') unless @value
44
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field timestamp is unset!') unless @timestamp
45
+ end
46
+
47
+ end
48
+
49
+ # A named list of columns.
50
+ # @param name. see Column.name.
51
+ # @param columns. A collection of standard Columns. The columns within a super column are defined in an adhoc manner.
52
+ # Columns within a super column do not have to have matching structures (similarly named child columns).
53
+ class SuperColumn
54
+ include ::Thrift::Struct
55
+ NAME = 1
56
+ COLUMNS = 2
57
+
58
+ ::Thrift::Struct.field_accessor self, :name, :columns
59
+ FIELDS = {
60
+ NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
61
+ COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::Column}}
62
+ }
63
+
64
+ def struct_fields; FIELDS; end
65
+
66
+ def validate
67
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
68
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns
69
+ end
70
+
71
+ end
72
+
73
+ # Methods for fetching rows/records from Cassandra will return either a single instance of ColumnOrSuperColumn or a list
74
+ # of ColumnOrSuperColumns (get_slice()). If you're looking up a SuperColumn (or list of SuperColumns) then the resulting
75
+ # instances of ColumnOrSuperColumn will have the requested SuperColumn in the attribute super_column. For queries resulting
76
+ # in Columns, those values will be in the attribute column. This change was made between 0.3 and 0.4 to standardize on
77
+ # single query methods that may return either a SuperColumn or Column.
78
+ #
79
+ # @param column. The Column returned by get() or get_slice().
80
+ # @param super_column. The SuperColumn returned by get() or get_slice().
81
+ class ColumnOrSuperColumn
82
+ include ::Thrift::Struct
83
+ COLUMN = 1
84
+ SUPER_COLUMN = 2
85
+
86
+ ::Thrift::Struct.field_accessor self, :column, :super_column
87
+ FIELDS = {
88
+ COLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'column', :class => CassandraThrift::Column, :optional => true},
89
+ SUPER_COLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'super_column', :class => CassandraThrift::SuperColumn, :optional => true}
90
+ }
91
+
92
+ def struct_fields; FIELDS; end
93
+
94
+ def validate
95
+ end
96
+
97
+ end
98
+
99
+ # A specific column was requested that does not exist.
100
+ class NotFoundException < ::Thrift::Exception
101
+ include ::Thrift::Struct
102
+
103
+ FIELDS = {
104
+
105
+ }
106
+
107
+ def struct_fields; FIELDS; end
108
+
109
+ def validate
110
+ end
111
+
112
+ end
113
+
114
+ # Invalid request could mean keyspace or column family does not exist, required parameters are missing, or a parameter is malformed.
115
+ # why contains an associated error message.
116
+ class InvalidRequestException < ::Thrift::Exception
117
+ include ::Thrift::Struct
118
+ def initialize(message=nil)
119
+ super()
120
+ self.why = message
121
+ end
122
+
123
+ def message; why end
124
+
125
+ WHY = 1
126
+
127
+ ::Thrift::Struct.field_accessor self, :why
128
+ FIELDS = {
129
+ WHY => {:type => ::Thrift::Types::STRING, :name => 'why'}
130
+ }
131
+
132
+ def struct_fields; FIELDS; end
133
+
134
+ def validate
135
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field why is unset!') unless @why
136
+ end
137
+
138
+ end
139
+
140
+ # Not all the replicas required could be created and/or read.
141
+ class UnavailableException < ::Thrift::Exception
142
+ include ::Thrift::Struct
143
+
144
+ FIELDS = {
145
+
146
+ }
147
+
148
+ def struct_fields; FIELDS; end
149
+
150
+ def validate
151
+ end
152
+
153
+ end
154
+
155
+ # RPC timeout was exceeded. either a node failed mid-operation, or load was too high, or the requested op was too large.
156
+ class TimedOutException < ::Thrift::Exception
157
+ include ::Thrift::Struct
158
+
159
+ FIELDS = {
160
+
161
+ }
162
+
163
+ def struct_fields; FIELDS; end
164
+
165
+ def validate
166
+ end
167
+
168
+ end
169
+
170
+ # invalid authentication request (user does not exist or credentials invalid)
171
+ class AuthenticationException < ::Thrift::Exception
172
+ include ::Thrift::Struct
173
+ def initialize(message=nil)
174
+ super()
175
+ self.why = message
176
+ end
177
+
178
+ def message; why end
179
+
180
+ WHY = 1
181
+
182
+ ::Thrift::Struct.field_accessor self, :why
183
+ FIELDS = {
184
+ WHY => {:type => ::Thrift::Types::STRING, :name => 'why'}
185
+ }
186
+
187
+ def struct_fields; FIELDS; end
188
+
189
+ def validate
190
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field why is unset!') unless @why
191
+ end
192
+
193
+ end
194
+
195
+ # invalid authorization request (user does not have access to keyspace)
196
+ class AuthorizationException < ::Thrift::Exception
197
+ include ::Thrift::Struct
198
+ def initialize(message=nil)
199
+ super()
200
+ self.why = message
201
+ end
202
+
203
+ def message; why end
204
+
205
+ WHY = 1
206
+
207
+ ::Thrift::Struct.field_accessor self, :why
208
+ FIELDS = {
209
+ WHY => {:type => ::Thrift::Types::STRING, :name => 'why'}
210
+ }
211
+
212
+ def struct_fields; FIELDS; end
213
+
214
+ def validate
215
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field why is unset!') unless @why
216
+ end
217
+
218
+ end
219
+
220
+ # ColumnParent is used when selecting groups of columns from the same ColumnFamily. In directory structure terms, imagine
221
+ # ColumnParent as ColumnPath + '/../'.
222
+ #
223
+ # See also <a href="cassandra.html#Struct_ColumnPath">ColumnPath</a>
224
+ class ColumnParent
225
+ include ::Thrift::Struct
226
+ COLUMN_FAMILY = 3
227
+ SUPER_COLUMN = 4
228
+
229
+ ::Thrift::Struct.field_accessor self, :column_family, :super_column
230
+ FIELDS = {
231
+ COLUMN_FAMILY => {:type => ::Thrift::Types::STRING, :name => 'column_family'},
232
+ SUPER_COLUMN => {:type => ::Thrift::Types::STRING, :name => 'super_column', :optional => true}
233
+ }
234
+
235
+ def struct_fields; FIELDS; end
236
+
237
+ def validate
238
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_family is unset!') unless @column_family
239
+ end
240
+
241
+ end
242
+
243
+ # The ColumnPath is the path to a single column in Cassandra. It might make sense to think of ColumnPath and
244
+ # ColumnParent in terms of a directory structure.
245
+ #
246
+ # ColumnPath is used to looking up a single column.
247
+ #
248
+ # @param column_family. The name of the CF of the column being looked up.
249
+ # @param super_column. The super column name.
250
+ # @param column. The column name.
251
+ class ColumnPath
252
+ include ::Thrift::Struct
253
+ COLUMN_FAMILY = 3
254
+ SUPER_COLUMN = 4
255
+ COLUMN = 5
256
+
257
+ ::Thrift::Struct.field_accessor self, :column_family, :super_column, :column
258
+ FIELDS = {
259
+ COLUMN_FAMILY => {:type => ::Thrift::Types::STRING, :name => 'column_family'},
260
+ SUPER_COLUMN => {:type => ::Thrift::Types::STRING, :name => 'super_column', :optional => true},
261
+ COLUMN => {:type => ::Thrift::Types::STRING, :name => 'column', :optional => true}
262
+ }
263
+
264
+ def struct_fields; FIELDS; end
265
+
266
+ def validate
267
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_family is unset!') unless @column_family
268
+ end
269
+
270
+ end
271
+
272
+ # A slice range is a structure that stores basic range, ordering and limit information for a query that will return
273
+ # multiple columns. It could be thought of as Cassandra's version of LIMIT and ORDER BY
274
+ #
275
+ # @param start. The column name to start the slice with. This attribute is not required, though there is no default value,
276
+ # and can be safely set to '', i.e., an empty byte array, to start with the first column name. Otherwise, it
277
+ # must a valid value under the rules of the Comparator defined for the given ColumnFamily.
278
+ # @param finish. The column name to stop the slice at. This attribute is not required, though there is no default value,
279
+ # and can be safely set to an empty byte array to not stop until 'count' results are seen. Otherwise, it
280
+ # must also be a value value to the ColumnFamily Comparator.
281
+ # @param reversed. Whether the results should be ordered in reversed order. Similar to ORDER BY blah DESC in SQL.
282
+ # @param count. How many keys to return. Similar to LIMIT 100 in SQL. May be arbitrarily large, but Thrift will
283
+ # materialize the whole result into memory before returning it to the client, so be aware that you may
284
+ # be better served by iterating through slices by passing the last value of one call in as the 'start'
285
+ # of the next instead of increasing 'count' arbitrarily large.
286
+ class SliceRange
287
+ include ::Thrift::Struct
288
+ START = 1
289
+ FINISH = 2
290
+ REVERSED = 3
291
+ COUNT = 4
292
+
293
+ ::Thrift::Struct.field_accessor self, :start, :finish, :reversed, :count
294
+ FIELDS = {
295
+ START => {:type => ::Thrift::Types::STRING, :name => 'start'},
296
+ FINISH => {:type => ::Thrift::Types::STRING, :name => 'finish'},
297
+ REVERSED => {:type => ::Thrift::Types::BOOL, :name => 'reversed', :default => false},
298
+ COUNT => {:type => ::Thrift::Types::I32, :name => 'count', :default => 100}
299
+ }
300
+
301
+ def struct_fields; FIELDS; end
302
+
303
+ def validate
304
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field start is unset!') unless @start
305
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field finish is unset!') unless @finish
306
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field reversed is unset!') if @reversed.nil?
307
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field count is unset!') unless @count
308
+ end
309
+
310
+ end
311
+
312
+ # A SlicePredicate is similar to a mathematic predicate (see http://en.wikipedia.org/wiki/Predicate_(mathematical_logic)),
313
+ # which is described as "a property that the elements of a set have in common."
314
+ #
315
+ # SlicePredicate's in Cassandra are described with either a list of column_names or a SliceRange. If column_names is
316
+ # specified, slice_range is ignored.
317
+ #
318
+ # @param column_name. A list of column names to retrieve. This can be used similar to Memcached's "multi-get" feature
319
+ # to fetch N known column names. For instance, if you know you wish to fetch columns 'Joe', 'Jack',
320
+ # and 'Jim' you can pass those column names as a list to fetch all three at once.
321
+ # @param slice_range. A SliceRange describing how to range, order, and/or limit the slice.
322
+ class SlicePredicate
323
+ include ::Thrift::Struct
324
+ COLUMN_NAMES = 1
325
+ SLICE_RANGE = 2
326
+
327
+ ::Thrift::Struct.field_accessor self, :column_names, :slice_range
328
+ FIELDS = {
329
+ COLUMN_NAMES => {:type => ::Thrift::Types::LIST, :name => 'column_names', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
330
+ SLICE_RANGE => {:type => ::Thrift::Types::STRUCT, :name => 'slice_range', :class => CassandraThrift::SliceRange, :optional => true}
331
+ }
332
+
333
+ def struct_fields; FIELDS; end
334
+
335
+ def validate
336
+ end
337
+
338
+ end
339
+
340
+ # The semantics of start keys and tokens are slightly different.
341
+ # Keys are start-inclusive; tokens are start-exclusive. Token
342
+ # ranges may also wrap -- that is, the end token may be less
343
+ # than the start one. Thus, a range from keyX to keyX is a
344
+ # one-element range, but a range from tokenY to tokenY is the
345
+ # full ring.
346
+ class KeyRange
347
+ include ::Thrift::Struct
348
+ START_KEY = 1
349
+ END_KEY = 2
350
+ START_TOKEN = 3
351
+ END_TOKEN = 4
352
+ COUNT = 5
353
+
354
+ ::Thrift::Struct.field_accessor self, :start_key, :end_key, :start_token, :end_token, :count
355
+ FIELDS = {
356
+ START_KEY => {:type => ::Thrift::Types::STRING, :name => 'start_key', :optional => true},
357
+ END_KEY => {:type => ::Thrift::Types::STRING, :name => 'end_key', :optional => true},
358
+ START_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'start_token', :optional => true},
359
+ END_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'end_token', :optional => true},
360
+ COUNT => {:type => ::Thrift::Types::I32, :name => 'count', :default => 100}
361
+ }
362
+
363
+ def struct_fields; FIELDS; end
364
+
365
+ def validate
366
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field count is unset!') unless @count
367
+ end
368
+
369
+ end
370
+
371
+ # A KeySlice is key followed by the data it maps to. A collection of KeySlice is returned by the get_range_slice operation.
372
+ #
373
+ # @param key. a row key
374
+ # @param columns. List of data represented by the key. Typically, the list is pared down to only the columns specified by
375
+ # a SlicePredicate.
376
+ class KeySlice
377
+ include ::Thrift::Struct
378
+ KEY = 1
379
+ COLUMNS = 2
380
+
381
+ ::Thrift::Struct.field_accessor self, :key, :columns
382
+ FIELDS = {
383
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
384
+ COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}}
385
+ }
386
+
387
+ def struct_fields; FIELDS; end
388
+
389
+ def validate
390
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key
391
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns
392
+ end
393
+
394
+ end
395
+
396
+ class Deletion
397
+ include ::Thrift::Struct
398
+ TIMESTAMP = 1
399
+ SUPER_COLUMN = 2
400
+ PREDICATE = 3
401
+
402
+ ::Thrift::Struct.field_accessor self, :timestamp, :super_column, :predicate
403
+ FIELDS = {
404
+ TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'},
405
+ SUPER_COLUMN => {:type => ::Thrift::Types::STRING, :name => 'super_column', :optional => true},
406
+ PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate, :optional => true}
407
+ }
408
+
409
+ def struct_fields; FIELDS; end
410
+
411
+ def validate
412
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field timestamp is unset!') unless @timestamp
413
+ end
414
+
415
+ end
416
+
417
+ # A Mutation is either an insert, represented by filling column_or_supercolumn, or a deletion, represented by filling the deletion attribute.
418
+ # @param column_or_supercolumn. An insert to a column or supercolumn
419
+ # @param deletion. A deletion of a column or supercolumn
420
+ class Mutation
421
+ include ::Thrift::Struct
422
+ COLUMN_OR_SUPERCOLUMN = 1
423
+ DELETION = 2
424
+
425
+ ::Thrift::Struct.field_accessor self, :column_or_supercolumn, :deletion
426
+ FIELDS = {
427
+ COLUMN_OR_SUPERCOLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'column_or_supercolumn', :class => CassandraThrift::ColumnOrSuperColumn, :optional => true},
428
+ DELETION => {:type => ::Thrift::Types::STRUCT, :name => 'deletion', :class => CassandraThrift::Deletion, :optional => true}
429
+ }
430
+
431
+ def struct_fields; FIELDS; end
432
+
433
+ def validate
434
+ end
435
+
436
+ end
437
+
438
+ class TokenRange
439
+ include ::Thrift::Struct
440
+ START_TOKEN = 1
441
+ END_TOKEN = 2
442
+ ENDPOINTS = 3
443
+
444
+ ::Thrift::Struct.field_accessor self, :start_token, :end_token, :endpoints
445
+ FIELDS = {
446
+ START_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'start_token'},
447
+ END_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'end_token'},
448
+ ENDPOINTS => {:type => ::Thrift::Types::LIST, :name => 'endpoints', :element => {:type => ::Thrift::Types::STRING}}
449
+ }
450
+
451
+ def struct_fields; FIELDS; end
452
+
453
+ def validate
454
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field start_token is unset!') unless @start_token
455
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field end_token is unset!') unless @end_token
456
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field endpoints is unset!') unless @endpoints
457
+ end
458
+
459
+ end
460
+
461
+ # Authentication requests can contain any data, dependent on the AuthenticationBackend used
462
+ class AuthenticationRequest
463
+ include ::Thrift::Struct
464
+ CREDENTIALS = 1
465
+
466
+ ::Thrift::Struct.field_accessor self, :credentials
467
+ FIELDS = {
468
+ CREDENTIALS => {:type => ::Thrift::Types::MAP, :name => 'credentials', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}
469
+ }
470
+
471
+ def struct_fields; FIELDS; end
472
+
473
+ def validate
474
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field credentials is unset!') unless @credentials
475
+ end
476
+
477
+ end
478
+
479
+ end