From user-return-7220-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Fri Jul 02 21:50:21 2010 Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 81473 invoked from network); 2 Jul 2010 21:50:21 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Jul 2010 21:50:21 -0000 Received: (qmail 6906 invoked by uid 500); 2 Jul 2010 21:50:20 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 6840 invoked by uid 500); 2 Jul 2010 21:50:19 -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 6832 invoked by uid 99); 2 Jul 2010 21:50:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jul 2010 21:50:19 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.212.44] (HELO mail-vw0-f44.google.com) (209.85.212.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jul 2010 21:50:13 +0000 Received: by vws14 with SMTP id 14so2636215vws.31 for ; Fri, 02 Jul 2010 14:49:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.172.198 with SMTP id m6mr737715vcz.79.1278107391434; Fri, 02 Jul 2010 14:49:51 -0700 (PDT) Received: by 10.220.182.10 with HTTP; Fri, 2 Jul 2010 14:49:51 -0700 (PDT) In-Reply-To: References: Date: Sat, 3 Jul 2010 07:49:51 +1000 Message-ID: Subject: Re: Pelops 'up and running' post question + WTF is a SuperColumn => really confused. From: Dan Washusen To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=00163630ec9d0d1f07048a6e915c X-Virus-Checked: Checked by ClamAV on apache.org --00163630ec9d0d1f07048a6e915c Content-Type: text/plain; charset=ISO-8859-1 L1Tickets = { // column family userId: { // row key 42C120DF-D44A-44E4-9BDC-2B5439A5C7B4: { category: "videoPhone", reportType: "POOR_PICTURE", ...}, 99B60047-382A-4237-82CE-AE53A74FB747: { category: "somethingElse", reportType: "FOO", ...} } } On 3 July 2010 02:29, S Ahmed wrote: > > https://ria101.wordpress.com/2010/06/11/pelops-the-beautiful-cassandra-database-client-for-java > > So using the code snipped below, I want to create a json representation of > the CF (super). > > > /** > * Write multiple sub-column values to a super column... > * @param rowKey The key of the row to modify > * @param colFamily The name of the super column family to > operate on > * @param colName The name of the super column > * @param subColumns A list of the sub-columns to write > */ > mutator. writeSubColumns( > userId, > "L1Tickets", > UuidHelper.newTimeUuidBytes(), // using a UUID value that sorts by time > mutator.newColumnList( > mutator.newColumn("category", "videoPhone"), > mutator.newColumn("reportType", "POOR_PICTURE"), > mutator.newColumn("createdDate", > NumberHelper.toBytes(System.currentTimeMillis())), > mutator.newColumn("capture", jpegBytes), > mutator.newColumn("comment") )); > > > Can someone show me what it would look like? > > This is what I have so far.... > > SupportTickets = { > > userId : { > > L1Tickets : { } > > } > > > } > > > But from what I understood, a CF of type super looks like ( > http://arin.me/blog/wtf-is-a-supercolumn-cassandra-data-model) : > > AddressBook = { // this is a ColumnFamily of type Super > phatduckk: { // this is the key to this row inside the Super CF > // the key here is the name of the owner of the address book > > // now we have an infinite # of super columns in this row > // the keys inside the row are the names for the SuperColumns > // each of these SuperColumns is an address book entry > friend1: {street: "8th street", zip: "90210", city: "Beverley > Hills", state: "CA"}, > > // this is the address book entry for John in phatduckk's address > book > John: {street: "Howard street", zip: "94404", city: "FC", state: > "CA"}, > Kim: {street: "X street", zip: "87876", city: "Balls", state: > "VA"}, > Tod: {street: "Jerry street", zip: "54556", city: "Cartoon", state: > "CO"}, > Bob: {street: "Q Blvd", zip: "24252", city: "Nowhere", state: > "MN"}, > ... > // we can have an infinite # of ScuperColumns (aka address book > entries) > }, // end row > ieure: { // this is the key to another row in the Super CF > // all the address book entries for ieure > joey: {street: "A ave", zip: "55485", city: "Hell", state: "NV"}, > William: {street: "Armpit Dr", zip: "93301", city: "Bakersfield", > state: "CA"}, > }, > } > > The Pelop's code snippet seems to be adding an additional inner layer to > this to me, confused! > > --00163630ec9d0d1f07048a6e915c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable L1Tickets =3D { // column family
=A0=A0 =A0user= Id: { // row key
=A0=A0 =A0 =A0 =A042C120DF-D44A-44E4-9BDC-2B5439= A5C7B4: {=A0category: "videoPhone",=A0reportType: "POOR_PICT= URE", ...},
=A0=A0 =A0 =A0 =A099B60047-382A-4237-82CE-AE53A74FB747:=A0{=A0category= : "somethingElse",=A0reportType: "FOO", ...}
=A0=A0 =A0}
}

On 3 July 2010 02:2= 9, S Ahmed <sa= hmed1020@gmail.com> wrote:
https://ria101.wordpress= .com/2010/06/11/pelops-the-beautiful-cassandra-database-client-for-java=

So using the code snipped below, I want to create a json representation= of the CF (super).=A0


/**
=A0* Write multiple sub-column values to a super column...=A0* @param rowKey=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 The key of the row to modify
=A0* @param colFamily=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 The name of the super column family to opera= te on
=A0* @param colName=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 T= he name of the super column
=A0* @param subColumns=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 A list of the sub-columns to write
=A0*/
mut= ator. writeSubColumns(
=A0=A0=A0 userId,
=A0=A0=A0 "L1Tickets&qu= ot;,
=A0=A0=A0 UuidHelper.newTimeUuidBytes(), // using a UUID value that sorts b= y time
=A0=A0=A0 mutator.newColumnList(
=A0=A0=A0=A0=A0=A0=A0 mutator= .newColumn("category", "videoPhone"),
=A0=A0=A0=A0= =A0=A0=A0 mutator.newColumn("reportType", "POOR_PICTURE"= ;),
=A0=A0=A0=A0=A0=A0=A0 mutator.newColumn("createdDate", NumberHelp= er.toBytes(System.currentTimeMillis())),
=A0=A0=A0=A0=A0=A0=A0 mutator.n= ewColumn("capture", jpegBytes),
=A0=A0=A0=A0=A0=A0=A0 mutator.= newColumn("comment") ));
=A0=A0=A0 =A0=A0=A0
=A0=A0=A0 =A0=A0=A0
Can someone show me what it= would look like?

This is what I have so far....=A0=A0=A0 =A0=A0=A0 =

SupportTickets =3D {

=A0=A0=A0 userId : {
=A0=A0=A0
= =A0=A0=A0 =A0=A0=A0 L1Tickets : { }
=A0=A0=A0
=A0=A0=A0 }


}=A0=A0=A0 =A0=A0=A0


But from what I understood, a CF of ty= pe super looks like (http://arin.me/blog/wtf-is-a-supercol= umn-cassandra-data-model) :

AddressBook =3D { // this is a ColumnFamily of type Super
=A0=A0=A0 = phatduckk: {=A0=A0=A0 // this is the key to this row inside the Super CF=A0=A0=A0=A0=A0=A0=A0 // the key here is the name of the owner of the addr= ess book

=A0=A0=A0=A0=A0=A0=A0 // now we have an infinite # of super= columns in this row
=A0=A0=A0=A0=A0=A0=A0 // the keys inside the row are the names for the Supe= rColumns
=A0=A0=A0=A0=A0=A0=A0 // each of these SuperColumns is an addre= ss book entry
=A0=A0=A0=A0=A0=A0=A0 friend1: {street: "8th street&q= uot;, zip: "90210", city: "Beverley Hills", state: &quo= t;CA"},

=A0=A0=A0=A0=A0=A0=A0 // this is the address book entry for John in pha= tduckk's address book
=A0=A0=A0=A0=A0=A0=A0 John: {street: "How= ard street", zip: "94404", city: "FC", state: &quo= t;CA"},
=A0=A0=A0=A0=A0=A0=A0 Kim: {street: "X street", z= ip: "87876", city: "Balls", state: "VA"},
=A0=A0=A0=A0=A0=A0=A0 Tod: {street: "Jerry street", zip: "54= 556", city: "Cartoon", state: "CO"},
=A0=A0=A0= =A0=A0=A0=A0 Bob: {street: "Q Blvd", zip: "24252", city= : "Nowhere", state: "MN"},
=A0=A0=A0=A0=A0=A0=A0 ...
=A0=A0=A0=A0=A0=A0=A0 // we can have an infini= te # of ScuperColumns (aka address book entries)
=A0=A0=A0 }, // end row=
=A0=A0=A0 ieure: {=A0=A0=A0=A0 // this is the key to another row in the= Super CF
=A0=A0=A0=A0=A0=A0=A0 // all the address book entries for ieur= e
=A0=A0=A0=A0=A0=A0=A0 joey: {street: "A ave", zip: "55485&qu= ot;, city: "Hell", state: "NV"},
=A0=A0=A0=A0=A0=A0= =A0 William: {street: "Armpit Dr", zip: "93301", city: = "Bakersfield", state: "CA"},
=A0=A0=A0 },
}

The Pelop's code snippet seems to be adding an= additional inner layer to this to me, confused!


--00163630ec9d0d1f07048a6e915c--