Permalink
Browse files

get_indexed_slices: Continue to support key_start for backward compat

  • Loading branch information...
1 parent 5b3e835 commit 17c520651e957d72faf4636bc79c2293ad137448 @mcmire committed Aug 5, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/cassandra/cassandra.rb
@@ -975,14 +975,17 @@ def get_indexed_slices(column_family, index_clause, *columns_and_options)
return false if Cassandra.VERSION.to_f < 0.7
column_family, columns, _, options =
- extract_and_validate_params(column_family, [], columns_and_options, READ_DEFAULTS.merge(:key_count => 100, :start_key => ""))
+ extract_and_validate_params(column_family, [], columns_and_options,
+ READ_DEFAULTS.merge(:key_count => 100, :start_key => nil, :key_start => nil))
+
+ start_key = options[:start_key] || options[:key_start] || ""
if index_clause.class != CassandraThrift::IndexClause
index_expressions = index_clause.collect do |expression|
create_index_expression(expression[:column_name], expression[:value], expression[:comparison])
end
- index_clause = create_index_clause(index_expressions, options[:start_key], options[:key_count])
+ index_clause = create_index_clause(index_expressions, start_key, options[:key_count])
end
key_slices = _get_indexed_slices(column_family, index_clause, columns, options[:count], options[:start],

0 comments on commit 17c5206

Please sign in to comment.