cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Praveen Baratam <praveen.bara...@gmail.com>
Subject Re: Help with Wide Rows with CounterColumns
Date Tue, 24 Apr 2012 10:43:39 GMT
Thank you Aaron.

On Mon, Apr 23, 2012 at 2:39 PM, aaron morton <aaron@thelastpickle.com>wrote:

> 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?
>
>
>
>
>
>

Mime
View raw message