cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Олександр Силка <sylkaa...@gmail.com>
Subject Re: Problem with UUID
Date Fri, 08 Apr 2011 22:32:04 GMT
Thanks that you try to help me,  but i still get error message
InvalidRequestException(why:TimeUUID should be 16 or 0 bytes (3))
This code UUID timeUUID = getTimeUUID(); doesn't solve my problem.

9 квітня 2011 р. 01:16 Ed Anuff <ed@anuff.com> написав:

> Oops, I should have been more clear.  You have this code:
>
> UUID timeUUID = getTimeUUID().randomUUID();
>
> what you need is this code:
>
> UUID timeUUID = getTimeUUID();
>
> What I meant by not understanding the error message was that I thought
> the TimeUUIDType gave a different error message than the one your're
> seeing when you put a random UUID into a time UUID CF.  Try the above
> fix and see if it makes the problem go away.
>
> Ed
>
> 2011/4/8 Patrick Julien <pjulien@gmail.com>:
> > I think this is what you're looking for
> >
> > http://wiki.apache.org/cassandra/FAQ#working_with_timeuuid_in_java
> >
> > 2011/4/8 Олександр Силка <sylkaalex@gmail.com>:
> >>
> >> 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
> >>> > by org.apache.cassandra.db.marshal.TimeUUIDType.
> >>> > When I try to save some data using hector i get next
> >>> > message InvalidRequestException(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.
> >>
> >>
> >
>

Mime
View raw message