Get Counter using Key.GreaterThanOrEqual

Oct 23, 2011 at 7:34 PM

Hi again,

Well I´ve another question regarding Counters Columns.

If I use the following code:

var abc3 = from x in context.CounterColumnList where x.ColumnFamily == "System_Counters" && x.Key.In("X_816034", "X_816626") select x;

I receive the 2 counters. No problem at all. But if I use this code:

var abc4 = from x in context.CounterColumnList where x.ColumnFamily == "System_Counters" && x.Key.GreaterThanOrEqual("X_816034") select x;

It give me several others counters like: "X_816034", "Y...", "Z..."

I mean it didn´t give me first all counters that immediately follows the "X..." it give me several counters unordered.

 

Do you guys know why?

Coordinator
Oct 23, 2011 at 10:13 PM
Edited Oct 23, 2011 at 10:22 PM

Which partitioner do you use? If you use RandomPartitioner, you can't get sorted keys.

http://www.datastax.com/docs/0.8/cluster_architecture/partitioning#understanding-the-partitioner-types

Oct 24, 2011 at 7:07 PM

Ok. Great. Thanks sabro !!!