incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Washusen <...@reactive.org>
Subject Re: Pelops 'up and running' post question + WTF is a SuperColumn => really confused.
Date Fri, 02 Jul 2010 21:49:51 GMT
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 <sahmed1020@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).
>
>
> /**
>  * 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!
>
>

Mime
View raw message