Another option is PlayOrm UniqueKeyGenerator.generateKey(). While it is not
returning a UUID, it does return a unique key for a specific cluster that is
nice and short too.
Dean
From: Baskar Sikkayan techba...@gmail.commailto:techba...@gmail.com
Reply-To: user@cassandra.apache.orgmailto:user@cassandra.apache.org
user@cassandra.apache.orgmailto:user@cassandra.apache.org
Date: Thursday, January 3, 2013 3:00 AM
To: user@cassandra.apache.orgmailto:user@cassandra.apache.org
user@cassandra.apache.orgmailto:user@cassandra.apache.org
Subject: UUID - Java
Hi,
I use the following code to generate the primary key.
public static java.util.UUID getTimeUUID() {
return java.util.UUID.fromString(new com.eaio.uuid.UUID().toString());
}
Is this the correct approach?
Do let me know if there i any better approach which guarantees no conflicts.
Thanks,
Baskar.S