From user-return-28526-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Mon Sep 3 05:15:40 2012 Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F0E97DA3A for ; Mon, 3 Sep 2012 05:15:39 +0000 (UTC) Received: (qmail 35100 invoked by uid 500); 3 Sep 2012 05:15:37 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 34917 invoked by uid 500); 3 Sep 2012 05:15:36 -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 34896 invoked by uid 99); 3 Sep 2012 05:15:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2012 05:15:36 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a49.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2012 05:15:28 +0000 Received: from homiemail-a49.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a49.g.dreamhost.com (Postfix) with ESMTP id 842465E0059 for ; Sun, 2 Sep 2012 22:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h=from :content-type:message-id:mime-version:subject:date:references:to :in-reply-to; s=thelastpickle.com; bh=SSYMK3GtGNFPmsLyHwEm4rY93V E=; b=eIc5ZwttWDDSgKPbE8mKyhGeLbNSjRvgZsDCpQNcdfMXrsk787sRhPlLDO jh+4BWGx/dS1G6xGuks09uVJyYphY+ztCvwXpXZhK8mBxmFr7URfPhRLBHu/efx5 BD2opEH6RzX1dU8WwdgVXLdkyIW4vsqVjazslgA0AQxjxPTX0= Received: from [172.20.10.2] (unknown [118.149.97.151]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a49.g.dreamhost.com (Postfix) with ESMTPSA id 8892A5E0058 for ; Sun, 2 Sep 2012 22:15:04 -0700 (PDT) From: aaron morton Content-Type: multipart/alternative; boundary="Apple-Mail=_9EE9DE14-EDE5-4A79-A33C-C2DEE7844AA4" Message-Id: <571842AC-AD1D-4F27-8FAE-C7DC50DA789A@thelastpickle.com> Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) Subject: Re: Composite row keys with SSTableSimpleUnsortedWriter for Cassandra 1.0? Date: Mon, 3 Sep 2012 17:15:05 +1200 References: <533F6163-923D-42B6-A198-A9511F4FA158@535consulting.com> To: user@cassandra.apache.org In-Reply-To: <533F6163-923D-42B6-A198-A9511F4FA158@535consulting.com> X-Mailer: Apple Mail (2.1486) --Apple-Mail=_9EE9DE14-EDE5-4A79-A33C-C2DEE7844AA4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I think you want the o.a.c.db.marshal.TypeParser.=20 You can pass a CLI format composite type to the parse() func.=20 It's in 1.0X Cheers ----------------- Aaron Morton Freelance Developer @aaronmorton http://www.thelastpickle.com On 1/09/2012, at 6:44 AM, Jeff Schmidt wrote: > Hello: >=20 > I'm using DataStax Enterprise 2.1, which is based on Cassandra 1.0.10 = from what I can tell. For my project, I perform a content build that = generates a number of SSTables using SSTableSimpleUnsortedWriter. These = are loaded using either JMX or sstableloader depending on the = environment. >=20 > I want to introduce a composite row key into some of the generated = SSTables. Also, I will be referring to these keys by using composite = column names. >=20 > I can define the desired composite time and provide it to the = SSTableSimpleUnsortedWriter constructor: >=20 > List> compositeList =3D new = ArrayList>(); > compositeList.add(UTF8Type.instance) > compositeList.add(UTF8Type.instance) > compositeUtf8Utf8Type =3D = CompositeType.getInstance(compositeList) > =09 > articleWriter =3D new SSTableSimpleUnsortedWriter( > cassandraOutputDir, > "IngenuityContent", > "Articles", > compositeUtf8Utf8Type, > null, > 64)=09 >=20 > I then figured I could use compositeUtf8Utf8Type when creating = composite row keys and column names of the kind I require. Cassandra = 1.1.x introduces the CompositeType.Builder class for creating actual = composite values, but that's not available to me. I've also seen = examples of using Hector's Composite to create composite values. >=20 > But, I need to create these values using the various classes within = Cassandra 1.0 itself to work with SSTableSimpleUnsortedWriter. For that, = I'm not finding any examples on how one does that. >=20 > As far as I can tell, composite columns at least have been around = since Cassandra 0.8.x? Is there the support I need in Cassandra 1.0.x? >=20 > Many thanks! >=20 > Jeff > -- > Jeff Schmidt > 535 Consulting > jas@535consulting.com > http://www.535consulting.com > (650) 423-1068 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 --Apple-Mail=_9EE9DE14-EDE5-4A79-A33C-C2DEE7844AA4 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii I = think you want the = o.a.c.db.marshal.TypeParser. 

You can pass a CLI = format composite type to the parse() = func. 

It's in = 1.0X

Cheers

http://www.thelastpickle.com

On 1/09/2012, at 6:44 AM, Jeff Schmidt <jas@535consulting.com> = wrote:

= List<AbstractType<?>> compositeList = =3D new ArrayList<AbstractType<?>>();
= compositeList.add(UTF8Type.instance)
= compositeList.add(UTF8Type.instance)
= compositeUtf8Utf8Type =3D = CompositeType.getInstance(compositeList)

= articleWriter =3D new SSTableSimpleUnsortedWriter( = cassandraOutputDir,
= "IngenuityContent",
= "Articles",
= compositeUtf8Utf8Type,
null,
= 64) =

I then figured I could = use compositeUtf8Utf8Type when creating composite row keys and = column names of the kind I require.  Cassandra 1.1.x introduces the = CompositeType.Builder class for creating actual composite values, but = that's not available to me.  I've also  seen examples of using = Hector's Composite to create composite = values.

But, I need to create these values = using the various classes within Cassandra 1.0 itself to work = with SSTableSimpleUnsortedWriter. For that, I'm not finding any = examples on how one does that.

As far as I can = tell, composite columns at least have been around since Cassandra 0.8.x? =  Is there the support I need in Cassandra = 1.0.x?

Many = thanks!

Jeff
--
Jeff Schmidt
535 = Consulting






= --Apple-Mail=_9EE9DE14-EDE5-4A79-A33C-C2DEE7844AA4--