cassandra-mavericks 0.21.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/CHANGELOG +150 -0
- data/Gemfile +7 -0
- data/LICENSE +202 -0
- data/Manifest +94 -0
- data/README.md +373 -0
- data/Rakefile +191 -0
- data/bin/cassandra_helper +16 -0
- data/cassandra.gemspec +29 -0
- data/conf/0.6/cassandra.in.sh +47 -0
- data/conf/0.6/log4j.properties +38 -0
- data/conf/0.6/schema.json +57 -0
- data/conf/0.6/storage-conf.xml +352 -0
- data/conf/0.7/cassandra.in.sh +46 -0
- data/conf/0.7/cassandra.yaml +336 -0
- data/conf/0.7/log4j-server.properties +41 -0
- data/conf/0.7/schema.json +57 -0
- data/conf/0.7/schema.txt +45 -0
- data/conf/0.8/cassandra.in.sh +41 -0
- data/conf/0.8/cassandra.yaml +61 -0
- data/conf/0.8/log4j-server.properties +40 -0
- data/conf/0.8/schema.json +72 -0
- data/conf/0.8/schema.txt +57 -0
- data/conf/1.0/cassandra.in.sh +41 -0
- data/conf/1.0/cassandra.yaml +415 -0
- data/conf/1.0/log4j-server.properties +40 -0
- data/conf/1.0/schema.json +72 -0
- data/conf/1.0/schema.txt +57 -0
- data/conf/1.1/cassandra.in.sh +41 -0
- data/conf/1.1/cassandra.yaml +567 -0
- data/conf/1.1/log4j-server.properties +44 -0
- data/conf/1.1/schema.json +72 -0
- data/conf/1.1/schema.txt +57 -0
- data/conf/1.2/cassandra.in.sh +41 -0
- data/conf/1.2/cassandra.yaml +643 -0
- data/conf/1.2/log4j-server.properties +44 -0
- data/conf/1.2/schema.json +72 -0
- data/conf/1.2/schema.txt +57 -0
- data/ext/cassandra_native.c +69 -0
- data/ext/extconf.rb +9 -0
- data/lib/cassandra.rb +47 -0
- data/lib/cassandra/0.6.rb +7 -0
- data/lib/cassandra/0.6/cassandra.rb +113 -0
- data/lib/cassandra/0.6/columns.rb +78 -0
- data/lib/cassandra/0.6/protocol.rb +91 -0
- data/lib/cassandra/0.7.rb +7 -0
- data/lib/cassandra/0.7/cassandra.rb +2 -0
- data/lib/cassandra/0.7/columns.rb +4 -0
- data/lib/cassandra/0.7/protocol.rb +5 -0
- data/lib/cassandra/0.8.rb +7 -0
- data/lib/cassandra/0.8/cassandra.rb +25 -0
- data/lib/cassandra/0.8/columns.rb +28 -0
- data/lib/cassandra/0.8/protocol.rb +10 -0
- data/lib/cassandra/1.0.rb +7 -0
- data/lib/cassandra/1.0/cassandra.rb +1 -0
- data/lib/cassandra/1.0/columns.rb +1 -0
- data/lib/cassandra/1.0/protocol.rb +1 -0
- data/lib/cassandra/1.1.rb +7 -0
- data/lib/cassandra/1.1/cassandra.rb +1 -0
- data/lib/cassandra/1.1/columns.rb +1 -0
- data/lib/cassandra/1.1/protocol.rb +1 -0
- data/lib/cassandra/1.2.rb +7 -0
- data/lib/cassandra/1.2/cassandra.rb +1 -0
- data/lib/cassandra/1.2/columns.rb +1 -0
- data/lib/cassandra/1.2/protocol.rb +1 -0
- data/lib/cassandra/array.rb +8 -0
- data/lib/cassandra/batch.rb +41 -0
- data/lib/cassandra/cassandra.rb +1091 -0
- data/lib/cassandra/column_family.rb +3 -0
- data/lib/cassandra/columns.rb +172 -0
- data/lib/cassandra/comparable.rb +28 -0
- data/lib/cassandra/composite.rb +137 -0
- data/lib/cassandra/constants.rb +11 -0
- data/lib/cassandra/debug.rb +9 -0
- data/lib/cassandra/dynamic_composite.rb +118 -0
- data/lib/cassandra/helpers.rb +41 -0
- data/lib/cassandra/keyspace.rb +3 -0
- data/lib/cassandra/long.rb +58 -0
- data/lib/cassandra/mock.rb +536 -0
- data/lib/cassandra/ordered_hash.rb +195 -0
- data/lib/cassandra/protocol.rb +137 -0
- data/lib/cassandra/time.rb +11 -0
- data/test/cassandra_client_test.rb +20 -0
- data/test/cassandra_mock_test.rb +128 -0
- data/test/cassandra_test.rb +1367 -0
- data/test/comparable_types_test.rb +45 -0
- data/test/composite_type_test.rb +86 -0
- data/test/eventmachine_test.rb +42 -0
- data/test/ordered_hash_test.rb +386 -0
- data/test/test_helper.rb +19 -0
- data/vendor/0.6/gen-rb/cassandra.rb +1481 -0
- data/vendor/0.6/gen-rb/cassandra_constants.rb +12 -0
- data/vendor/0.6/gen-rb/cassandra_types.rb +482 -0
- data/vendor/0.7/gen-rb/cassandra.rb +1936 -0
- data/vendor/0.7/gen-rb/cassandra_constants.rb +12 -0
- data/vendor/0.7/gen-rb/cassandra_types.rb +681 -0
- data/vendor/0.8/gen-rb/cassandra.rb +2215 -0
- data/vendor/0.8/gen-rb/cassandra_constants.rb +12 -0
- data/vendor/0.8/gen-rb/cassandra_types.rb +824 -0
- data/vendor/1.0/gen-rb/cassandra.rb +2215 -0
- data/vendor/1.0/gen-rb/cassandra_constants.rb +12 -0
- data/vendor/1.0/gen-rb/cassandra_types.rb +857 -0
- data/vendor/1.1/gen-rb/cassandra.rb +2571 -0
- data/vendor/1.1/gen-rb/cassandra_constants.rb +12 -0
- data/vendor/1.1/gen-rb/cassandra_types.rb +928 -0
- data/vendor/1.2/gen-rb/cassandra.rb +3013 -0
- data/vendor/1.2/gen-rb/cassandra_constants.rb +13 -0
- data/vendor/1.2/gen-rb/cassandra_types.rb +965 -0
- metadata +288 -0
@@ -0,0 +1,482 @@
|
|
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, ::Thrift::Struct_Union
|
28
|
+
NAME = 1
|
29
|
+
VALUE = 2
|
30
|
+
TIMESTAMP = 3
|
31
|
+
|
32
|
+
FIELDS = {
|
33
|
+
NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :binary => true},
|
34
|
+
VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true},
|
35
|
+
TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'}
|
36
|
+
}
|
37
|
+
|
38
|
+
def struct_fields; FIELDS; end
|
39
|
+
|
40
|
+
def validate
|
41
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
|
42
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') unless @value
|
43
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field timestamp is unset!') unless @timestamp
|
44
|
+
end
|
45
|
+
|
46
|
+
::Thrift::Struct.generate_accessors self
|
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, ::Thrift::Struct_Union
|
55
|
+
NAME = 1
|
56
|
+
COLUMNS = 2
|
57
|
+
|
58
|
+
FIELDS = {
|
59
|
+
NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :binary => true},
|
60
|
+
COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::Column}}
|
61
|
+
}
|
62
|
+
|
63
|
+
def struct_fields; FIELDS; end
|
64
|
+
|
65
|
+
def validate
|
66
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
|
67
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns
|
68
|
+
end
|
69
|
+
|
70
|
+
::Thrift::Struct.generate_accessors self
|
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, ::Thrift::Struct_Union
|
83
|
+
COLUMN = 1
|
84
|
+
SUPER_COLUMN = 2
|
85
|
+
|
86
|
+
FIELDS = {
|
87
|
+
COLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'column', :class => CassandraThrift::Column, :optional => true},
|
88
|
+
SUPER_COLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'super_column', :class => CassandraThrift::SuperColumn, :optional => true}
|
89
|
+
}
|
90
|
+
|
91
|
+
def struct_fields; FIELDS; end
|
92
|
+
|
93
|
+
def validate
|
94
|
+
end
|
95
|
+
|
96
|
+
::Thrift::Struct.generate_accessors self
|
97
|
+
end
|
98
|
+
|
99
|
+
# A specific column was requested that does not exist.
|
100
|
+
class NotFoundException < ::Thrift::Exception
|
101
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
102
|
+
|
103
|
+
FIELDS = {
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
def struct_fields; FIELDS; end
|
108
|
+
|
109
|
+
def validate
|
110
|
+
end
|
111
|
+
|
112
|
+
::Thrift::Struct.generate_accessors self
|
113
|
+
end
|
114
|
+
|
115
|
+
# Invalid request could mean keyspace or column family does not exist, required parameters are missing, or a parameter is malformed.
|
116
|
+
# why contains an associated error message.
|
117
|
+
class InvalidRequestException < ::Thrift::Exception
|
118
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
119
|
+
def initialize(message=nil)
|
120
|
+
super()
|
121
|
+
self.why = message
|
122
|
+
end
|
123
|
+
|
124
|
+
def message; why end
|
125
|
+
|
126
|
+
WHY = 1
|
127
|
+
|
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
|
+
::Thrift::Struct.generate_accessors self
|
139
|
+
end
|
140
|
+
|
141
|
+
# Not all the replicas required could be created and/or read.
|
142
|
+
class UnavailableException < ::Thrift::Exception
|
143
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
144
|
+
|
145
|
+
FIELDS = {
|
146
|
+
|
147
|
+
}
|
148
|
+
|
149
|
+
def struct_fields; FIELDS; end
|
150
|
+
|
151
|
+
def validate
|
152
|
+
end
|
153
|
+
|
154
|
+
::Thrift::Struct.generate_accessors self
|
155
|
+
end
|
156
|
+
|
157
|
+
# RPC timeout was exceeded. either a node failed mid-operation, or load was too high, or the requested op was too large.
|
158
|
+
class TimedOutException < ::Thrift::Exception
|
159
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
160
|
+
|
161
|
+
FIELDS = {
|
162
|
+
|
163
|
+
}
|
164
|
+
|
165
|
+
def struct_fields; FIELDS; end
|
166
|
+
|
167
|
+
def validate
|
168
|
+
end
|
169
|
+
|
170
|
+
::Thrift::Struct.generate_accessors self
|
171
|
+
end
|
172
|
+
|
173
|
+
# invalid authentication request (user does not exist or credentials invalid)
|
174
|
+
class AuthenticationException < ::Thrift::Exception
|
175
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
176
|
+
def initialize(message=nil)
|
177
|
+
super()
|
178
|
+
self.why = message
|
179
|
+
end
|
180
|
+
|
181
|
+
def message; why end
|
182
|
+
|
183
|
+
WHY = 1
|
184
|
+
|
185
|
+
FIELDS = {
|
186
|
+
WHY => {:type => ::Thrift::Types::STRING, :name => 'why'}
|
187
|
+
}
|
188
|
+
|
189
|
+
def struct_fields; FIELDS; end
|
190
|
+
|
191
|
+
def validate
|
192
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field why is unset!') unless @why
|
193
|
+
end
|
194
|
+
|
195
|
+
::Thrift::Struct.generate_accessors self
|
196
|
+
end
|
197
|
+
|
198
|
+
# invalid authorization request (user does not have access to keyspace)
|
199
|
+
class AuthorizationException < ::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
|
+
# ColumnParent is used when selecting groups of columns from the same ColumnFamily. In directory structure terms, imagine
|
224
|
+
# ColumnParent as ColumnPath + '/../'.
|
225
|
+
#
|
226
|
+
# See also <a href="cassandra.html#Struct_ColumnPath">ColumnPath</a>
|
227
|
+
class ColumnParent
|
228
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
229
|
+
COLUMN_FAMILY = 3
|
230
|
+
SUPER_COLUMN = 4
|
231
|
+
|
232
|
+
FIELDS = {
|
233
|
+
COLUMN_FAMILY => {:type => ::Thrift::Types::STRING, :name => 'column_family'},
|
234
|
+
SUPER_COLUMN => {:type => ::Thrift::Types::STRING, :name => 'super_column', :binary => true, :optional => true}
|
235
|
+
}
|
236
|
+
|
237
|
+
def struct_fields; FIELDS; end
|
238
|
+
|
239
|
+
def validate
|
240
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_family is unset!') unless @column_family
|
241
|
+
end
|
242
|
+
|
243
|
+
::Thrift::Struct.generate_accessors self
|
244
|
+
end
|
245
|
+
|
246
|
+
# The ColumnPath is the path to a single column in Cassandra. It might make sense to think of ColumnPath and
|
247
|
+
# ColumnParent in terms of a directory structure.
|
248
|
+
#
|
249
|
+
# ColumnPath is used to looking up a single column.
|
250
|
+
#
|
251
|
+
# @param column_family. The name of the CF of the column being looked up.
|
252
|
+
# @param super_column. The super column name.
|
253
|
+
# @param column. The column name.
|
254
|
+
class ColumnPath
|
255
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
256
|
+
COLUMN_FAMILY = 3
|
257
|
+
SUPER_COLUMN = 4
|
258
|
+
COLUMN = 5
|
259
|
+
|
260
|
+
FIELDS = {
|
261
|
+
COLUMN_FAMILY => {:type => ::Thrift::Types::STRING, :name => 'column_family'},
|
262
|
+
SUPER_COLUMN => {:type => ::Thrift::Types::STRING, :name => 'super_column', :binary => true, :optional => true},
|
263
|
+
COLUMN => {:type => ::Thrift::Types::STRING, :name => 'column', :binary => true, :optional => true}
|
264
|
+
}
|
265
|
+
|
266
|
+
def struct_fields; FIELDS; end
|
267
|
+
|
268
|
+
def validate
|
269
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_family is unset!') unless @column_family
|
270
|
+
end
|
271
|
+
|
272
|
+
::Thrift::Struct.generate_accessors self
|
273
|
+
end
|
274
|
+
|
275
|
+
# A slice range is a structure that stores basic range, ordering and limit information for a query that will return
|
276
|
+
# multiple columns. It could be thought of as Cassandra's version of LIMIT and ORDER BY
|
277
|
+
#
|
278
|
+
# @param start. The column name to start the slice with. This attribute is not required, though there is no default value,
|
279
|
+
# and can be safely set to '', i.e., an empty byte array, to start with the first column name. Otherwise, it
|
280
|
+
# must a valid value under the rules of the Comparator defined for the given ColumnFamily.
|
281
|
+
# @param finish. The column name to stop the slice at. This attribute is not required, though there is no default value,
|
282
|
+
# and can be safely set to an empty byte array to not stop until 'count' results are seen. Otherwise, it
|
283
|
+
# must also be a value value to the ColumnFamily Comparator.
|
284
|
+
# @param reversed. Whether the results should be ordered in reversed order. Similar to ORDER BY blah DESC in SQL.
|
285
|
+
# @param count. How many keys to return. Similar to LIMIT 100 in SQL. May be arbitrarily large, but Thrift will
|
286
|
+
# materialize the whole result into memory before returning it to the client, so be aware that you may
|
287
|
+
# be better served by iterating through slices by passing the last value of one call in as the 'start'
|
288
|
+
# of the next instead of increasing 'count' arbitrarily large.
|
289
|
+
class SliceRange
|
290
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
291
|
+
START = 1
|
292
|
+
FINISH = 2
|
293
|
+
REVERSED = 3
|
294
|
+
COUNT = 4
|
295
|
+
|
296
|
+
FIELDS = {
|
297
|
+
START => {:type => ::Thrift::Types::STRING, :name => 'start', :binary => true},
|
298
|
+
FINISH => {:type => ::Thrift::Types::STRING, :name => 'finish', :binary => true},
|
299
|
+
REVERSED => {:type => ::Thrift::Types::BOOL, :name => 'reversed', :default => false},
|
300
|
+
COUNT => {:type => ::Thrift::Types::I32, :name => 'count', :default => 100}
|
301
|
+
}
|
302
|
+
|
303
|
+
def struct_fields; FIELDS; end
|
304
|
+
|
305
|
+
def validate
|
306
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field start is unset!') unless @start
|
307
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field finish is unset!') unless @finish
|
308
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field reversed is unset!') if @reversed.nil?
|
309
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field count is unset!') unless @count
|
310
|
+
end
|
311
|
+
|
312
|
+
::Thrift::Struct.generate_accessors self
|
313
|
+
end
|
314
|
+
|
315
|
+
# A SlicePredicate is similar to a mathematic predicate (see http://en.wikipedia.org/wiki/Predicate_(mathematical_logic)),
|
316
|
+
# which is described as "a property that the elements of a set have in common."
|
317
|
+
#
|
318
|
+
# SlicePredicate's in Cassandra are described with either a list of column_names or a SliceRange. If column_names is
|
319
|
+
# specified, slice_range is ignored.
|
320
|
+
#
|
321
|
+
# @param column_name. A list of column names to retrieve. This can be used similar to Memcached's "multi-get" feature
|
322
|
+
# to fetch N known column names. For instance, if you know you wish to fetch columns 'Joe', 'Jack',
|
323
|
+
# and 'Jim' you can pass those column names as a list to fetch all three at once.
|
324
|
+
# @param slice_range. A SliceRange describing how to range, order, and/or limit the slice.
|
325
|
+
class SlicePredicate
|
326
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
327
|
+
COLUMN_NAMES = 1
|
328
|
+
SLICE_RANGE = 2
|
329
|
+
|
330
|
+
FIELDS = {
|
331
|
+
COLUMN_NAMES => {:type => ::Thrift::Types::LIST, :name => 'column_names', :element => {:type => ::Thrift::Types::STRING, :binary => true}, :optional => true},
|
332
|
+
SLICE_RANGE => {:type => ::Thrift::Types::STRUCT, :name => 'slice_range', :class => CassandraThrift::SliceRange, :optional => true}
|
333
|
+
}
|
334
|
+
|
335
|
+
def struct_fields; FIELDS; end
|
336
|
+
|
337
|
+
def validate
|
338
|
+
end
|
339
|
+
|
340
|
+
::Thrift::Struct.generate_accessors self
|
341
|
+
end
|
342
|
+
|
343
|
+
# The semantics of start keys and tokens are slightly different.
|
344
|
+
# Keys are start-inclusive; tokens are start-exclusive. Token
|
345
|
+
# ranges may also wrap -- that is, the end token may be less
|
346
|
+
# than the start one. Thus, a range from keyX to keyX is a
|
347
|
+
# one-element range, but a range from tokenY to tokenY is the
|
348
|
+
# full ring.
|
349
|
+
class KeyRange
|
350
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
351
|
+
START_KEY = 1
|
352
|
+
END_KEY = 2
|
353
|
+
START_TOKEN = 3
|
354
|
+
END_TOKEN = 4
|
355
|
+
COUNT = 5
|
356
|
+
|
357
|
+
FIELDS = {
|
358
|
+
START_KEY => {:type => ::Thrift::Types::STRING, :name => 'start_key', :optional => true},
|
359
|
+
END_KEY => {:type => ::Thrift::Types::STRING, :name => 'end_key', :optional => true},
|
360
|
+
START_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'start_token', :optional => true},
|
361
|
+
END_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'end_token', :optional => true},
|
362
|
+
COUNT => {:type => ::Thrift::Types::I32, :name => 'count', :default => 100}
|
363
|
+
}
|
364
|
+
|
365
|
+
def struct_fields; FIELDS; end
|
366
|
+
|
367
|
+
def validate
|
368
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field count is unset!') unless @count
|
369
|
+
end
|
370
|
+
|
371
|
+
::Thrift::Struct.generate_accessors self
|
372
|
+
end
|
373
|
+
|
374
|
+
# A KeySlice is key followed by the data it maps to. A collection of KeySlice is returned by the get_range_slice operation.
|
375
|
+
#
|
376
|
+
# @param key. a row key
|
377
|
+
# @param columns. List of data represented by the key. Typically, the list is pared down to only the columns specified by
|
378
|
+
# a SlicePredicate.
|
379
|
+
class KeySlice
|
380
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
381
|
+
KEY = 1
|
382
|
+
COLUMNS = 2
|
383
|
+
|
384
|
+
FIELDS = {
|
385
|
+
KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
|
386
|
+
COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}}
|
387
|
+
}
|
388
|
+
|
389
|
+
def struct_fields; FIELDS; end
|
390
|
+
|
391
|
+
def validate
|
392
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key
|
393
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns
|
394
|
+
end
|
395
|
+
|
396
|
+
::Thrift::Struct.generate_accessors self
|
397
|
+
end
|
398
|
+
|
399
|
+
class Deletion
|
400
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
401
|
+
TIMESTAMP = 1
|
402
|
+
SUPER_COLUMN = 2
|
403
|
+
PREDICATE = 3
|
404
|
+
|
405
|
+
FIELDS = {
|
406
|
+
TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'},
|
407
|
+
SUPER_COLUMN => {:type => ::Thrift::Types::STRING, :name => 'super_column', :binary => true, :optional => true},
|
408
|
+
PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate, :optional => true}
|
409
|
+
}
|
410
|
+
|
411
|
+
def struct_fields; FIELDS; end
|
412
|
+
|
413
|
+
def validate
|
414
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field timestamp is unset!') unless @timestamp
|
415
|
+
end
|
416
|
+
|
417
|
+
::Thrift::Struct.generate_accessors self
|
418
|
+
end
|
419
|
+
|
420
|
+
# A Mutation is either an insert, represented by filling column_or_supercolumn, or a deletion, represented by filling the deletion attribute.
|
421
|
+
# @param column_or_supercolumn. An insert to a column or supercolumn
|
422
|
+
# @param deletion. A deletion of a column or supercolumn
|
423
|
+
class Mutation
|
424
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
425
|
+
COLUMN_OR_SUPERCOLUMN = 1
|
426
|
+
DELETION = 2
|
427
|
+
|
428
|
+
FIELDS = {
|
429
|
+
COLUMN_OR_SUPERCOLUMN => {:type => ::Thrift::Types::STRUCT, :name => 'column_or_supercolumn', :class => CassandraThrift::ColumnOrSuperColumn, :optional => true},
|
430
|
+
DELETION => {:type => ::Thrift::Types::STRUCT, :name => 'deletion', :class => CassandraThrift::Deletion, :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 TokenRange
|
442
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
443
|
+
START_TOKEN = 1
|
444
|
+
END_TOKEN = 2
|
445
|
+
ENDPOINTS = 3
|
446
|
+
|
447
|
+
FIELDS = {
|
448
|
+
START_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'start_token'},
|
449
|
+
END_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'end_token'},
|
450
|
+
ENDPOINTS => {:type => ::Thrift::Types::LIST, :name => 'endpoints', :element => {:type => ::Thrift::Types::STRING}}
|
451
|
+
}
|
452
|
+
|
453
|
+
def struct_fields; FIELDS; end
|
454
|
+
|
455
|
+
def validate
|
456
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field start_token is unset!') unless @start_token
|
457
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field end_token is unset!') unless @end_token
|
458
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field endpoints is unset!') unless @endpoints
|
459
|
+
end
|
460
|
+
|
461
|
+
::Thrift::Struct.generate_accessors self
|
462
|
+
end
|
463
|
+
|
464
|
+
# Authentication requests can contain any data, dependent on the AuthenticationBackend used
|
465
|
+
class AuthenticationRequest
|
466
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
467
|
+
CREDENTIALS = 1
|
468
|
+
|
469
|
+
FIELDS = {
|
470
|
+
CREDENTIALS => {:type => ::Thrift::Types::MAP, :name => 'credentials', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}
|
471
|
+
}
|
472
|
+
|
473
|
+
def struct_fields; FIELDS; end
|
474
|
+
|
475
|
+
def validate
|
476
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field credentials is unset!') unless @credentials
|
477
|
+
end
|
478
|
+
|
479
|
+
::Thrift::Struct.generate_accessors self
|
480
|
+
end
|
481
|
+
|
482
|
+
end
|