Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 79642 invoked from network); 2 Nov 2010 12:45:39 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Nov 2010 12:45:39 -0000 Received: (qmail 81063 invoked by uid 500); 2 Nov 2010 12:46:09 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 81020 invoked by uid 500); 2 Nov 2010 12:46:04 -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 80988 invoked by uid 99); 2 Nov 2010 12:46:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Nov 2010 12:46:04 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rantav@gmail.com designates 209.85.212.44 as permitted sender) Received: from [209.85.212.44] (HELO mail-vw0-f44.google.com) (209.85.212.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Nov 2010 12:45:59 +0000 Received: by vws3 with SMTP id 3so5121617vws.31 for ; Tue, 02 Nov 2010 05:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=+XUcQPMKZBJl8ZCD3x2B2Q7z0zbIOEnhm3cAMNUiVAI=; b=PL/6QF38GHKYbiVHxsJ1tODAmp5CvX1veTrlXRZ/MGCFIordOPbDlopsOwwDVNgo6s 5RvxYNYm2M+j6bulwyt58P8BoXg7f6SgwSD8BJk3OF4O1ekPEvVyButRHHVg9S2rIN5M lRfIEtcQN/CiTEb+JdVqxIehScDuEYvmrSADY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=PxZIF5BvgKoF4iEQGvvZ3nZbPutU8K/+n9sR3OM9lpltlaZI4gZNmJc18U+aSrNAkJ 9kXBsLXie5YaZ4yqemAPUezRP8NPS/X+c5UMPyI7KuVpcPjzIr5LYO2NvvxTXW/roHL2 QDpF1DXHkpKmKLJkI8hM9YC1hV36tV76e8bqU= Received: by 10.224.179.19 with SMTP id bo19mr5853923qab.387.1288701938690; Tue, 02 Nov 2010 05:45:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.230.79 with HTTP; Tue, 2 Nov 2010 05:45:08 -0700 (PDT) In-Reply-To: References: From: Ran Tavory Date: Tue, 2 Nov 2010 14:45:08 +0200 Message-ID: Subject: Re: Hector question under cassandra 0.7 To: Hector Users Content-Type: multipart/alternative; boundary=20cf302ef9b646eb500494114db9 --20cf302ef9b646eb500494114db9 Content-Type: text/plain; charset=UTF-8 user@cass to bcc Indeed, the KeyspaceOperator isn't thread safe. (and in recent revisions it was extracted to an interface at http://github.com/rantav/hector/blob/master/src/main/java/me/prettyprint/hector/api/Keyspace.javaand implementation at http://github.com/rantav/hector/blob/master/src/main/java/me/prettyprint/cassandra/model/ExecutingKeyspace.java On Thu, Oct 21, 2010 at 12:10 AM, Ned Wolpert wrote: > I figure I'd reply to my own question in case this helps others. > > Talking on the IRC, having one KeyspaceOperator per thread (via > ThreadLocal) makes sense. > > > On Wed, Oct 20, 2010 at 9:13 AM, Ned Wolpert wrote: > >> Folks- >> >> I'm finally upgrading the grails-cassandra plugin for 0.7, and wanted to >> understand a bit more on the usage of the Cluster and KeyspaceOperator . Is >> the cluster object retrieved from HFactor.createCluster() thread safe, and >> is the KeyspaceOperator required to only be in one thread? Or are both >> thread safe objects? My assumption is I can call createCluster any time as >> it will only create one cluster object. I'm trying to decide if the >> KeyspaceOperator should be unique to each thread (threadlocal variable) or >> unique to each web request. >> >> Thanks >> >> -- >> Virtually, Ned Wolpert >> >> "Settle thy studies, Faustus, and begin..." --Marlowe >> > > > > -- > Virtually, Ned Wolpert > > "Settle thy studies, Faustus, and begin..." --Marlowe > -- /Ran --20cf302ef9b646eb500494114db9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
user@cass to bcc

Indeed, the KeyspaceOp= erator isn't thread safe. (and in recent revisions it was extracted to = an interface at http://github.com/rantav= /hector/blob/master/src/main/java/me/prettyprint/hector/api/Keyspace.java and implementation at=C2=A0http://github.com/rantav/hector/blob/master/src/main/java/me/prettyprin= t/cassandra/model/ExecutingKeyspace.java

On Thu, Oct 21, 2010 at 12:10 AM, Ned Wolper= t <ned.wo= lpert@imemories.com> wrote:

On Wed, Oct 20, 2010 at 9:13 AM, Ned Wolpert <ned.wolpert@imemori= es.com> wrote:
Folks-

=C2=A0=C2=A0I'= m finally upgrading the grails-cassandra plugin for 0.7, and wanted to unde= rstand a bit more on the usage of the Cluster and KeyspaceOperator . Is the= cluster object retrieved from HFactor.createCluster() thread safe, and is = the KeyspaceOperator required to only be in one thread? Or are both thread = safe objects? My assumption is I can call createCluster any time as it will= only create one cluster object. I'm trying to decide if the KeyspaceOp= erator should be unique to each thread (threadlocal variable) or unique to = each web request.

=C2=A0=C2=A0Thanks

--
Virtuall= y, Ned Wolpert

"Settle thy studies, Faustus, and begin..."= =C2=A0=C2=A0 --Marlowe



--
Virtually, Ned Wolpert<= br>
"Settle thy studies, Faustus, and begin..."=C2=A0=C2=A0 --= Marlowe



--
/Ran

--20cf302ef9b646eb500494114db9--