cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan King <r...@twitter.com>
Subject Re: avro + cassandra + ruby
Date Tue, 28 Sep 2010 23:35:33 GMT
On Tue, Sep 28, 2010 at 4:06 PM, Gabor Torok
<Gabor.Torok@sunpowercorp.com> wrote:
> Hi,
> I'm attempting to use avro to talk to cassandra because the ruby thrift client's read
performance is pretty bad (I measured 4x slower than java).

Only 4x feels like a win. :)

One thing you should try is to make thrift use
BinaryProtocolAccelerated, rather than the pure-ruby implementation
(we should change the default).

-ryan

> However, I run into a problem when calling multiget_slice.
> The server gives a KeyspaceNotDefinedException because clientState.getKeyspace() returns
null.
> It seems this is because ClientState stores the keyspace in a ThreadLocal.
>
> I call set_keyspace and clientState stores the keyspace value. I guess the next avro
call to multiget_slice runs in a different thread so it can't retrieve the value.
>
> In ruby, I use Avro::IPC::HTTPTransceiver as the transport which I believe is a stateless
transport. I also tried SocketTransport, but that died with a malloc exception.
>
> Is this a problem with the ruby avro library (I use avro 1.4.0), or how the server handles
avro threads?
> Any help would be appreciated!
>
> Thanks,
> --Gabor
>

Mime
View raw message