You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Shubham Mittal <sm...@gmail.com> on 2013/07/08 15:14:16 UTC

Working with libcql

Hi,

I found out that there exist a C++ client libcql for cassandra but its
github repository just provides the example on how to connect to cassandra.
Is there anyone who has written some code using libcql to read and write
data to a cassandra DB, kindly share it.

Thanks

Re: Working with libcql

Posted by Shubham Mittal <sm...@gmail.com>.
So, if I want to create a keyspace, what do I need to change in that file?


On Thu, Jul 11, 2013 at 5:04 AM, aaron morton <aa...@thelastpickle.com>wrote:

> The highlighted line will read all the rows from the system table that
> lists the keyspaces in the cluster.
>
> Cheers
>
> -----------------
> Aaron Morton
> Freelance Cassandra Consultant
> New Zealand
>
> @aaronmorton
> http://www.thelastpickle.com
>
> On 9/07/2013, at 9:46 PM, Shubham Mittal <sm...@gmail.com> wrote:
>
> yeah I tried that and below is the output I get
>
> LOG: resolving remote host localhost:9160
> LOG: resolved remote host, attempting to connect
> LOG: connection successful to remote host
> LOG: sending message: 0x0100000500000000 {version: 0x01, flags: 0x00,
> stream: 0x00, opcode: 0x05, length: 0} OPTIONS
> LOG: wrote to socket 8 bytes
> LOG: error reading header End of file
>
> and I checked all the keyspaces in my cluster, it changes nothing in the
> cluster.
>
> I couldn't understand the code much. What is this code supposed to do
> anyways?
>
>
> On Tue, Jul 9, 2013 at 4:20 AM, aaron morton <aa...@thelastpickle.com>wrote:
>
>> Did you see the demo app ?
>> Seems to have a few examples of reading data.
>>
>> https://github.com/mstump/libcql/blob/master/demo/main.cpp#L85
>>
>> Cheers
>>
>>    -----------------
>> Aaron Morton
>> Freelance Cassandra Consultant
>> New Zealand
>>
>> @aaronmorton
>> http://www.thelastpickle.com
>>
>> On 9/07/2013, at 1:14 AM, Shubham Mittal <sm...@gmail.com> wrote:
>>
>> Hi,
>>
>> I found out that there exist a C++ client libcql for cassandra but its
>> github repository just provides the example on how to connect to cassandra.
>> Is there anyone who has written some code using libcql to read and write
>> data to a cassandra DB, kindly share it.
>>
>> Thanks
>>
>>
>>
>
>

Re: Working with libcql

Posted by aaron morton <aa...@thelastpickle.com>.
The highlighted line will read all the rows from the system table that lists the keyspaces in the cluster. 

Cheers

-----------------
Aaron Morton
Freelance Cassandra Consultant
New Zealand

@aaronmorton
http://www.thelastpickle.com

On 9/07/2013, at 9:46 PM, Shubham Mittal <sm...@gmail.com> wrote:

> yeah I tried that and below is the output I get 
> 
> LOG: resolving remote host localhost:9160
> LOG: resolved remote host, attempting to connect
> LOG: connection successful to remote host
> LOG: sending message: 0x0100000500000000 {version: 0x01, flags: 0x00, stream: 0x00, opcode: 0x05, length: 0} OPTIONS
> LOG: wrote to socket 8 bytes
> LOG: error reading header End of file
> 
> and I checked all the keyspaces in my cluster, it changes nothing in the cluster.
> 
> I couldn't understand the code much. What is this code supposed to do anyways?
> 
> 
> On Tue, Jul 9, 2013 at 4:20 AM, aaron morton <aa...@thelastpickle.com> wrote:
> Did you see the demo app ? 
> Seems to have a few examples of reading data. 
> 
> https://github.com/mstump/libcql/blob/master/demo/main.cpp#L85
> 
> Cheers
> 
> -----------------
> Aaron Morton
> Freelance Cassandra Consultant
> New Zealand
> 
> @aaronmorton
> http://www.thelastpickle.com
> 
> On 9/07/2013, at 1:14 AM, Shubham Mittal <sm...@gmail.com> wrote:
> 
>> Hi,
>> 
>> I found out that there exist a C++ client libcql for cassandra but its github repository just provides the example on how to connect to cassandra. Is there anyone who has written some code using libcql to read and write data to a cassandra DB, kindly share it.
>> 
>> Thanks
> 
> 


Re: Working with libcql

Posted by Sorin Manolache <so...@gmail.com>.
On 2013-07-09 11:46, Shubham Mittal wrote:
> yeah I tried that and below is the output I get
>
> LOG: resolving remote host localhost:9160


libcql is an implementation for the "new binary transport protocol": 
https://git-wip-us.apache.org/repos/asf?p=cassandra.git;a=blob_plain;f=doc/native_protocol.spec;hb=refs/heads/cassandra-1.2

It is not a thrift transport.

By default it uses the 9042 port.  You'll have to activate it on the 
server. Write (or uncomment) "start_native_transport: true" in 
conf/cassandra.yaml.

According to the posted log, you connect to the thrift transport port, 
9160. As you send a frame of the new transport protocol to the old 
thrift protocol, the server does not understand it and closes your 
connection.

Regards,
Sorin


> LOG: resolved remote host, attempting to connect
> LOG: connection successful to remote host
> LOG: sending message: 0x0100000500000000 {version: 0x01, flags: 0x00,
> stream: 0x00, opcode: 0x05, length: 0} OPTIONS
> LOG: wrote to socket 8 bytes
> LOG: error reading header End of file
>
> and I checked all the keyspaces in my cluster, it changes nothing in the
> cluster.
>
> I couldn't understand the code much. What is this code supposed to do
> anyways?
>
>
> On Tue, Jul 9, 2013 at 4:20 AM, aaron morton <aaron@thelastpickle.com
> <ma...@thelastpickle.com>> wrote:
>
>     Did you see the demo app ?
>     Seems to have a few examples of reading data.
>
>     https://github.com/mstump/libcql/blob/master/demo/main.cpp#L85
>
>     Cheers
>
>     -----------------
>     Aaron Morton
>     Freelance Cassandra Consultant
>     New Zealand
>
>     @aaronmorton
>     http://www.thelastpickle.com
>
>     On 9/07/2013, at 1:14 AM, Shubham Mittal <smsmittal14@gmail.com
>     <ma...@gmail.com>> wrote:
>
>>     Hi,
>>
>>     I found out that there exist a C++ client libcql for cassandra but
>>     its github repository just provides the example on how to connect
>>     to cassandra. Is there anyone who has written some code
>>     using libcql to read and write data to a cassandra DB, kindly
>>     share it.
>>
>>     Thanks
>
>


Re: Working with libcql

Posted by Shubham Mittal <sm...@gmail.com>.
yeah I tried that and below is the output I get

LOG: resolving remote host localhost:9160
LOG: resolved remote host, attempting to connect
LOG: connection successful to remote host
LOG: sending message: 0x0100000500000000 {version: 0x01, flags: 0x00,
stream: 0x00, opcode: 0x05, length: 0} OPTIONS
LOG: wrote to socket 8 bytes
LOG: error reading header End of file

and I checked all the keyspaces in my cluster, it changes nothing in the
cluster.

I couldn't understand the code much. What is this code supposed to do
anyways?


On Tue, Jul 9, 2013 at 4:20 AM, aaron morton <aa...@thelastpickle.com>wrote:

> Did you see the demo app ?
> Seems to have a few examples of reading data.
>
> https://github.com/mstump/libcql/blob/master/demo/main.cpp#L85
>
> Cheers
>
> -----------------
> Aaron Morton
> Freelance Cassandra Consultant
> New Zealand
>
> @aaronmorton
> http://www.thelastpickle.com
>
> On 9/07/2013, at 1:14 AM, Shubham Mittal <sm...@gmail.com> wrote:
>
> Hi,
>
> I found out that there exist a C++ client libcql for cassandra but its
> github repository just provides the example on how to connect to cassandra.
> Is there anyone who has written some code using libcql to read and write
> data to a cassandra DB, kindly share it.
>
> Thanks
>
>
>

Re: Working with libcql

Posted by aaron morton <aa...@thelastpickle.com>.
Did you see the demo app ? 
Seems to have a few examples of reading data. 

https://github.com/mstump/libcql/blob/master/demo/main.cpp#L85

Cheers

-----------------
Aaron Morton
Freelance Cassandra Consultant
New Zealand

@aaronmorton
http://www.thelastpickle.com

On 9/07/2013, at 1:14 AM, Shubham Mittal <sm...@gmail.com> wrote:

> Hi,
> 
> I found out that there exist a C++ client libcql for cassandra but its github repository just provides the example on how to connect to cassandra. Is there anyone who has written some code using libcql to read and write data to a cassandra DB, kindly share it.
> 
> Thanks