cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandeep <>
Subject RE: Help with UUID in
Date Tue, 18 May 2010 20:02:49 GMT
Hi Roger,

Thanks for your reply.

Actually I copied the class(GUIDGenerator.) in my project.

Guid guidTimeStamp = GuidGenerator.GenerateTimeBasedGuid();

And using the above statement to generate the UUID. But I have no idea how to insert the UUID
into Cassandra.

List<Column> listOfArrivalTimes = new List<Column>();
listOfArrivalTimes.Add(new Column() { Name = utf8Encoding.GetBytes("ArrivalTime"), Timestamp
= DateTime.Now.Ticks, Value = utf8Encoding.GetBytes(commandQueueEntry.ArrivalTime.ToString())

Mutation ArrivalTime = new Mutation()
 Column_or_supercolumn = new ColumnOrSuperColumn() { Super_column = new SuperColumn() { Name
= utf8Encoding.GetBytes("ArrivalTime"), Columns = listOfArrivalTimes } }

And then using batch_mutate() to insert the values.  I have no clue where and how should I
use the generated UUID.

I can not use it in " Timestamp" in column struct  because it is of type long.  Please help
me with this.


From: Roger Schildmeijer []
Sent: Tuesday, May 18, 2010 3:53 PM
Subject: Re: Help with UUID in

Nick Berardi's blog post about Cassandra in conjunction with c#/.net and TimeUUID describes
how to do.

// Roger Schildmeijer

On 18 maj 2010, at 21.45em, Sandeep wrote:

Hi all,

I am new to Cassandra. I am trying to insert some values to the columnfamily. The definition
of columnfamily in the config file is as follows.

<ColumnFamily Name="CommandQueue"

When ever I try to insert values to I always get   "InvalidRequestException(why: UUIDs must
be exactly 16 bytes)".

I am using batch_mutate() to insert column.

How can I insert values to the column family.


View raw message