You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Mark <st...@gmail.com> on 2010/08/06 18:47:19 UTC

Cassandra 0.7 Ruby/Thrift Bindings

Has anyone had any success using Cassandra 0.7 w/ ruby? I'm attempting 
to use the fauan/cassandra gem (http://github.com/fauna/cassandra/) 
which has explicit support for 0.7 but I keep receiving the following 
error message when making a request.

Thrift::TransportException: end of file reached
     from 
/usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/transport/socket.rb:119:in 
`read'
     from 
/usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/transport/buffered_transport.rb:50:in 
`read'
     from 
/usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/transport/base_transport.rb:52:in 
`read_all'
     from 
/usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/protocol/binary_protocol.rb:186:in 
`read_i32'
     from 
/usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/protocol/binary_protocol.rb:111:in 
`read_message_begin'
     from 
/usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/client.rb:45:in 
`receive_message'
...

Any ideas? Thanks

Re: Cassandra 0.7 Ruby/Thrift Bindings

Posted by Jonathan Ellis <jb...@gmail.com>.
We are defaulting to framed in 0.7 because it enables the fix to
https://issues.apache.org/jira/browse/CASSANDRA-475

I am strongly in favor of removing the unframed option entirely in 0.8

On Fri, Aug 6, 2010 at 12:57 PM, Mark <st...@gmail.com> wrote:
> Wow.. fast answer AND correct. In Cassandra.yml
>
> # Frame size for thrift (maximum field length).
> # 0 disables TFramedTransport in favor of TSocket.
> thrift_framed_transport_size_in_mb: 15
>
> I just had to change that value to 0 and everything worked. Now for my
> follow up question :)  What is the difference between these two and why does
> 0.7 default to true while earlier versions default to false? Thanks again!
>
>
> On 8/6/10 9:51 AM, Ryan King wrote:
>>
>> Make sure the client and server are both using the same transport
>> (framed vs. non)
>>
>> -ryan
>>
>> On Fri, Aug 6, 2010 at 9:47 AM, Mark<st...@gmail.com>  wrote:
>>
>>>
>>> Has anyone had any success using Cassandra 0.7 w/ ruby? I'm attempting to
>>> use the fauan/cassandra gem (http://github.com/fauna/cassandra/) which
>>> has
>>> explicit support for 0.7 but I keep receiving the following error message
>>> when making a request.
>>>
>>> Thrift::TransportException: end of file reached
>>>    from
>>>
>>> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/transport/socket.rb:119:in
>>> `read'
>>>    from
>>>
>>> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/transport/buffered_transport.rb:50:in
>>> `read'
>>>    from
>>>
>>> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/transport/base_transport.rb:52:in
>>> `read_all'
>>>    from
>>>
>>> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/protocol/binary_protocol.rb:186:in
>>> `read_i32'
>>>    from
>>>
>>> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/protocol/binary_protocol.rb:111:in
>>> `read_message_begin'
>>>    from
>>>
>>> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/client.rb:45:in
>>> `receive_message'
>>> ...
>>>
>>> Any ideas? Thanks
>>>
>>>
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Re: Cassandra 0.7 Ruby/Thrift Bindings

Posted by Benjamin Black <b...@b3k.us>.
Ryan,

I believe my branch was merged into fauna some time ago by jmhodges.
However, 0.7 support must be explicitly enabled by require
'cassandra/0.7' as it currently defaults to 0.6.


b

On Fri, Aug 6, 2010 at 10:02 AM, Ryan King <ry...@twitter.com> wrote:
> On Fri, Aug 6, 2010 at 9:57 AM, Mark <st...@gmail.com> wrote:
>> Wow.. fast answer AND correct. In Cassandra.yml
>>
>> # Frame size for thrift (maximum field length).
>> # 0 disables TFramedTransport in favor of TSocket.
>> thrift_framed_transport_size_in_mb: 15
>>
>> I just had to change that value to 0 and everything worked. Now for my
>> follow up question :)  What is the difference between these two and why does
>> 0.7 default to true while earlier versions default to false? Thanks again!
>
> Ah, you're using 0.7. fauna-cassandra has not been updated for 0.7.
> There's an experimental branch for it here:
> http://github.com/b/cassandra/tree/0.7
>
> -ryan
>

Re: Cassandra 0.7 Ruby/Thrift Bindings

Posted by Ryan King <ry...@twitter.com>.
On Fri, Aug 6, 2010 at 9:57 AM, Mark <st...@gmail.com> wrote:
> Wow.. fast answer AND correct. In Cassandra.yml
>
> # Frame size for thrift (maximum field length).
> # 0 disables TFramedTransport in favor of TSocket.
> thrift_framed_transport_size_in_mb: 15
>
> I just had to change that value to 0 and everything worked. Now for my
> follow up question :)  What is the difference between these two and why does
> 0.7 default to true while earlier versions default to false? Thanks again!

Ah, you're using 0.7. fauna-cassandra has not been updated for 0.7.
There's an experimental branch for it here:
http://github.com/b/cassandra/tree/0.7

-ryan

Re: Cassandra 0.7 Ruby/Thrift Bindings

Posted by Mark <st...@gmail.com>.
Wow.. fast answer AND correct. In Cassandra.yml

# Frame size for thrift (maximum field length).
# 0 disables TFramedTransport in favor of TSocket.
thrift_framed_transport_size_in_mb: 15

I just had to change that value to 0 and everything worked. Now for my 
follow up question :)  What is the difference between these two and why 
does 0.7 default to true while earlier versions default to false? Thanks 
again!


On 8/6/10 9:51 AM, Ryan King wrote:
> Make sure the client and server are both using the same transport
> (framed vs. non)
>
> -ryan
>
> On Fri, Aug 6, 2010 at 9:47 AM, Mark<st...@gmail.com>  wrote:
>    
>> Has anyone had any success using Cassandra 0.7 w/ ruby? I'm attempting to
>> use the fauan/cassandra gem (http://github.com/fauna/cassandra/) which has
>> explicit support for 0.7 but I keep receiving the following error message
>> when making a request.
>>
>> Thrift::TransportException: end of file reached
>>     from
>> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/transport/socket.rb:119:in
>> `read'
>>     from
>> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/transport/buffered_transport.rb:50:in
>> `read'
>>     from
>> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/transport/base_transport.rb:52:in
>> `read_all'
>>     from
>> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/protocol/binary_protocol.rb:186:in
>> `read_i32'
>>     from
>> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/protocol/binary_protocol.rb:111:in
>> `read_message_begin'
>>     from
>> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/client.rb:45:in
>> `receive_message'
>> ...
>>
>> Any ideas? Thanks
>>
>>      


Re: Cassandra 0.7 Ruby/Thrift Bindings

Posted by Ryan King <ry...@twitter.com>.
Make sure the client and server are both using the same transport
(framed vs. non)

-ryan

On Fri, Aug 6, 2010 at 9:47 AM, Mark <st...@gmail.com> wrote:
> Has anyone had any success using Cassandra 0.7 w/ ruby? I'm attempting to
> use the fauan/cassandra gem (http://github.com/fauna/cassandra/) which has
> explicit support for 0.7 but I keep receiving the following error message
> when making a request.
>
> Thrift::TransportException: end of file reached
>    from
> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/transport/socket.rb:119:in
> `read'
>    from
> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/transport/buffered_transport.rb:50:in
> `read'
>    from
> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/transport/base_transport.rb:52:in
> `read_all'
>    from
> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/protocol/binary_protocol.rb:186:in
> `read_i32'
>    from
> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/protocol/binary_protocol.rb:111:in
> `read_message_begin'
>    from
> /usr/local/lib/ruby/gems/1.8/gems/thrift-0.2.0.4/lib/thrift/client.rb:45:in
> `receive_message'
> ...
>
> Any ideas? Thanks
>