cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <>
Subject Re: Getting keys in a range sorted with respect to last access time
Date Tue, 08 Jun 2010 04:41:53 GMT
On Mon, Jun 7, 2010 at 9:04 AM, Utku Can Top├žu <> wrote:
> Hey All,
> First of all I'll start with some questions on the default behavior of
> get_range_slices method defined in the thrift API.
> Given a keyrange with start-key "kstart" and end-key "kend", assuming
> kstart<kend;
> * Is it true that I'll get the range [kstart,kend) (kstart inclusive, kend
> exclusive)?

[start, end]

> * What's the default order of the rows in the result list? (assuming I am
> using an OPP)

lexically by unicode code point

> * (How) can we reverse the sorting order?

write your own ReversedOPP.  but maybe you mean "how do we scan in
reversed order," in which case the answer is, "extend
ColumnFamilyStore.getRangeRows" (not for the faint of heart, but not

> * What would be the behavior in the case kstart>kend? Will I get an empty
> result list?

pretty sure it will error out.  easy to verify experimentally.

> Secondly, I have use case where I need to access the latest updated rows?
> How can this be possible? Writing a new partitioner?

No.  You'd want to maintain a separate row containing the most recent updates.

Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support

View raw message