Re: Dividing the client load between machines in Cassandra

2010-03-17 Thread Sonny Heer
Opps. Yep, thanks! On Wed, Mar 17, 2010 at 1:47 PM, Jonathan Ellis wrote: > You didn't call tr.open() ? > > On Wed, Mar 17, 2010 at 3:45 PM, Sonny Heer wrote: >> I'm getting: >> org.apache.thrift.transport.TTransportException: Cannot write to null >> outputStream >>        at >> org.apache.thr

Re: Dividing the client load between machines in Cassandra

2010-03-17 Thread Jonathan Ellis
You didn't call tr.open() ? On Wed, Mar 17, 2010 at 3:45 PM, Sonny Heer wrote: > I'm getting: > org.apache.thrift.transport.TTransportException: Cannot write to null > outputStream >        at > org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:137) >        at > org.

Re: Dividing the client load between machines in Cassandra

2010-03-17 Thread Sonny Heer
I'm getting: org.apache.thrift.transport.TTransportException: Cannot write to null outputStream at org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:137) at org.apache.thrift.protocol.TBinaryProtocol.writeI32(TBinaryProtocol.java:152) at org.apa

Re: Dividing the client load between machines in Cassandra

2010-03-17 Thread Sonny Heer
Cool thanks Todd. I'd be interested at some point to see the updated .6 version as well. Thanks again! On Wed, Mar 17, 2010 at 9:24 AM, B. Todd Burruss wrote: > below is the commented out code i once used.  i think it is from the 0.5 > days, so it might not even work now.  not sure.  the bootst

Re: Dividing the client load between machines in Cassandra

2010-03-17 Thread B. Todd Burruss
below is the commented out code i once used. i think it is from the 0.5 days, so it might not even work now. not sure. the bootstrapHostArr is simply a list of host information used to bootstrap the process. connectToHost is a method used to generate a Cassandra.Client object. there is sam

Re: Dividing the client load between machines in Cassandra

2010-03-16 Thread Sonny Heer
Is there some example code on how to do this? On Tue, Mar 16, 2010 at 3:07 PM, Jonathan Ellis wrote: > token map is an internal representation, so returning the internal IPs > is correct, even though this makes it slightly more difficult to use > for thrift clients. > > On Tue, Mar 16, 2010 at 4:

Re: Dividing the client load between machines in Cassandra

2010-03-16 Thread Jonathan Ellis
token map is an internal representation, so returning the internal IPs is correct, even though this makes it slightly more difficult to use for thrift clients. On Tue, Mar 16, 2010 at 4:55 PM, B. Todd Burruss wrote: > if you choose #3 - get_string_property("token map") - keep in mind that the > I

Re: Dividing the client load between machines in Cassandra

2010-03-16 Thread B. Todd Burruss
if you choose #3 - get_string_property("token map") - keep in mind that the IPs returned from this call are the IPs used for "ListenAddress" param in storage-conf.xml. In my case we have two NICs and I set this to be an IP that is only for "node to node" communication. The "ThriftAddress" par

Re: Dividing the client load between machines in Cassandra

2010-03-16 Thread Jonathan Ellis
http://wiki.apache.org/cassandra/FAQ#node_clients_connect_to On Tue, Mar 16, 2010 at 4:30 PM, Sonny Heer wrote: > How can I accomplish this? > > The way I'm doing it now it is creating a TSocket connection using a > static IP of one of the boxes on Cassandra: >        TTransport tr = new TSocket(

Re: Dividing the client load between machines in Cassandra

2010-03-16 Thread Tom Chen
Try using the cassandra hector client. It has failover and load balancing built in. http://github.com/rantav/hector Tom On Tue, Mar 16, 2010 at 2:30 PM, Sonny Heer wrote: > How can I accomplish this? > > The way I'm doing it now it is creating a TSocket conne

Dividing the client load between machines in Cassandra

2010-03-16 Thread Sonny Heer
How can I accomplish this? The way I'm doing it now it is creating a TSocket connection using a static IP of one of the boxes on Cassandra: TTransport tr = new TSocket(host, port.intValue()); TProtocol proto = new TBinaryProtocol(tr); Cassandra.Client client = new Cassandra