cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandeep <Sand...@indatus.com>
Subject RE: Help with UUID in C#.net
Date Tue, 18 May 2010 20:25:50 GMT
Batch Mutate can only take map<string, map<string, list<Mutation>>> as parameter
but not a GUID.

How to solve this problem.

From: Sandeep [mailto:Sandeep@indatus.com]
Sent: Tuesday, May 18, 2010 4:03 PM
To: user@cassandra.apache.org
Subject: RE: Help with UUID in C#.net

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.

Thanks,
Sandeep.

From: Roger Schildmeijer [mailto:schildmeijer@gmail.com]
Sent: Tuesday, May 18, 2010 3:53 PM
To: user@cassandra.apache.org
Subject: Re: Help with UUID in C#.net

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

http://www.coderjournal.com/2010/04/creating-a-time-uuid-guid-in-net/

// 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"
                    ColumnType="Super"
                    CompareWith="TimeUUIDType"
                    CompareSubcolumnsWith="UTF8Type"/>


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.

Thanks,
Sandeep.


Mime
View raw message