vendor/gen-rb/cassandra.rb in cassandra-0.5.4 vs vendor/gen-rb/cassandra.rb in cassandra-0.5.5

- old
+ new

@@ -76,21 +76,21 @@ raise result.ire unless result.ire.nil? raise result.ue unless result.ue.nil? return end - def batch_insert(keyspace, batch_mutation, consistency_level) - send_batch_insert(keyspace, batch_mutation, consistency_level) - recv_batch_insert() + def batch_mutate(keyspace, batch_mutations, consistency_level) + send_batch_mutate(keyspace, batch_mutations, consistency_level) + recv_batch_mutate() end - def send_batch_insert(keyspace, batch_mutation, consistency_level) - send_message('batch_insert', Batch_insert_args, :keyspace => keyspace, :batch_mutation => batch_mutation, :consistency_level => consistency_level) + def send_batch_mutate(keyspace, batch_mutations, consistency_level) + send_message('batch_mutate', Batch_mutate_args, :keyspace => keyspace, :batch_mutations => batch_mutations, :consistency_level => consistency_level) end - def recv_batch_insert() - result = receive_message(Batch_insert_result) + def recv_batch_mutate() + result = receive_message(Batch_mutate_result) raise result.ire unless result.ire.nil? raise result.ue unless result.ue.nil? return end @@ -108,26 +108,10 @@ raise result.ire unless result.ire.nil? raise result.ue unless result.ue.nil? return end - def batch_insert_super_column(keyspace, batch_mutation_super, consistency_level) - send_batch_insert_super_column(keyspace, batch_mutation_super, consistency_level) - recv_batch_insert_super_column() - end - - def send_batch_insert_super_column(keyspace, batch_mutation_super, consistency_level) - send_message('batch_insert_super_column', Batch_insert_super_column_args, :keyspace => keyspace, :batch_mutation_super => batch_mutation_super, :consistency_level => consistency_level) - end - - def recv_batch_insert_super_column() - result = receive_message(Batch_insert_super_column_result) - raise result.ire unless result.ire.nil? - raise result.ue unless result.ue.nil? - return - end - def get_key_range(keyspace, column_family, start, finish, count) send_get_key_range(keyspace, column_family, start, finish, count) return recv_get_key_range() end @@ -241,21 +225,21 @@ result.ue = ue end write_result(result, oprot, 'insert', seqid) end - def process_batch_insert(seqid, iprot, oprot) - args = read_args(iprot, Batch_insert_args) - result = Batch_insert_result.new() + def process_batch_mutate(seqid, iprot, oprot) + args = read_args(iprot, Batch_mutate_args) + result = Batch_mutate_result.new() begin - @handler.batch_insert(args.keyspace, args.batch_mutation, args.consistency_level) + @handler.batch_mutate(args.keyspace, args.batch_mutations, args.consistency_level) rescue CassandraThrift::InvalidRequestException => ire result.ire = ire rescue CassandraThrift::UnavailableException => ue result.ue = ue end - write_result(result, oprot, 'batch_insert', seqid) + write_result(result, oprot, 'batch_mutate', seqid) end def process_remove(seqid, iprot, oprot) args = read_args(iprot, Remove_args) result = Remove_result.new() @@ -267,23 +251,10 @@ result.ue = ue end write_result(result, oprot, 'remove', seqid) end - def process_batch_insert_super_column(seqid, iprot, oprot) - args = read_args(iprot, Batch_insert_super_column_args) - result = Batch_insert_super_column_result.new() - begin - @handler.batch_insert_super_column(args.keyspace, args.batch_mutation_super, args.consistency_level) - rescue CassandraThrift::InvalidRequestException => ire - result.ire = ire - rescue CassandraThrift::UnavailableException => ue - result.ue = ue - end - write_result(result, oprot, 'batch_insert_super_column', seqid) - end - def process_get_key_range(seqid, iprot, oprot) args = read_args(iprot, Get_key_range_args) result = Get_key_range_result.new() begin result.success = @handler.get_key_range(args.keyspace, args.column_family, args.start, args.finish, args.count) @@ -502,20 +473,20 @@ def validate end end - class Batch_insert_args + class Batch_mutate_args include ::Thrift::Struct KEYSPACE = 1 - BATCH_MUTATION = 2 + BATCH_MUTATIONS = 2 CONSISTENCY_LEVEL = 3 - ::Thrift::Struct.field_accessor self, :keyspace, :batch_mutation, :consistency_level + ::Thrift::Struct.field_accessor self, :keyspace, :batch_mutations, :consistency_level FIELDS = { KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'}, - BATCH_MUTATION => {:type => ::Thrift::Types::STRUCT, :name => 'batch_mutation', :class => CassandraThrift::BatchMutation}, + BATCH_MUTATIONS => {:type => ::Thrift::Types::LIST, :name => 'batch_mutations', :element => {:type => ::Thrift::Types::STRUCT, :class => CassandraThrift::BatchMutation}}, CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 0, :enum_class => CassandraThrift::ConsistencyLevel} } def struct_fields; FIELDS; end @@ -525,11 +496,11 @@ end end end - class Batch_insert_result + class Batch_mutate_result include ::Thrift::Struct IRE = 1 UE = 2 ::Thrift::Struct.field_accessor self, :ire, :ue @@ -571,50 +542,9 @@ end end class Remove_result - include ::Thrift::Struct - IRE = 1 - UE = 2 - - ::Thrift::Struct.field_accessor self, :ire, :ue - FIELDS = { - IRE => {:type => ::Thrift::Types::STRUCT, :name => 'ire', :class => CassandraThrift::InvalidRequestException}, - UE => {:type => ::Thrift::Types::STRUCT, :name => 'ue', :class => CassandraThrift::UnavailableException} - } - - def struct_fields; FIELDS; end - - def validate - end - - end - - class Batch_insert_super_column_args - include ::Thrift::Struct - KEYSPACE = 1 - BATCH_MUTATION_SUPER = 2 - CONSISTENCY_LEVEL = 3 - - ::Thrift::Struct.field_accessor self, :keyspace, :batch_mutation_super, :consistency_level - FIELDS = { - KEYSPACE => {:type => ::Thrift::Types::STRING, :name => 'keyspace'}, - BATCH_MUTATION_SUPER => {:type => ::Thrift::Types::STRUCT, :name => 'batch_mutation_super', :class => CassandraThrift::BatchMutationSuper}, - CONSISTENCY_LEVEL => {:type => ::Thrift::Types::I32, :name => 'consistency_level', :default => 0, :enum_class => CassandraThrift::ConsistencyLevel} - } - - def struct_fields; FIELDS; end - - def validate - unless @consistency_level.nil? || CassandraThrift::ConsistencyLevel::VALID_VALUES.include?(@consistency_level) - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field consistency_level!') - end - end - - end - - class Batch_insert_super_column_result include ::Thrift::Struct IRE = 1 UE = 2 ::Thrift::Struct.field_accessor self, :ire, :ue