You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Chandrasekhar M <ch...@impetus.co.in> on 2011/07/14 13:59:53 UTC

Thrift Java Client - Get a column family from a Keyspace

Hi

I have been playing around with Cassandra and its Java Thrift Client.

>From my understanding, one could get/retrieve a Keyspace, KsDef object, using the describe_keyspace(String name) method on the Cassandra.Client object.

Subsequently, one could get a list of all the ColumnFamily definitions in a keyspace, using the getCf_defs() method on the KsDef Object.

Is there a way to get a single ColumnFamily if I know the name of the columnfamily (just a convenience function) ?

Currently the only way for that would be iterating through the list of column families returned by the getCf_defs() method.

Thanks in Advance
Chandra

________________________________

Register for Impetus Webinar on 'Device Side Performance Optimization of Mobile Apps', July 08 (10:00 am Pacific Time). Impetus is presenting a Cassandra case study on July 11 as a sponsor for Cassandra SF 2011 in San Francisco.

Click http://www.impetus.com to know more. Follow us on www.twitter.com/impetuscalling


NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.

Re: Thrift Java Client - Get a column family from a Keyspace

Posted by aaron morton <aa...@thelastpickle.com>.
> Currently the only way for that would be iterating through the list of column families returned by the getCf_defs() method.

Yes. 

BTW most people access cassandra via a higher level client, for the Java peeps tend to use either  Hector or Pelops. Aside from not having to code against thrift they also provide connection management and retry features that are dead handy.  

Cheers

-----------------
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 14 Jul 2011, at 23:59, Chandrasekhar M wrote:

> Hi
>  
> I have been playing around with Cassandra and its Java Thrift Client.
>  
> From my understanding, one could get/retrieve a Keyspace, KsDef object, using the describe_keyspace(String name) method on the Cassandra.Client object.
>  
> Subsequently, one could get a list of all the ColumnFamily definitions in a keyspace, using the getCf_defs() method on the KsDef Object.
>  
> Is there a way to get a single ColumnFamily if I know the name of the columnfamily (just a convenience function) ?
>  
> Currently the only way for that would be iterating through the list of column families returned by the getCf_defs() method.
>  
> Thanks in Advance
> Chandra
> 
> 
> Register for Impetus Webinar on ‘Device Side Performance Optimization of Mobile Apps’, July 08 (10:00 am Pacific Time). Impetus is presenting a Cassandra case study on July 11 as a sponsor for Cassandra SF 2011 in San Francisco. 
> 
> Click http://www.impetus.com to know more. Follow us on www.twitter.com/impetuscalling 
> 
> 
> NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.