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,45 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/test_helper')
2
+
3
+ class ComparableTypesTest < Test::Unit::TestCase
4
+ include Cassandra::Constants
5
+
6
+ def test_long_sort
7
+ ary = []
8
+ 10.times { ary << Long.new }
9
+ assert_equal ary.sort, ary
10
+ end
11
+
12
+ def test_long_equality
13
+ long = Long.new
14
+ assert_equal long, Long.new(long)
15
+ assert_equal long, Long.new(long.to_s)
16
+ assert_equal long, Long.new(long.to_i)
17
+ assert_equal long, Long.new(long.to_guid)
18
+ end
19
+
20
+ def test_long_error
21
+ assert_raises(Cassandra::Comparable::TypeError) do
22
+ Long.new("bogus")
23
+ end
24
+ end
25
+
26
+ def test_types_behave_well
27
+ assert !(Long.new() == false)
28
+ end
29
+
30
+ def test_casting_unknown_class
31
+ assert_raises(Cassandra::Comparable::TypeError) do
32
+ Cassandra::Long.new({})
33
+ end
34
+ end
35
+
36
+ def test_long_inspect
37
+ obj = Long.new("\000\000\000\000\000\000\000\000")
38
+ if RUBY_VERSION < '1.9'
39
+ assert_equal "<Cassandra::Long##{obj.object_id} time: Thu Jan 01 00:00:00 UTC 1970, usecs: 0, jitter: 0, guid: 00000000-0000-0000>", obj.inspect
40
+ else
41
+ assert_equal "<Cassandra::Long##{obj.object_id} time: 1970-01-01 00:00:00 UTC, usecs: 0, jitter: 0, guid: 00000000-0000-0000>", obj.inspect
42
+ end
43
+ end
44
+
45
+ end
@@ -0,0 +1,42 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/test_helper')
2
+
3
+ if RUBY_VERSION < '1.9'
4
+ puts "Skipping EventMachine test"
5
+ else
6
+
7
+ require 'thrift_client/event_machine'
8
+
9
+ class EventmachineTest < Test::Unit::TestCase
10
+
11
+ def test_twitter
12
+ @twitter = Cassandra.new('Twitter', "127.0.0.1:9160", :retries => 2, :exception_classes => [], :transport => Thrift::EventMachineTransport, :transport_wrapper => nil)
13
+ @twitter.clear_keyspace!
14
+ end
15
+
16
+ private
17
+
18
+ def em_test(name)
19
+ EM.run do
20
+ Fiber.new do
21
+ begin
22
+ send("raw_#{name}".to_sym)
23
+ ensure
24
+ EM.stop
25
+ end
26
+ end.resume
27
+ end
28
+ end
29
+
30
+ def self.wrap_tests
31
+ self.public_instance_methods.select { |m| m =~ /^test_/ }.each do |meth|
32
+ alias_method :"raw_#{meth}", meth
33
+ define_method(meth) do
34
+ em_test(meth)
35
+ end
36
+ end
37
+ end
38
+
39
+ wrap_tests
40
+
41
+ end
42
+ end
@@ -0,0 +1,201 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/test_helper')
2
+
3
+ class OrderedHashTest < Test::Unit::TestCase
4
+ def setup
5
+ @keys = %w( blue green red pink orange )
6
+ @values = %w( 000099 009900 aa0000 cc0066 cc6633 )
7
+ @hash = Hash.new
8
+ @ordered_hash = Cassandra::OrderedHash.new
9
+
10
+ @keys.each_with_index do |key, index|
11
+ @hash[key] = @values[index]
12
+ @ordered_hash[key] = @values[index]
13
+ end
14
+ end
15
+
16
+ def test_order
17
+ assert_equal @keys, @ordered_hash.keys
18
+ assert_equal @values, @ordered_hash.values
19
+ end
20
+
21
+ def test_access
22
+ assert @hash.all? { |k, v| @ordered_hash[k] == v }
23
+ end
24
+
25
+ def test_assignment
26
+ key, value = 'purple', '5422a8'
27
+
28
+ @ordered_hash[key] = value
29
+ assert_equal @keys.length + 1, @ordered_hash.length
30
+ assert_equal key, @ordered_hash.keys.last
31
+ assert_equal value, @ordered_hash.values.last
32
+ assert_equal value, @ordered_hash[key]
33
+ end
34
+
35
+ def test_delete
36
+ key, value = 'white', 'ffffff'
37
+ bad_key = 'black'
38
+
39
+ @ordered_hash[key] = value
40
+ assert_equal @keys.length + 1, @ordered_hash.length
41
+ assert_equal @ordered_hash.keys.length, @ordered_hash.length
42
+
43
+ assert_equal value, @ordered_hash.delete(key)
44
+ assert_equal @keys.length, @ordered_hash.length
45
+ assert_equal @ordered_hash.keys.length, @ordered_hash.length
46
+
47
+ assert_nil @ordered_hash.delete(bad_key)
48
+ end
49
+
50
+ def test_to_hash
51
+ assert_same @ordered_hash, @ordered_hash.to_hash
52
+ end
53
+
54
+ def test_to_a
55
+ assert_equal @keys.zip(@values), @ordered_hash.to_a
56
+ end
57
+
58
+ def test_has_key
59
+ assert_equal true, @ordered_hash.has_key?('blue')
60
+ assert_equal true, @ordered_hash.key?('blue')
61
+ assert_equal true, @ordered_hash.include?('blue')
62
+ assert_equal true, @ordered_hash.member?('blue')
63
+
64
+ assert_equal false, @ordered_hash.has_key?('indigo')
65
+ assert_equal false, @ordered_hash.key?('indigo')
66
+ assert_equal false, @ordered_hash.include?('indigo')
67
+ assert_equal false, @ordered_hash.member?('indigo')
68
+ end
69
+
70
+ def test_has_value
71
+ assert_equal true, @ordered_hash.has_value?('000099')
72
+ assert_equal true, @ordered_hash.value?('000099')
73
+ assert_equal false, @ordered_hash.has_value?('ABCABC')
74
+ assert_equal false, @ordered_hash.value?('ABCABC')
75
+ end
76
+
77
+ def test_each_key
78
+ keys = []
79
+ @ordered_hash.each_key { |k| keys << k }
80
+ assert_equal @keys, keys
81
+ end
82
+
83
+ def test_each_value
84
+ values = []
85
+ @ordered_hash.each_value { |v| values << v }
86
+ assert_equal @values, values
87
+ end
88
+
89
+ def test_each
90
+ values = []
91
+ @ordered_hash.each {|key, value| values << value}
92
+ assert_equal @values, values
93
+ end
94
+
95
+ def test_each_with_index
96
+ @ordered_hash.each_with_index { |pair, index| assert_equal [@keys[index], @values[index]], pair}
97
+ end
98
+
99
+ def test_each_pair
100
+ values = []
101
+ keys = []
102
+ @ordered_hash.each_pair do |key, value|
103
+ keys << key
104
+ values << value
105
+ end
106
+ assert_equal @values, values
107
+ assert_equal @keys, keys
108
+ end
109
+
110
+ def test_delete_if
111
+ copy = @ordered_hash.dup
112
+ copy.delete('pink')
113
+ assert_equal copy, @ordered_hash.delete_if { |k, _| k == 'pink' }
114
+ assert !@ordered_hash.keys.include?('pink')
115
+ end
116
+
117
+ def test_reject!
118
+ (copy = @ordered_hash.dup).delete('pink')
119
+ @ordered_hash.reject! { |k, _| k == 'pink' }
120
+ assert_equal copy, @ordered_hash
121
+ assert !@ordered_hash.keys.include?('pink')
122
+ end
123
+
124
+ def test_reject
125
+ copy = @ordered_hash.dup
126
+ new_ordered_hash = @ordered_hash.reject { |k, _| k == 'pink' }
127
+ assert_equal copy, @ordered_hash
128
+ assert !new_ordered_hash.keys.include?('pink')
129
+ assert @ordered_hash.keys.include?('pink')
130
+ end
131
+
132
+ def test_clear
133
+ @ordered_hash.clear
134
+ assert_equal [], @ordered_hash.keys
135
+ end
136
+
137
+ def test_merge
138
+ other_hash = Cassandra::OrderedHash.new
139
+ other_hash['purple'] = '800080'
140
+ other_hash['violet'] = 'ee82ee'
141
+ merged = @ordered_hash.merge other_hash
142
+ assert_equal merged.length, @ordered_hash.length + other_hash.length
143
+ assert_equal @keys + ['purple', 'violet'], merged.keys
144
+
145
+ @ordered_hash.merge! other_hash
146
+ assert_equal @ordered_hash, merged
147
+ assert_equal @ordered_hash.keys, merged.keys
148
+ end
149
+
150
+ def test_shift
151
+ pair = @ordered_hash.shift
152
+ assert_equal [@keys.first, @values.first], pair
153
+ assert !@ordered_hash.keys.include?(pair.first)
154
+ end
155
+
156
+ def test_keys
157
+ original = @ordered_hash.keys.dup
158
+ @ordered_hash.keys.pop
159
+ assert_equal original, @ordered_hash.keys
160
+ end
161
+
162
+ def test_inspect
163
+ assert @ordered_hash.inspect.include?(@hash.inspect)
164
+ end
165
+
166
+ def test_alternate_initialization_with_splat
167
+ alternate = Cassandra::OrderedHash[1,2,3,4]
168
+ assert_kind_of Cassandra::OrderedHash, alternate
169
+ assert_equal [1, 3], alternate.keys
170
+ end
171
+
172
+ def test_alternate_initialization_with_array
173
+ alternate = Cassandra::OrderedHash[ [
174
+ [1, 2],
175
+ [3, 4],
176
+ "bad key value pair",
177
+ [ 'missing value' ]
178
+ ]]
179
+
180
+ assert_kind_of Cassandra::OrderedHash, alternate
181
+ assert_equal [1, 3, 'missing value'], alternate.keys
182
+ assert_equal [2, 4, nil ], alternate.values
183
+ end
184
+
185
+ def test_alternate_initialization_raises_exception_on_odd_length_args
186
+ begin
187
+ alternate = Cassandra::OrderedHash[1,2,3,4,5]
188
+ flunk "Hash::[] should have raised an exception on initialization " +
189
+ "with an odd number of parameters"
190
+ rescue
191
+ assert_equal "odd number of arguments for Hash", $!.message
192
+ end
193
+ end
194
+
195
+ def test_replace_updates_keys
196
+ @other_ordered_hash = Cassandra::OrderedHash[:black, '000000', :white, '000000']
197
+ original = @ordered_hash.replace(@other_ordered_hash)
198
+ assert_same original, @ordered_hash
199
+ assert_equal @other_ordered_hash.keys, @ordered_hash.keys
200
+ end
201
+ end
@@ -0,0 +1,14 @@
1
+
2
+ require 'test/unit'
3
+ require "#{File.expand_path(File.dirname(__FILE__))}/../lib/cassandra"
4
+ begin; require 'ruby-debug'; rescue LoadError; end
5
+
6
+ begin
7
+ @test_client = Cassandra.new('Twitter', 'localhost:9160', {:exception_classes => []})
8
+ rescue Thrift::TransportException => e
9
+ #FIXME Make server automatically start if not running
10
+ if e.message =~ /Could not connect/
11
+ puts "*** Please start the Cassandra server by running 'rake cassandra'. ***"
12
+ exit 1
13
+ end
14
+ end
@@ -0,0 +1,1477 @@
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 'thrift'
8
+ require 'cassandra_types'
9
+
10
+ module CassandraThrift
11
+ module Cassandra
12
+ class Client
13
+ include ::Thrift::Client
14
+
15
+ def login(keyspace, auth_request)
16
+ send_login(keyspace, auth_request)
17
+ recv_login()
18
+ end
19
+
20
+ def send_login(keyspace, auth_request)
21
+ send_message('login', Login_args, :keyspace => keyspace, :auth_request => auth_request)
22
+ end
23
+
24
+ def recv_login()
25
+ result = receive_message(Login_result)
26
+ raise result.authnx unless result.authnx.nil?
27
+ raise result.authzx unless result.authzx.nil?
28
+ return
29
+ end
30
+
31
+ def get(keyspace, key, column_path, consistency_level)
32
+ send_get(keyspace, key, column_path, consistency_level)
33
+ return recv_get()
34
+ end
35
+
36
+ def send_get(keyspace, key, column_path, consistency_level)
37
+ send_message('get', Get_args, :keyspace => keyspace, :key => key, :column_path => column_path, :consistency_level => consistency_level)
38
+ end
39
+
40
+ def recv_get()
41
+ result = receive_message(Get_result)
42
+ return result.success unless result.success.nil?
43
+ raise result.ire unless result.ire.nil?
44
+ raise result.nfe unless result.nfe.nil?
45
+ raise result.ue unless result.ue.nil?
46
+ raise result.te unless result.te.nil?
47
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get failed: unknown result')
48
+ end
49
+
50
+ def get_slice(keyspace, key, column_parent, predicate, consistency_level)
51
+ send_get_slice(keyspace, key, column_parent, predicate, consistency_level)
52
+ return recv_get_slice()
53
+ end
54
+
55
+ def send_get_slice(keyspace, key, column_parent, predicate, consistency_level)
56
+ send_message('get_slice', Get_slice_args, :keyspace => keyspace, :key => key, :column_parent => column_parent, :predicate => predicate, :consistency_level => consistency_level)
57
+ end
58
+
59
+ def recv_get_slice()
60
+ result = receive_message(Get_slice_result)
61
+ return result.success unless result.success.nil?
62
+ raise result.ire unless result.ire.nil?
63
+ raise result.ue unless result.ue.nil?
64
+ raise result.te unless result.te.nil?
65
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_slice failed: unknown result')
66
+ end
67
+
68
+ def multiget(keyspace, keys, column_path, consistency_level)
69
+ send_multiget(keyspace, keys, column_path, consistency_level)
70
+ return recv_multiget()
71
+ end
72
+
73
+ def send_multiget(keyspace, keys, column_path, consistency_level)
74
+ send_message('multiget', Multiget_args, :keyspace => keyspace, :keys => keys, :column_path => column_path, :consistency_level => consistency_level)
75
+ end
76
+
77
+ def recv_multiget()
78
+ result = receive_message(Multiget_result)
79
+ return result.success unless result.success.nil?
80
+ raise result.ire unless result.ire.nil?
81
+ raise result.ue unless result.ue.nil?
82
+ raise result.te unless result.te.nil?
83
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'multiget failed: unknown result')
84
+ end
85
+
86
+ def multiget_slice(keyspace, keys, column_parent, predicate, consistency_level)
87
+ send_multiget_slice(keyspace, keys, column_parent, predicate, consistency_level)
88
+ return recv_multiget_slice()
89
+ end
90
+
91
+ def send_multiget_slice(keyspace, keys, column_parent, predicate, consistency_level)
92
+ send_message('multiget_slice', Multiget_slice_args, :keyspace => keyspace, :keys => keys, :column_parent => column_parent, :predicate => predicate, :consistency_level => consistency_level)
93
+ end
94
+
95
+ def recv_multiget_slice()
96
+ result = receive_message(Multiget_slice_result)
97
+ return result.success unless result.success.nil?
98
+ raise result.ire unless result.ire.nil?
99
+ raise result.ue unless result.ue.nil?
100
+ raise result.te unless result.te.nil?
101
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'multiget_slice failed: unknown result')
102
+ end
103
+
104
+ def get_count(keyspace, key, column_parent, consistency_level)
105
+ send_get_count(keyspace, key, column_parent, consistency_level)
106
+ return recv_get_count()
107
+ end
108
+
109
+ def send_get_count(keyspace, key, column_parent, consistency_level)
110
+ send_message('get_count', Get_count_args, :keyspace => keyspace, :key => key, :column_parent => column_parent, :consistency_level => consistency_level)
111
+ end
112
+
113
+ def recv_get_count()
114
+ result = receive_message(Get_count_result)
115
+ return result.success unless result.success.nil?
116
+ raise result.ire unless result.ire.nil?
117
+ raise result.ue unless result.ue.nil?
118
+ raise result.te unless result.te.nil?
119
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_count failed: unknown result')
120
+ end
121
+
122
+ def get_range_slice(keyspace, column_parent, predicate, start_key, finish_key, row_count, consistency_level)
123
+ send_get_range_slice(keyspace, column_parent, predicate, start_key, finish_key, row_count, consistency_level)
124
+ return recv_get_range_slice()
125
+ end
126
+
127
+ def send_get_range_slice(keyspace, column_parent, predicate, start_key, finish_key, row_count, consistency_level)
128
+ send_message('get_range_slice', Get_range_slice_args, :keyspace => keyspace, :column_parent => column_parent, :predicate => predicate, :start_key => start_key, :finish_key => finish_key, :row_count => row_count, :consistency_level => consistency_level)
129
+ end
130
+
131
+ def recv_get_range_slice()
132
+ result = receive_message(Get_range_slice_result)
133
+ return result.success unless result.success.nil?
134
+ raise result.ire unless result.ire.nil?
135
+ raise result.ue unless result.ue.nil?
136
+ raise result.te unless result.te.nil?
137
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_range_slice failed: unknown result')
138
+ end
139
+
140
+ def get_range_slices(keyspace, column_parent, predicate, range, consistency_level)
141
+ send_get_range_slices(keyspace, column_parent, predicate, range, consistency_level)
142
+ return recv_get_range_slices()
143
+ end
144
+
145
+ def send_get_range_slices(keyspace, column_parent, predicate, range, consistency_level)
146
+ send_message('get_range_slices', Get_range_slices_args, :keyspace => keyspace, :column_parent => column_parent, :predicate => predicate, :range => range, :consistency_level => consistency_level)
147
+ end
148
+
149
+ def recv_get_range_slices()
150
+ result = receive_message(Get_range_slices_result)
151
+ return result.success unless result.success.nil?
152
+ raise result.ire unless result.ire.nil?
153
+ raise result.ue unless result.ue.nil?
154
+ raise result.te unless result.te.nil?
155
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_range_slices failed: unknown result')
156
+ end
157
+
158
+ def insert(keyspace, key, column_path, value, timestamp, consistency_level)
159
+ send_insert(keyspace, key, column_path, value, timestamp, consistency_level)
160
+ recv_insert()
161
+ end
162
+
163
+ def send_insert(keyspace, key, column_path, value, timestamp, consistency_level)
164
+ send_message('insert', Insert_args, :keyspace => keyspace, :key => key, :column_path => column_path, :value => value, :timestamp => timestamp, :consistency_level => consistency_level)
165
+ end
166
+
167
+ def recv_insert()
168
+ result = receive_message(Insert_result)
169
+ raise result.ire unless result.ire.nil?
170
+ raise result.ue unless result.ue.nil?
171
+ raise result.te unless result.te.nil?
172
+ return
173
+ end
174
+
175
+ def batch_insert(keyspace, key, cfmap, consistency_level)
176
+ send_batch_insert(keyspace, key, cfmap, consistency_level)
177
+ recv_batch_insert()
178
+ end
179
+
180
+ def send_batch_insert(keyspace, key, cfmap, consistency_level)
181
+ send_message('batch_insert', Batch_insert_args, :keyspace => keyspace, :key => key, :cfmap => cfmap, :consistency_level => consistency_level)
182
+ end
183
+
184
+ def recv_batch_insert()
185
+ result = receive_message(Batch_insert_result)
186
+ raise result.ire unless result.ire.nil?
187
+ raise result.ue unless result.ue.nil?
188
+ raise result.te unless result.te.nil?
189
+ return
190
+ end
191
+
192
+ def remove(keyspace, key, column_path, timestamp, consistency_level)
193
+ send_remove(keyspace, key, column_path, timestamp, consistency_level)
194
+ recv_remove()
195
+ end
196
+
197
+ def send_remove(keyspace, key, column_path, timestamp, consistency_level)
198
+ send_message('remove', Remove_args, :keyspace => keyspace, :key => key, :column_path => column_path, :timestamp => timestamp, :consistency_level => consistency_level)
199
+ end
200
+
201
+ def recv_remove()
202
+ result = receive_message(Remove_result)
203
+ raise result.ire unless result.ire.nil?
204
+ raise result.ue unless result.ue.nil?
205
+ raise result.te unless result.te.nil?
206
+ return
207
+ end
208
+
209
+ def batch_mutate(keyspace, mutation_map, consistency_level)
210
+ send_batch_mutate(keyspace, mutation_map, consistency_level)
211
+ recv_batch_mutate()
212
+ end
213
+
214
+ def send_batch_mutate(keyspace, mutation_map, consistency_level)
215
+ send_message('batch_mutate', Batch_mutate_args, :keyspace => keyspace, :mutation_map => mutation_map, :consistency_level => consistency_level)
216
+ end
217
+
218
+ def recv_batch_mutate()
219
+ result = receive_message(Batch_mutate_result)
220
+ raise result.ire unless result.ire.nil?
221
+ raise result.ue unless result.ue.nil?
222
+ raise result.te unless result.te.nil?
223
+ return
224
+ end
225
+
226
+ def get_string_property(property)
227
+ send_get_string_property(property)
228
+ return recv_get_string_property()
229
+ end
230
+
231
+ def send_get_string_property(property)
232
+ send_message('get_string_property', Get_string_property_args, :property => property)
233
+ end
234
+
235
+ def recv_get_string_property()
236
+ result = receive_message(Get_string_property_result)
237
+ return result.success unless result.success.nil?
238
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_string_property failed: unknown result')
239
+ end
240
+
241
+ def get_string_list_property(property)
242
+ send_get_string_list_property(property)
243
+ return recv_get_string_list_property()
244
+ end
245
+
246
+ def send_get_string_list_property(property)
247
+ send_message('get_string_list_property', Get_string_list_property_args, :property => property)
248
+ end
249
+
250
+ def recv_get_string_list_property()
251
+ result = receive_message(Get_string_list_property_result)
252
+ return result.success unless result.success.nil?
253
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_string_list_property failed: unknown result')
254
+ end
255
+
256
+ def describe_keyspaces()
257
+ send_describe_keyspaces()
258
+ return recv_describe_keyspaces()
259
+ end
260
+
261
+ def send_describe_keyspaces()
262
+ send_message('describe_keyspaces', Describe_keyspaces_args)
263
+ end
264
+
265
+ def recv_describe_keyspaces()
266
+ result = receive_message(Describe_keyspaces_result)
267
+ return result.success unless result.success.nil?
268
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_keyspaces failed: unknown result')
269
+ end
270
+
271
+ def describe_cluster_name()
272
+ send_describe_cluster_name()
273
+ return recv_describe_cluster_name()
274
+ end
275
+
276
+ def send_describe_cluster_name()
277
+ send_message('describe_cluster_name', Describe_cluster_name_args)
278
+ end
279
+
280
+ def recv_describe_cluster_name()
281
+ result = receive_message(Describe_cluster_name_result)
282
+ return result.success unless result.success.nil?
283
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_cluster_name failed: unknown result')
284
+ end
285
+
286
+ def describe_version()
287
+ send_describe_version()
288
+ return recv_describe_version()
289
+ end
290
+
291
+ def send_describe_version()
292
+ send_message('describe_version', Describe_version_args)
293
+ end
294
+
295
+ def recv_describe_version()
296
+ result = receive_message(Describe_version_result)
297
+ return result.success unless result.success.nil?
298
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_version failed: unknown result')
299
+ end
300
+
301
+ def describe_ring(keyspace)
302
+ send_describe_ring(keyspace)
303
+ return recv_describe_ring()
304
+ end
305
+
306
+ def send_describe_ring(keyspace)
307
+ send_message('describe_ring', Describe_ring_args, :keyspace => keyspace)
308
+ end
309
+
310
+ def recv_describe_ring()
311
+ result = receive_message(Describe_ring_result)
312
+ return result.success unless result.success.nil?
313
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_ring failed: unknown result')
314
+ end
315
+
316
+ def describe_keyspace(keyspace)
317
+ send_describe_keyspace(keyspace)
318
+ return recv_describe_keyspace()
319
+ end
320
+
321
+ def send_describe_keyspace(keyspace)
322
+ send_message('describe_keyspace', Describe_keyspace_args, :keyspace => keyspace)
323
+ end
324
+
325
+ def recv_describe_keyspace()
326
+ result = receive_message(Describe_keyspace_result)
327
+ return result.success unless result.success.nil?
328
+ raise result.nfe unless result.nfe.nil?
329
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_keyspace failed: unknown result')
330
+ end
331
+
332
+ def describe_splits(start_token, end_token, keys_per_split)
333
+ send_describe_splits(start_token, end_token, keys_per_split)
334
+ return recv_describe_splits()
335
+ end
336
+
337
+ def send_describe_splits(start_token, end_token, keys_per_split)
338
+ send_message('describe_splits', Describe_splits_args, :start_token => start_token, :end_token => end_token, :keys_per_split => keys_per_split)
339
+ end
340
+
341
+ def recv_describe_splits()
342
+ result = receive_message(Describe_splits_result)
343
+ return result.success unless result.success.nil?
344
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_splits failed: unknown result')
345
+ end
346
+
347
+ end
348
+
349
+ class Processor
350
+ include ::Thrift::Processor
351
+
352
+ def process_login(seqid, iprot, oprot)
353
+ args = read_args(iprot, Login_args)
354
+ result = Login_result.new()
355
+ begin
356
+ @handler.login(args.keyspace, args.auth_request)
357
+ rescue CassandraThrift::AuthenticationException => authnx
358
+ result.authnx = authnx
359
+ rescue CassandraThrift::AuthorizationException => authzx
360
+ result.authzx = authzx
361
+ end
362
+ write_result(result, oprot, 'login', seqid)
363
+ end
364
+
365
+ def process_get(seqid, iprot, oprot)
366
+ args = read_args(iprot, Get_args)
367
+ result = Get_result.new()
368
+ begin
369
+ result.success = @handler.get(args.keyspace, args.key, args.column_path, args.consistency_level)
370
+ rescue CassandraThrift::InvalidRequestException => ire
371
+ result.ire = ire
372
+ rescue CassandraThrift::NotFoundException => nfe
373
+ result.nfe = nfe
374
+ rescue CassandraThrift::UnavailableException => ue
375
+ result.ue = ue
376
+ rescue CassandraThrift::TimedOutException => te
377
+ result.te = te
378
+ end
379
+ write_result(result, oprot, 'get', seqid)
380
+ end
381
+
382
+ def process_get_slice(seqid, iprot, oprot)
383
+ args = read_args(iprot, Get_slice_args)
384
+ result = Get_slice_result.new()
385
+ begin
386
+ result.success = @handler.get_slice(args.keyspace, args.key, args.column_parent, args.predicate, args.consistency_level)
387
+ rescue CassandraThrift::InvalidRequestException => ire
388
+ result.ire = ire
389
+ rescue CassandraThrift::UnavailableException => ue
390
+ result.ue = ue
391
+ rescue CassandraThrift::TimedOutException => te
392
+ result.te = te
393
+ end
394
+ write_result(result, oprot, 'get_slice', seqid)
395
+ end
396
+
397
+ def process_multiget(seqid, iprot, oprot)
398
+ args = read_args(iprot, Multiget_args)
399
+ result = Multiget_result.new()
400
+ begin
401
+ result.success = @handler.multiget(args.keyspace, args.keys, args.column_path, args.consistency_level)
402
+ rescue CassandraThrift::InvalidRequestException => ire
403
+ result.ire = ire
404
+ rescue CassandraThrift::UnavailableException => ue
405
+ result.ue = ue
406
+ rescue CassandraThrift::TimedOutException => te
407
+ result.te = te
408
+ end
409
+ write_result(result, oprot, 'multiget', seqid)
410
+ end
411
+
412
+ def process_multiget_slice(seqid, iprot, oprot)
413
+ args = read_args(iprot, Multiget_slice_args)
414
+ result = Multiget_slice_result.new()
415
+ begin
416
+ result.success = @handler.multiget_slice(args.keyspace, args.keys, args.column_parent, args.predicate, args.consistency_level)
417
+ rescue CassandraThrift::InvalidRequestException => ire
418
+ result.ire = ire
419
+ rescue CassandraThrift::UnavailableException => ue
420
+ result.ue = ue
421
+ rescue CassandraThrift::TimedOutException => te
422
+ result.te = te
423
+ end
424
+ write_result(result, oprot, 'multiget_slice', seqid)
425
+ end
426
+
427
+ def process_get_count(seqid, iprot, oprot)
428
+ args = read_args(iprot, Get_count_args)
429
+ result = Get_count_result.new()
430
+ begin
431
+ result.success = @handler.get_count(args.keyspace, args.key, args.column_parent, args.consistency_level)
432
+ rescue CassandraThrift::InvalidRequestException => ire
433
+ result.ire = ire
434
+ rescue CassandraThrift::UnavailableException => ue
435
+ result.ue = ue
436
+ rescue CassandraThrift::TimedOutException => te
437
+ result.te = te
438
+ end
439
+ write_result(result, oprot, 'get_count', seqid)
440
+ end
441
+
442
+ def process_get_range_slice(seqid, iprot, oprot)
443
+ args = read_args(iprot, Get_range_slice_args)
444
+ result = Get_range_slice_result.new()
445
+ begin
446
+ result.success = @handler.get_range_slice(args.keyspace, args.column_parent, args.predicate, args.start_key, args.finish_key, args.row_count, args.consistency_level)
447
+ rescue CassandraThrift::InvalidRequestException => ire
448
+ result.ire = ire
449
+ rescue CassandraThrift::UnavailableException => ue
450
+ result.ue = ue
451
+ rescue CassandraThrift::TimedOutException => te
452
+ result.te = te
453
+ end
454
+ write_result(result, oprot, 'get_range_slice', seqid)
455
+ end
456
+
457
+ def process_get_range_slices(seqid, iprot, oprot)
458
+ args = read_args(iprot, Get_range_slices_args)
459
+ result = Get_range_slices_result.new()
460
+ begin
461
+ result.success = @handler.get_range_slices(args.keyspace, args.column_parent, args.predicate, args.range, args.consistency_level)
462
+ rescue CassandraThrift::InvalidRequestException => ire
463
+ result.ire = ire
464
+ rescue CassandraThrift::UnavailableException => ue
465
+ result.ue = ue
466
+ rescue CassandraThrift::TimedOutException => te
467
+ result.te = te
468
+ end
469
+ write_result(result, oprot, 'get_range_slices', seqid)
470
+ end
471
+
472
+ def process_insert(seqid, iprot, oprot)
473
+ args = read_args(iprot, Insert_args)
474
+ result = Insert_result.new()
475
+ begin
476
+ @handler.insert(args.keyspace, args.key, args.column_path, args.value, args.timestamp, args.consistency_level)
477
+ rescue CassandraThrift::InvalidRequestException => ire
478
+ result.ire = ire
479
+ rescue CassandraThrift::UnavailableException => ue
480
+ result.ue = ue
481
+ rescue CassandraThrift::TimedOutException => te
482
+ result.te = te
483
+ end
484
+ write_result(result, oprot, 'insert', seqid)
485
+ end
486
+
487
+ def process_batch_insert(seqid, iprot, oprot)
488
+ args = read_args(iprot, Batch_insert_args)
489
+ result = Batch_insert_result.new()
490
+ begin
491
+ @handler.batch_insert(args.keyspace, args.key, args.cfmap, args.consistency_level)
492
+ rescue CassandraThrift::InvalidRequestException => ire
493
+ result.ire = ire
494
+ rescue CassandraThrift::UnavailableException => ue
495
+ result.ue = ue
496
+ rescue CassandraThrift::TimedOutException => te
497
+ result.te = te
498
+ end
499
+ write_result(result, oprot, 'batch_insert', seqid)
500
+ end
501
+
502
+ def process_remove(seqid, iprot, oprot)
503
+ args = read_args(iprot, Remove_args)
504
+ result = Remove_result.new()
505
+ begin
506
+ @handler.remove(args.keyspace, args.key, args.column_path, args.timestamp, args.consistency_level)
507
+ rescue CassandraThrift::InvalidRequestException => ire
508
+ result.ire = ire
509
+ rescue CassandraThrift::UnavailableException => ue
510
+ result.ue = ue
511
+ rescue CassandraThrift::TimedOutException => te
512
+ result.te = te
513
+ end
514
+ write_result(result, oprot, 'remove', seqid)
515
+ end
516
+
517
+ def process_batch_mutate(seqid, iprot, oprot)
518
+ args = read_args(iprot, Batch_mutate_args)
519
+ result = Batch_mutate_result.new()
520
+ begin
521
+ @handler.batch_mutate(args.keyspace, args.mutation_map, args.consistency_level)
522
+ rescue CassandraThrift::InvalidRequestException => ire
523
+ result.ire = ire
524
+ rescue CassandraThrift::UnavailableException => ue
525
+ result.ue = ue
526
+ rescue CassandraThrift::TimedOutException => te
527
+ result.te = te
528
+ end
529
+ write_result(result, oprot, 'batch_mutate', seqid)
530
+ end
531
+
532
+ def process_get_string_property(seqid, iprot, oprot)
533
+ args = read_args(iprot, Get_string_property_args)
534
+ result = Get_string_property_result.new()
535
+ result.success = @handler.get_string_property(args.property)
536
+ write_result(result, oprot, 'get_string_property', seqid)
537
+ end
538
+
539
+ def process_get_string_list_property(seqid, iprot, oprot)
540
+ args = read_args(iprot, Get_string_list_property_args)
541
+ result = Get_string_list_property_result.new()
542
+ result.success = @handler.get_string_list_property(args.property)
543
+ write_result(result, oprot, 'get_string_list_property', seqid)
544
+ end
545
+
546
+ def process_describe_keyspaces(seqid, iprot, oprot)
547
+ args = read_args(iprot, Describe_keyspaces_args)
548
+ result = Describe_keyspaces_result.new()
549
+ result.success = @handler.describe_keyspaces()
550
+ write_result(result, oprot, 'describe_keyspaces', seqid)
551
+ end
552
+
553
+ def process_describe_cluster_name(seqid, iprot, oprot)
554
+ args = read_args(iprot, Describe_cluster_name_args)
555
+ result = Describe_cluster_name_result.new()
556
+ result.success = @handler.describe_cluster_name()
557
+ write_result(result, oprot, 'describe_cluster_name', seqid)
558
+ end
559
+
560
+ def process_describe_version(seqid, iprot, oprot)
561
+ args = read_args(iprot, Describe_version_args)
562
+ result = Describe_version_result.new()
563
+ result.success = @handler.describe_version()
564
+ write_result(result, oprot, 'describe_version', seqid)
565
+ end
566
+
567
+ def process_describe_ring(seqid, iprot, oprot)
568
+ args = read_args(iprot, Describe_ring_args)
569
+ result = Describe_ring_result.new()
570
+ result.success = @handler.describe_ring(args.keyspace)
571
+ write_result(result, oprot, 'describe_ring', seqid)
572
+ end
573
+
574
+ def process_describe_keyspace(seqid, iprot, oprot)
575
+ args = read_args(iprot, Describe_keyspace_args)
576
+ result = Describe_keyspace_result.new()
577
+ begin
578
+ result.success = @handler.describe_keyspace(args.keyspace)
579
+ rescue CassandraThrift::NotFoundException => nfe
580
+ result.nfe = nfe
581
+ end
582
+ write_result(result, oprot, 'describe_keyspace', seqid)
583
+ end
584
+
585
+ def process_describe_splits(seqid, iprot, oprot)
586
+ args = read_args(iprot, Describe_splits_args)
587
+ result = Describe_splits_result.new()
588
+ result.success = @handler.describe_splits(args.start_token, args.end_token, args.keys_per_split)
589
+ write_result(result, oprot, 'describe_splits', seqid)
590
+ end
591
+
592
+ end
593
+
594
+ # HELPER FUNCTIONS AND STRUCTURES
595
+
596
+ class Login_args
597
+ include ::Thrift::Struct
598
+ KEYSPACE = 1
599
+ AUTH_REQUEST = 2
600
+
601
+ ::Thrift::Struct.field_accessor self, :keyspace, :auth_request
602
+ FIELDS = {
603
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
604
+ AUTH_REQUEST => {:type => ::Thrift::Types::STRUCT, :name => 'auth_request', :class => CassandraThrift::AuthenticationRequest}
605
+ }
606
+
607
+ def struct_fields; FIELDS; end
608
+
609
+ def validate
610
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
611
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field auth_request is unset!') unless @auth_request
612
+ end
613
+
614
+ end
615
+
616
+ class Login_result
617
+ include ::Thrift::Struct
618
+ AUTHNX = 1
619
+ AUTHZX = 2
620
+
621
+ ::Thrift::Struct.field_accessor self, :authnx, :authzx
622
+ FIELDS = {
623
+ AUTHNX => {:type => ::Thrift::Types::STRUCT, :name => 'authnx', :class => CassandraThrift::AuthenticationException},
624
+ AUTHZX => {:type => ::Thrift::Types::STRUCT, :name => 'authzx', :class => CassandraThrift::AuthorizationException}
625
+ }
626
+
627
+ def struct_fields; FIELDS; end
628
+
629
+ def validate
630
+ end
631
+
632
+ end
633
+
634
+ class Get_args
635
+ include ::Thrift::Struct
636
+ KEYSPACE = 1
637
+ KEY = 2
638
+ COLUMN_PATH = 3
639
+ CONSISTENCY_LEVEL = 4
640
+
641
+ ::Thrift::Struct.field_accessor self, :keyspace, :key, :column_path, :consistency_level
642
+ FIELDS = {
643
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
644
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
645
+ COLUMN_PATH => {:type => ::Thrift::Types::STRUCT, :name => 'column_path', :class => CassandraThrift::ColumnPath},
646
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel}
647
+ }
648
+
649
+ def struct_fields; FIELDS; end
650
+
651
+ def validate
652
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
653
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key
654
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_path is unset!') unless @column_path
655
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level
656
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
657
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
658
+ end
659
+ end
660
+
661
+ end
662
+
663
+ class Get_result
664
+ include ::Thrift::Struct
665
+ SUCCESS = 0
666
+ IRE = 1
667
+ NFE = 2
668
+ UE = 3
669
+ TE = 4
670
+
671
+ ::Thrift::Struct.field_accessor self, :success, :ire, :nfe, :ue, :te
672
+ FIELDS = {
673
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => CassandraThrift::ColumnOrSuperColumn},
674
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
675
+ NFE => {:type => ::Thrift::Types::STRUCT, :name => 'nfe', :class => CassandraThrift::NotFoundException},
676
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
677
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
678
+ }
679
+
680
+ def struct_fields; FIELDS; end
681
+
682
+ def validate
683
+ end
684
+
685
+ end
686
+
687
+ class Get_slice_args
688
+ include ::Thrift::Struct
689
+ KEYSPACE = 1
690
+ KEY = 2
691
+ COLUMN_PARENT = 3
692
+ PREDICATE = 4
693
+ CONSISTENCY_LEVEL = 5
694
+
695
+ ::Thrift::Struct.field_accessor self, :keyspace, :key, :column_parent, :predicate, :consistency_level
696
+ FIELDS = {
697
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
698
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
699
+ COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent},
700
+ PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate},
701
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel}
702
+ }
703
+
704
+ def struct_fields; FIELDS; end
705
+
706
+ def validate
707
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
708
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key
709
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_parent is unset!') unless @column_parent
710
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field predicate is unset!') unless @predicate
711
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level
712
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
713
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
714
+ end
715
+ end
716
+
717
+ end
718
+
719
+ class Get_slice_result
720
+ include ::Thrift::Struct
721
+ SUCCESS = 0
722
+ IRE = 1
723
+ UE = 2
724
+ TE = 3
725
+
726
+ ::Thrift::Struct.field_accessor self, :success, :ire, :ue, :te
727
+ FIELDS = {
728
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}},
729
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
730
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
731
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
732
+ }
733
+
734
+ def struct_fields; FIELDS; end
735
+
736
+ def validate
737
+ end
738
+
739
+ end
740
+
741
+ class Multiget_args
742
+ include ::Thrift::Struct
743
+ KEYSPACE = 1
744
+ KEYS = 2
745
+ COLUMN_PATH = 3
746
+ CONSISTENCY_LEVEL = 4
747
+
748
+ ::Thrift::Struct.field_accessor self, :keyspace, :keys, :column_path, :consistency_level
749
+ FIELDS = {
750
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
751
+ KEYS => {:type => ::Thrift::Types::LIST, :name => 'keys', :element => {:type => ::Thrift::Types::STRING}},
752
+ COLUMN_PATH => {:type => ::Thrift::Types::STRUCT, :name => 'column_path', :class => CassandraThrift::ColumnPath},
753
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel}
754
+ }
755
+
756
+ def struct_fields; FIELDS; end
757
+
758
+ def validate
759
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
760
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keys is unset!') unless @keys
761
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_path is unset!') unless @column_path
762
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level
763
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
764
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
765
+ end
766
+ end
767
+
768
+ end
769
+
770
+ class Multiget_result
771
+ include ::Thrift::Struct
772
+ SUCCESS = 0
773
+ IRE = 1
774
+ UE = 2
775
+ TE = 3
776
+
777
+ ::Thrift::Struct.field_accessor self, :success, :ire, :ue, :te
778
+ FIELDS = {
779
+ SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}},
780
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
781
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
782
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
783
+ }
784
+
785
+ def struct_fields; FIELDS; end
786
+
787
+ def validate
788
+ end
789
+
790
+ end
791
+
792
+ class Multiget_slice_args
793
+ include ::Thrift::Struct
794
+ KEYSPACE = 1
795
+ KEYS = 2
796
+ COLUMN_PARENT = 3
797
+ PREDICATE = 4
798
+ CONSISTENCY_LEVEL = 5
799
+
800
+ ::Thrift::Struct.field_accessor self, :keyspace, :keys, :column_parent, :predicate, :consistency_level
801
+ FIELDS = {
802
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
803
+ KEYS => {:type => ::Thrift::Types::LIST, :name => 'keys', :element => {:type => ::Thrift::Types::STRING}},
804
+ COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent},
805
+ PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate},
806
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel}
807
+ }
808
+
809
+ def struct_fields; FIELDS; end
810
+
811
+ def validate
812
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
813
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keys is unset!') unless @keys
814
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_parent is unset!') unless @column_parent
815
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field predicate is unset!') unless @predicate
816
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level
817
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
818
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
819
+ end
820
+ end
821
+
822
+ end
823
+
824
+ class Multiget_slice_result
825
+ include ::Thrift::Struct
826
+ SUCCESS = 0
827
+ IRE = 1
828
+ UE = 2
829
+ TE = 3
830
+
831
+ ::Thrift::Struct.field_accessor self, :success, :ire, :ue, :te
832
+ FIELDS = {
833
+ SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}}},
834
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
835
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
836
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
837
+ }
838
+
839
+ def struct_fields; FIELDS; end
840
+
841
+ def validate
842
+ end
843
+
844
+ end
845
+
846
+ class Get_count_args
847
+ include ::Thrift::Struct
848
+ KEYSPACE = 1
849
+ KEY = 2
850
+ COLUMN_PARENT = 3
851
+ CONSISTENCY_LEVEL = 4
852
+
853
+ ::Thrift::Struct.field_accessor self, :keyspace, :key, :column_parent, :consistency_level
854
+ FIELDS = {
855
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
856
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
857
+ COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent},
858
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel}
859
+ }
860
+
861
+ def struct_fields; FIELDS; end
862
+
863
+ def validate
864
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
865
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key
866
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_parent is unset!') unless @column_parent
867
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level
868
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
869
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
870
+ end
871
+ end
872
+
873
+ end
874
+
875
+ class Get_count_result
876
+ include ::Thrift::Struct
877
+ SUCCESS = 0
878
+ IRE = 1
879
+ UE = 2
880
+ TE = 3
881
+
882
+ ::Thrift::Struct.field_accessor self, :success, :ire, :ue, :te
883
+ FIELDS = {
884
+ SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success'},
885
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
886
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
887
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
888
+ }
889
+
890
+ def struct_fields; FIELDS; end
891
+
892
+ def validate
893
+ end
894
+
895
+ end
896
+
897
+ class Get_range_slice_args
898
+ include ::Thrift::Struct
899
+ KEYSPACE = 1
900
+ COLUMN_PARENT = 2
901
+ PREDICATE = 3
902
+ START_KEY = 4
903
+ FINISH_KEY = 5
904
+ ROW_COUNT = 6
905
+ CONSISTENCY_LEVEL = 7
906
+
907
+ ::Thrift::Struct.field_accessor self, :keyspace, :column_parent, :predicate, :start_key, :finish_key, :row_count, :consistency_level
908
+ FIELDS = {
909
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
910
+ COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent},
911
+ PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate},
912
+ START_KEY => {:type => ::Thrift::Types::STRING, :name => 'start_key', :default => %q""},
913
+ FINISH_KEY => {:type => ::Thrift::Types::STRING, :name => 'finish_key', :default => %q""},
914
+ ROW_COUNT => {:type => ::Thrift::Types::I32, :name => 'row_count', :default => 100},
915
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel}
916
+ }
917
+
918
+ def struct_fields; FIELDS; end
919
+
920
+ def validate
921
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
922
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_parent is unset!') unless @column_parent
923
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field predicate is unset!') unless @predicate
924
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field start_key is unset!') unless @start_key
925
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field finish_key is unset!') unless @finish_key
926
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field row_count is unset!') unless @row_count
927
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level
928
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
929
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
930
+ end
931
+ end
932
+
933
+ end
934
+
935
+ class Get_range_slice_result
936
+ include ::Thrift::Struct
937
+ SUCCESS = 0
938
+ IRE = 1
939
+ UE = 2
940
+ TE = 3
941
+
942
+ ::Thrift::Struct.field_accessor self, :success, :ire, :ue, :te
943
+ FIELDS = {
944
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::KeySlice}},
945
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
946
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
947
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
948
+ }
949
+
950
+ def struct_fields; FIELDS; end
951
+
952
+ def validate
953
+ end
954
+
955
+ end
956
+
957
+ class Get_range_slices_args
958
+ include ::Thrift::Struct
959
+ KEYSPACE = 1
960
+ COLUMN_PARENT = 2
961
+ PREDICATE = 3
962
+ RANGE = 4
963
+ CONSISTENCY_LEVEL = 5
964
+
965
+ ::Thrift::Struct.field_accessor self, :keyspace, :column_parent, :predicate, :range, :consistency_level
966
+ FIELDS = {
967
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
968
+ COLUMN_PARENT => {:type => ::Thrift::Types::STRUCT, :name => 'column_parent', :class => CassandraThrift::ColumnParent},
969
+ PREDICATE => {:type => ::Thrift::Types::STRUCT, :name => 'predicate', :class => CassandraThrift::SlicePredicate},
970
+ RANGE => {:type => ::Thrift::Types::STRUCT, :name => 'range', :class => CassandraThrift::KeyRange},
971
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 1, :enum_class => CassandraThrift::ConsistencyLevel}
972
+ }
973
+
974
+ def struct_fields; FIELDS; end
975
+
976
+ def validate
977
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
978
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_parent is unset!') unless @column_parent
979
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field predicate is unset!') unless @predicate
980
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field range is unset!') unless @range
981
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level
982
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
983
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
984
+ end
985
+ end
986
+
987
+ end
988
+
989
+ class Get_range_slices_result
990
+ include ::Thrift::Struct
991
+ SUCCESS = 0
992
+ IRE = 1
993
+ UE = 2
994
+ TE = 3
995
+
996
+ ::Thrift::Struct.field_accessor self, :success, :ire, :ue, :te
997
+ FIELDS = {
998
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::KeySlice}},
999
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
1000
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
1001
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
1002
+ }
1003
+
1004
+ def struct_fields; FIELDS; end
1005
+
1006
+ def validate
1007
+ end
1008
+
1009
+ end
1010
+
1011
+ class Insert_args
1012
+ include ::Thrift::Struct
1013
+ KEYSPACE = 1
1014
+ KEY = 2
1015
+ COLUMN_PATH = 3
1016
+ VALUE = 4
1017
+ TIMESTAMP = 5
1018
+ CONSISTENCY_LEVEL = 6
1019
+
1020
+ ::Thrift::Struct.field_accessor self, :keyspace, :key, :column_path, :value, :timestamp, :consistency_level
1021
+ FIELDS = {
1022
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
1023
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
1024
+ COLUMN_PATH => {:type => ::Thrift::Types::STRUCT, :name => 'column_path', :class => CassandraThrift::ColumnPath},
1025
+ VALUE => {:type => ::Thrift::Types::STRING, :name => 'value'},
1026
+ TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'},
1027
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 0, :enum_class => CassandraThrift::ConsistencyLevel}
1028
+ }
1029
+
1030
+ def struct_fields; FIELDS; end
1031
+
1032
+ def validate
1033
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
1034
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key
1035
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_path is unset!') unless @column_path
1036
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') unless @value
1037
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field timestamp is unset!') unless @timestamp
1038
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level
1039
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
1040
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
1041
+ end
1042
+ end
1043
+
1044
+ end
1045
+
1046
+ class Insert_result
1047
+ include ::Thrift::Struct
1048
+ IRE = 1
1049
+ UE = 2
1050
+ TE = 3
1051
+
1052
+ ::Thrift::Struct.field_accessor self, :ire, :ue, :te
1053
+ FIELDS = {
1054
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
1055
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
1056
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
1057
+ }
1058
+
1059
+ def struct_fields; FIELDS; end
1060
+
1061
+ def validate
1062
+ end
1063
+
1064
+ end
1065
+
1066
+ class Batch_insert_args
1067
+ include ::Thrift::Struct
1068
+ KEYSPACE = 1
1069
+ KEY = 2
1070
+ CFMAP = 3
1071
+ CONSISTENCY_LEVEL = 4
1072
+
1073
+ ::Thrift::Struct.field_accessor self, :keyspace, :key, :cfmap, :consistency_level
1074
+ FIELDS = {
1075
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
1076
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
1077
+ CFMAP => {:type => ::Thrift::Types::MAP, :name => 'cfmap', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::ColumnOrSuperColumn}}},
1078
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 0, :enum_class => CassandraThrift::ConsistencyLevel}
1079
+ }
1080
+
1081
+ def struct_fields; FIELDS; end
1082
+
1083
+ def validate
1084
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
1085
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key
1086
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field cfmap is unset!') unless @cfmap
1087
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level
1088
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
1089
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
1090
+ end
1091
+ end
1092
+
1093
+ end
1094
+
1095
+ class Batch_insert_result
1096
+ include ::Thrift::Struct
1097
+ IRE = 1
1098
+ UE = 2
1099
+ TE = 3
1100
+
1101
+ ::Thrift::Struct.field_accessor self, :ire, :ue, :te
1102
+ FIELDS = {
1103
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
1104
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
1105
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
1106
+ }
1107
+
1108
+ def struct_fields; FIELDS; end
1109
+
1110
+ def validate
1111
+ end
1112
+
1113
+ end
1114
+
1115
+ class Remove_args
1116
+ include ::Thrift::Struct
1117
+ KEYSPACE = 1
1118
+ KEY = 2
1119
+ COLUMN_PATH = 3
1120
+ TIMESTAMP = 4
1121
+ CONSISTENCY_LEVEL = 5
1122
+
1123
+ ::Thrift::Struct.field_accessor self, :keyspace, :key, :column_path, :timestamp, :consistency_level
1124
+ FIELDS = {
1125
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
1126
+ KEY => {:type => ::Thrift::Types::STRING, :name => 'key'},
1127
+ COLUMN_PATH => {:type => ::Thrift::Types::STRUCT, :name => 'column_path', :class => CassandraThrift::ColumnPath},
1128
+ TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'},
1129
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 0, :enum_class => CassandraThrift::ConsistencyLevel}
1130
+ }
1131
+
1132
+ def struct_fields; FIELDS; end
1133
+
1134
+ def validate
1135
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
1136
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key
1137
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field column_path is unset!') unless @column_path
1138
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field timestamp is unset!') unless @timestamp
1139
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
1140
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
1141
+ end
1142
+ end
1143
+
1144
+ end
1145
+
1146
+ class Remove_result
1147
+ include ::Thrift::Struct
1148
+ IRE = 1
1149
+ UE = 2
1150
+ TE = 3
1151
+
1152
+ ::Thrift::Struct.field_accessor self, :ire, :ue, :te
1153
+ FIELDS = {
1154
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
1155
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
1156
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
1157
+ }
1158
+
1159
+ def struct_fields; FIELDS; end
1160
+
1161
+ def validate
1162
+ end
1163
+
1164
+ end
1165
+
1166
+ class Batch_mutate_args
1167
+ include ::Thrift::Struct
1168
+ KEYSPACE = 1
1169
+ MUTATION_MAP = 2
1170
+ CONSISTENCY_LEVEL = 3
1171
+
1172
+ ::Thrift::Struct.field_accessor self, :keyspace, :mutation_map, :consistency_level
1173
+ FIELDS = {
1174
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'},
1175
+ MUTATION_MAP => {:type => ::Thrift::Types::MAP, :name => 'mutation_map', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::MAP, :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::Mutation}}}},
1176
+ CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 0, :enum_class => CassandraThrift::ConsistencyLevel}
1177
+ }
1178
+
1179
+ def struct_fields; FIELDS; end
1180
+
1181
+ def validate
1182
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
1183
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field mutation_map is unset!') unless @mutation_map
1184
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field consistency_level is unset!') unless @consistency_level
1185
+ unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level)
1186
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!')
1187
+ end
1188
+ end
1189
+
1190
+ end
1191
+
1192
+ class Batch_mutate_result
1193
+ include ::Thrift::Struct
1194
+ IRE = 1
1195
+ UE = 2
1196
+ TE = 3
1197
+
1198
+ ::Thrift::Struct.field_accessor self, :ire, :ue, :te
1199
+ FIELDS = {
1200
+ IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException},
1201
+ UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException},
1202
+ TE => {:type => ::Thrift::Types::STRUCT, :name => 'te', :class => CassandraThrift::TimedOutException}
1203
+ }
1204
+
1205
+ def struct_fields; FIELDS; end
1206
+
1207
+ def validate
1208
+ end
1209
+
1210
+ end
1211
+
1212
+ class Get_string_property_args
1213
+ include ::Thrift::Struct
1214
+ PROPERTY = 1
1215
+
1216
+ ::Thrift::Struct.field_accessor self, :property
1217
+ FIELDS = {
1218
+ PROPERTY => {:type => ::Thrift::Types::STRING, :name => 'property'}
1219
+ }
1220
+
1221
+ def struct_fields; FIELDS; end
1222
+
1223
+ def validate
1224
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field property is unset!') unless @property
1225
+ end
1226
+
1227
+ end
1228
+
1229
+ class Get_string_property_result
1230
+ include ::Thrift::Struct
1231
+ SUCCESS = 0
1232
+
1233
+ ::Thrift::Struct.field_accessor self, :success
1234
+ FIELDS = {
1235
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
1236
+ }
1237
+
1238
+ def struct_fields; FIELDS; end
1239
+
1240
+ def validate
1241
+ end
1242
+
1243
+ end
1244
+
1245
+ class Get_string_list_property_args
1246
+ include ::Thrift::Struct
1247
+ PROPERTY = 1
1248
+
1249
+ ::Thrift::Struct.field_accessor self, :property
1250
+ FIELDS = {
1251
+ PROPERTY => {:type => ::Thrift::Types::STRING, :name => 'property'}
1252
+ }
1253
+
1254
+ def struct_fields; FIELDS; end
1255
+
1256
+ def validate
1257
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field property is unset!') unless @property
1258
+ end
1259
+
1260
+ end
1261
+
1262
+ class Get_string_list_property_result
1263
+ include ::Thrift::Struct
1264
+ SUCCESS = 0
1265
+
1266
+ ::Thrift::Struct.field_accessor self, :success
1267
+ FIELDS = {
1268
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRING}}
1269
+ }
1270
+
1271
+ def struct_fields; FIELDS; end
1272
+
1273
+ def validate
1274
+ end
1275
+
1276
+ end
1277
+
1278
+ class Describe_keyspaces_args
1279
+ include ::Thrift::Struct
1280
+
1281
+ FIELDS = {
1282
+
1283
+ }
1284
+
1285
+ def struct_fields; FIELDS; end
1286
+
1287
+ def validate
1288
+ end
1289
+
1290
+ end
1291
+
1292
+ class Describe_keyspaces_result
1293
+ include ::Thrift::Struct
1294
+ SUCCESS = 0
1295
+
1296
+ ::Thrift::Struct.field_accessor self, :success
1297
+ FIELDS = {
1298
+ SUCCESS => {:type => ::Thrift::Types::SET, :name => 'success', :element => {:type => ::Thrift::Types::STRING}}
1299
+ }
1300
+
1301
+ def struct_fields; FIELDS; end
1302
+
1303
+ def validate
1304
+ end
1305
+
1306
+ end
1307
+
1308
+ class Describe_cluster_name_args
1309
+ include ::Thrift::Struct
1310
+
1311
+ FIELDS = {
1312
+
1313
+ }
1314
+
1315
+ def struct_fields; FIELDS; end
1316
+
1317
+ def validate
1318
+ end
1319
+
1320
+ end
1321
+
1322
+ class Describe_cluster_name_result
1323
+ include ::Thrift::Struct
1324
+ SUCCESS = 0
1325
+
1326
+ ::Thrift::Struct.field_accessor self, :success
1327
+ FIELDS = {
1328
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
1329
+ }
1330
+
1331
+ def struct_fields; FIELDS; end
1332
+
1333
+ def validate
1334
+ end
1335
+
1336
+ end
1337
+
1338
+ class Describe_version_args
1339
+ include ::Thrift::Struct
1340
+
1341
+ FIELDS = {
1342
+
1343
+ }
1344
+
1345
+ def struct_fields; FIELDS; end
1346
+
1347
+ def validate
1348
+ end
1349
+
1350
+ end
1351
+
1352
+ class Describe_version_result
1353
+ include ::Thrift::Struct
1354
+ SUCCESS = 0
1355
+
1356
+ ::Thrift::Struct.field_accessor self, :success
1357
+ FIELDS = {
1358
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
1359
+ }
1360
+
1361
+ def struct_fields; FIELDS; end
1362
+
1363
+ def validate
1364
+ end
1365
+
1366
+ end
1367
+
1368
+ class Describe_ring_args
1369
+ include ::Thrift::Struct
1370
+ KEYSPACE = 1
1371
+
1372
+ ::Thrift::Struct.field_accessor self, :keyspace
1373
+ FIELDS = {
1374
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'}
1375
+ }
1376
+
1377
+ def struct_fields; FIELDS; end
1378
+
1379
+ def validate
1380
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
1381
+ end
1382
+
1383
+ end
1384
+
1385
+ class Describe_ring_result
1386
+ include ::Thrift::Struct
1387
+ SUCCESS = 0
1388
+
1389
+ ::Thrift::Struct.field_accessor self, :success
1390
+ FIELDS = {
1391
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::TokenRange}}
1392
+ }
1393
+
1394
+ def struct_fields; FIELDS; end
1395
+
1396
+ def validate
1397
+ end
1398
+
1399
+ end
1400
+
1401
+ class Describe_keyspace_args
1402
+ include ::Thrift::Struct
1403
+ KEYSPACE = 1
1404
+
1405
+ ::Thrift::Struct.field_accessor self, :keyspace
1406
+ FIELDS = {
1407
+ KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'}
1408
+ }
1409
+
1410
+ def struct_fields; FIELDS; end
1411
+
1412
+ def validate
1413
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyspace is unset!') unless @keyspace
1414
+ end
1415
+
1416
+ end
1417
+
1418
+ class Describe_keyspace_result
1419
+ include ::Thrift::Struct
1420
+ SUCCESS = 0
1421
+ NFE = 1
1422
+
1423
+ ::Thrift::Struct.field_accessor self, :success, :nfe
1424
+ FIELDS = {
1425
+ SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::MAP, :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}},
1426
+ NFE => {:type => ::Thrift::Types::STRUCT, :name => 'nfe', :class => CassandraThrift::NotFoundException}
1427
+ }
1428
+
1429
+ def struct_fields; FIELDS; end
1430
+
1431
+ def validate
1432
+ end
1433
+
1434
+ end
1435
+
1436
+ class Describe_splits_args
1437
+ include ::Thrift::Struct
1438
+ START_TOKEN = 1
1439
+ END_TOKEN = 2
1440
+ KEYS_PER_SPLIT = 3
1441
+
1442
+ ::Thrift::Struct.field_accessor self, :start_token, :end_token, :keys_per_split
1443
+ FIELDS = {
1444
+ START_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'start_token'},
1445
+ END_TOKEN => {:type => ::Thrift::Types::STRING, :name => 'end_token'},
1446
+ KEYS_PER_SPLIT => {:type => ::Thrift::Types::I32, :name => 'keys_per_split'}
1447
+ }
1448
+
1449
+ def struct_fields; FIELDS; end
1450
+
1451
+ def validate
1452
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field start_token is unset!') unless @start_token
1453
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field end_token is unset!') unless @end_token
1454
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keys_per_split is unset!') unless @keys_per_split
1455
+ end
1456
+
1457
+ end
1458
+
1459
+ class Describe_splits_result
1460
+ include ::Thrift::Struct
1461
+ SUCCESS = 0
1462
+
1463
+ ::Thrift::Struct.field_accessor self, :success
1464
+ FIELDS = {
1465
+ SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRING}}
1466
+ }
1467
+
1468
+ def struct_fields; FIELDS; end
1469
+
1470
+ def validate
1471
+ end
1472
+
1473
+ end
1474
+
1475
+ end
1476
+
1477
+ end