I think this code is from the thrift part. I use hector. In hector, I can create multiple keyspace objects for each keyspace and use them when I want to talk to that keyspace. Why will it need to do a round trip to the server for each switch.
On Thu, Nov 8, 2012 at 3:28 PM, Edward Capriolo <edlinuxg...@gmail.com>wrote: > In the old days the API looked like this. > > client.insert("Keyspace1", > key_user_id, > new ColumnPath("Standard1", null, "name".getBytes("UTF-8")), > "Chris Goffinet".getBytes("UTF-8"), > timestamp, > ConsistencyLevel.ONE); > > but now it works like this > > /----pay attention to this below -------------/ > client.set_keyspace("keyspace1"); > /----pay attention to this above -------------/ > client.insert( > key_user_id, > new ColumnPath("Standard1", null, > "name".getBytes("UTF-8")), > "Chris Goffinet".getBytes("UTF-8"), > timestamp, > ConsistencyLevel.ONE); > > So each time you switch keyspaces you make a network round trip. > > On Thu, Nov 8, 2012 at 6:17 PM, sankalp kohli <kohlisank...@gmail.com> > wrote: > > I am a bit confused. One connection pool I know is the one which > > MessageService has to other nodes. Then there will be incoming > connections > > via thrift from clients. How are they affected by multiple keyspaces? > > > > > > On Thu, Nov 8, 2012 at 3:14 PM, Edward Capriolo <edlinuxg...@gmail.com> > > wrote: > >> > >> Any connection pool. Imagine if you have 10 column families in 10 > >> keyspaces. You pull a connection off the pool and the odds are 1 in 10 > >> of it being connected to the keyspace you want. So 9 out of 10 times > >> you have to have a network round trip just to change the keyspace, or > >> you have to build a keyspace aware connection pool. > >> Edward > >> > >> On Thu, Nov 8, 2012 at 5:36 PM, sankalp kohli <kohlisank...@gmail.com> > >> wrote: > >> > Which connection pool are you talking about? > >> > > >> > > >> > On Thu, Nov 8, 2012 at 2:19 PM, Edward Capriolo < > edlinuxg...@gmail.com> > >> > wrote: > >> >> > >> >> it is better to have one keyspace unless you need to replicate the > >> >> keyspaces differently. The main reason for this is that changing > >> >> keyspaces requires an RPC operation. Having 10 keyspaces would mean > >> >> having 10 connection pools. > >> >> > >> >> On Thu, Nov 8, 2012 at 4:59 PM, sankalp kohli < > kohlisank...@gmail.com> > >> >> wrote: > >> >> > Is it better to have 10 Keyspaces with 10 CF in each keyspace. or > 100 > >> >> > keyspaces with 1 CF each. > >> >> > I am talking in terms of memory footprint. > >> >> > Also I would be interested to know how much better one is over > other. > >> >> > > >> >> > Thanks, > >> >> > Sankalp > >> > > >> > > > > > >