You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Satoshi Yamada <bi...@yahoo.co.jp> on 2012/08/13 04:27:52 UTC

[gem] does "disconnect!" work properly?

hi,
I wonder if disconnect! method works properly in gem cassandrabecause the code below does not cause exception.
-----------------
client = Cassandra.new('pool', host_ip)
ret = client.get(:db, 'test', key, option_one)p retclient.disconnect!
ret = client.get(:db, 'test', key, option_one)p ret
-----------------
I use gem cassandra 0.14.0http://rubygems.org/gems/cassandra/versions/0.14.0
thanks in advance,satoshi

Re: [gem] does "disconnect!" work properly?

Posted by Satoshi Yamada <bi...@yahoo.co.jp>.
aaron,
i understand Ruby client automatically re-connects.
thanks,satoshi

--- On Mon, 2012/8/13, aaron morton <aa...@thelastpickle.com> wrote:

My rough understanding of the ruby code is that it auto connects if necessary when you make a request.
i.e. your get turns into a _multiget call here 
https://github.com/twitter/cassandra/blob/master/lib/cassandra/protocol.rb#L52
and that result is in a client connection if necessary 
https://github.com/twitter/cassandra/blob/master/lib/cassandra/cassandra.rb#L1043
If you still feel there is an problem the Issue list of github is probably the place to go https://github.com/twitter/cassandra/issues
Cheers

-----------------Aaron MortonFreelance Developer@aaronmortonhttp://www.thelastpickle.com



On 13/08/2012, at 2:27 PM, Satoshi Yamada <bi...@yahoo.co.jp> wrote:
hi,
I wonder if disconnect! method works properly in gem cassandrabecause the code below does not cause exception.
-----------------
client = Cassandra.new('pool', host_ip)
ret = client.get(:db, 'test', key, option_one)p retclient.disconnect!
ret = client.get(:db, 'test', key, option_one)p ret
-----------------
I use gem cassandra 0.14.0http://rubygems.org/gems/cassandra/versions/0.14.0
thanks in advance,satoshi

Re: [gem] does "disconnect!" work properly?

Posted by aaron morton <aa...@thelastpickle.com>.
My rough understanding of the ruby code is that it auto connects if necessary when you make a request.

i.e. your get turns into a _multiget call here 

https://github.com/twitter/cassandra/blob/master/lib/cassandra/protocol.rb#L52

and that result is in a client connection if necessary 

https://github.com/twitter/cassandra/blob/master/lib/cassandra/cassandra.rb#L1043

If you still feel there is an problem the Issue list of github is probably the place to go https://github.com/twitter/cassandra/issues

Cheers

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

On 13/08/2012, at 2:27 PM, Satoshi Yamada <bi...@yahoo.co.jp> wrote:

> 
> hi,
> 
> I wonder if disconnect! method works properly in gem cassandra
> because the code below does not cause exception.
> 
> -----------------
> 
> client = Cassandra.new('pool', host_ip)
> 
> ret = client.get(:db, 'test', key, option_one)
> p ret
> client.disconnect!
> 
> ret = client.get(:db, 'test', key, option_one)
> p ret
> 
> -----------------
> 
> I use gem cassandra 0.14.0
> http://rubygems.org/gems/cassandra/versions/0.14.0
> 
> thanks in advance,
> satoshi