No. 

CounterColumnType only works with column values, which are not sorted. Sorting 
counters while they are being updated is potentially very expensive. 

You have a few options:

1) If the list of counters is short (say < 100 columns) get all the columns and 
sort client side.
2) Run a periodic task that gets all the columns, sorts client side, pivots so 
column name and values are swapped, and writes them back to another row. You 
can now get the top X columns. 
3) Depending on your requirements, consider a different server such as Redis. 

Hope that helps.      
-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 21/04/2012, at 7:40 AM, Praveen Baratam wrote:

> Hello All,
> 
> I have a particular requirement where I need to update CounterColumns in a 
> Row by a specific UID which is the key for the CounterColumn in that row and 
> then query for those columns in that Row such that we get the top 5 UIDs with 
> highest Counter Values.
> 
> create column family Counters
>     with comparator = 'UTF8Type'
>     and key_validation_class = 'UTF8Type'
>     and default_validation_class = 'CounterColumnType';  
> 
> Can it be done?
> 
> 
> 
> 

Reply via email to