I try to use method getUniqueTimeUUIDinMillis from https://github.com/rantav/hector/blob/master/core/src/main/java/me/prettyprint/cassandra/utils/TimeUUIDUtils.java
but i still get same result "InvalidRequestException(why:TimeUUID should be 16 or 0 bytes (3))";

9 צ 2011 . 01:32 <sylkaalex@gmail.com> :
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
>>> > 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.
>>
>>
>