default count is 100, set this to some max value, but this won't guarantee
actual count.

Something like paging can help in counting. Get the last key as start in
second query, end as null, count as some value. But this will port data to
client where as we only need count.

Other solution may be (if count is very necessary) having separate counter
CF, incr whenever key is inserted in other CF.

I will not use Thrift API, clients library is very mature [1] & CQL is also
very good.

[1]
http://pycassa.github.com/pycassa/api/pycassa/columnfamily.html#pycassa.columnfamily.ColumnFamily.get_range

/Samal

On Thu, May 24, 2012 at 11:52 AM, Prakrati Agrawal <
prakrati.agra...@mu-sigma.com> wrote:

>  Hi****
>
> ** **
>
> I am trying to learn Cassandra and I have one doubt. I am using the Thrift
> API, to count the number of row keys I am using KeyRange to specify the row
> keys. To count all of them, I specify the start and end as “new byte[0]”.
> But the count is set to 100 by default. How do I use this method to count
> the keys if I don’t know the actual number of keys in my Cassandra
> database? Please help me****
>
> ** **
>
> Prakrati Agrawal | Developer - Big Data(I&D)| 9731648376 |
> www.mu-sigma.com ****
>
> ** **
>
> ------------------------------
> This email message may contain proprietary, private and confidential
> information. The information transmitted is intended only for the person(s)
> or entities to which it is addressed. Any review, retransmission,
> dissemination or other use of, or taking of any action in reliance upon,
> this information by persons or entities other than the intended recipient
> is prohibited and may be illegal. If you received this in error, please
> contact the sender and delete the message from your system.
>
> Mu Sigma takes all reasonable steps to ensure that its electronic
> communications are free from viruses. However, given Internet
> accessibility, the Company cannot accept liability for any virus introduced
> by this e-mail or any attachment and you are advised to use up-to-date
> virus checking software.
>

Reply via email to