You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by aaron morton <aa...@thelastpickle.com> on 2012/09/03 07:15:05 UTC
Re: Composite row keys with SSTableSimpleUnsortedWriter for Cassandra 1.0?
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
-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com
On 1/09/2012, at 6:44 AM, Jeff Schmidt <ja...@535consulting.com> wrote:
> Hello:
>
> 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.
>
> 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.
>
> I can define the desired composite time and provide it to the SSTableSimpleUnsortedWriter constructor:
>
> List<AbstractType<?>> compositeList = new ArrayList<AbstractType<?>>();
> compositeList.add(UTF8Type.instance)
> compositeList.add(UTF8Type.instance)
> compositeUtf8Utf8Type = CompositeType.getInstance(compositeList)
>
> articleWriter = 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
> jas@535consulting.com
> http://www.535consulting.com
> (650) 423-1068
>
>
>
>
>
>
>
>
>
>