Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 9461 invoked from network); 28 Sep 2010 23:36:02 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Sep 2010 23:36:02 -0000 Received: (qmail 7232 invoked by uid 500); 28 Sep 2010 23:36:01 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 7180 invoked by uid 500); 28 Sep 2010 23:36:00 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 7172 invoked by uid 99); 28 Sep 2010 23:36:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Sep 2010 23:36:00 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ryan@twitter.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-ww0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Sep 2010 23:35:55 +0000 Received: by wwd20 with SMTP id 20so154682wwd.25 for ; Tue, 28 Sep 2010 16:35:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.137.199 with SMTP id x7mr661169wbt.107.1285716933303; Tue, 28 Sep 2010 16:35:33 -0700 (PDT) Received: by 10.227.134.203 with HTTP; Tue, 28 Sep 2010 16:35:33 -0700 (PDT) In-Reply-To: References: Date: Tue, 28 Sep 2010 16:35:33 -0700 Message-ID: Subject: Re: avro + cassandra + ruby From: Ryan King To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 On Tue, Sep 28, 2010 at 4:06 PM, Gabor Torok 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 >