Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Re-thrift. Use :reversed key.

  • Loading branch information...
commit a03e56341c7a1a13442a87613cc466096d78bc7a 1 parent 471a8d4
Evan Weaver authored
View
2  CHANGELOG
@@ -1,5 +1,5 @@
-v0.5.2. Update server.
+v0.5.2. Update server version so CommitLog replay is fixed.
v0.5.1. Add bin/cassandra_helper script, to build and start the server for you. Improve build error reporting.
View
2  lib/cassandra/protocol.rb
@@ -63,7 +63,7 @@ def _get(column_family, key, column, sub_column, count, start, finish, reversed,
# FIXME Comparable types in range are not enforced
predicate = CassandraThrift::SlicePredicate.new(:slice_range =>
CassandraThrift::SliceRange.new(
- :is_ascending => !reversed,
+ :reversed => reversed,
:count => count,
:start => start.to_s,
:finish => finish.to_s))
View
56 vendor/gen-rb/cassandra.rb
@@ -12,7 +12,7 @@ module Cassandra
class Client
include ::Thrift::Client
- def get_slice(keyspace, key, column_parent, predicate, consistency_level)
+ def get_slice(keyspace, key, column_parent, predicate, consistency_level)
send_get_slice(keyspace, key, column_parent, predicate, consistency_level)
return recv_get_slice()
end
@@ -188,21 +188,6 @@ def recv_describe_keyspace()
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'describe_keyspace failed: unknown result')
end
- def execute_query(query)
- send_execute_query(query)
- return recv_execute_query()
- end
-
- def send_execute_query(query)
- send_message('execute_query', Execute_query_args, :query => query)
- end
-
- def recv_execute_query()
- result = receive_message(Execute_query_result)
- return result.success unless result.success.nil?
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'execute_query failed: unknown result')
- end
-
end
class Processor
@@ -333,13 +318,6 @@ def process_describe_keyspace(seqid, iprot, oprot)
write_result(result, oprot, 'describe_keyspace', seqid)
end
- def process_execute_query(seqid, iprot, oprot)
- args = read_args(iprot, Execute_query_args)
- result = Execute_query_result.new()
- result.success = @handler.execute_query(args.query)
- write_result(result, oprot, 'execute_query', seqid)
- end
-
end
# HELPER FUNCTIONS AND STRUCTURES
@@ -793,38 +771,6 @@ def validate
end
- class Execute_query_args
- include ::Thrift::Struct
- QUERY = 1
-
- ::Thrift::Struct.field_accessor self, :query
- FIELDS = {
- QUERY => {:type => ::Thrift::Types::STRING, :name => 'query'}
- }
-
- def struct_fields; FIELDS; end
-
- def validate
- end
-
- end
-
- class Execute_query_result
- include ::Thrift::Struct
- SUCCESS = 0
-
- ::Thrift::Struct.field_accessor self, :success
- FIELDS = {
- SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => CassandraThrift::CqlResult}
- }
-
- def struct_fields; FIELDS; end
-
- def validate
- end
-
- end
-
end
end
View
26 vendor/gen-rb/cassandra_types.rb
@@ -89,26 +89,6 @@ def validate
end
- class CqlResult
- include ::Thrift::Struct
- ERROR_CODE = 1
- ERROR_TXT = 2
- RESULT_SET = 3
-
- ::Thrift::Struct.field_accessor self, :error_code, :error_txt, :result_set
- FIELDS = {
- ERROR_CODE => {:type => ::Thrift::Types::I32, :name => 'error_code'},
- ERROR_TXT => {:type => ::Thrift::Types::STRING, :name => 'error_txt'},
- RESULT_SET => {:type => ::Thrift::Types::LIST, :name => 'result_set', :element => {:type => ::Thrift::Types::MAP, :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}}
- }
-
- def struct_fields; FIELDS; end
-
- def validate
- end
-
- end
-
class NotFoundException < ::Thrift::Exception
include ::Thrift::Struct
@@ -202,14 +182,14 @@ class SliceRange
include ::Thrift::Struct
START = 1
FINISH = 2
- IS_ASCENDING = 3
+ REVERSED = 3
COUNT = 4
- ::Thrift::Struct.field_accessor self, :start, :finish, :is_ascending, :count
+ ::Thrift::Struct.field_accessor self, :start, :finish, :reversed, :count
FIELDS = {
START => {:type => ::Thrift::Types::STRING, :name => 'start'},
FINISH => {:type => ::Thrift::Types::STRING, :name => 'finish'},
- IS_ASCENDING => {:type => ::Thrift::Types::BOOL, :name => 'is_ascending', :default => true},
+ REVERSED => {:type => ::Thrift::Types::BOOL, :name => 'reversed', :default => false},
COUNT => {:type => ::Thrift::Types::I32, :name => 'count', :default => 100}
}
Please sign in to comment.
Something went wrong with that request. Please try again.