Then how i can generate correct time UUID key in java ?

8 צ 2011 . 22:58 Ed Anuff <ed@anuff.com> :
Hmm, if you're really doing this, you're not getting a time uuid:

UUID timeUUID = getTimeUUID().randomUUID();

That call to randomUUID() is invoking the static randomUUID() method
in java.util.UUID which is generating a non-time random uuid. I'm not
sure why you're getting that error message though.

Ed

2011/4/8 <sylkaalex@gmail.com>:
> Hi everyone,
> I have column family called site sorted
> byorg.apache.cassandra.db.marshal.TimeUUIDType.
> When I try to save some data using hector i get next
> messageInvalidRequestException(why:TimeUUID should be 16 or 0 bytes (3)).
> My Cassandra version 0.7.0
>
> This is snippets of my code:
> public static java.util.UUID getTimeUUID() {
> return java.util.UUID.fromString(new com.eaio.uuid.UUID().toString());
> }
> UUID timeUUID = getTimeUUID().randomUUID();
> List<HColumn<String, String>> columns = DaoHelper.getStringCols(site);
> Mutator<UUID> mutator = HFactory.createMutator(keyspace,
> UUIDSerializer.get());
> for (HColumn<?, ?> column : columns) {
> mutator.addInsertion(timeUUID, columnFamilyName, column);
> }
> I am new in Cassandra and i really want to understand how it works.So please
> help me.