Hi Patricio,
Some thoughts inline.
2011/1/6 Patricio Echagüe
> Roshan, the first 64 bits does contain the version. The method
> UUID.timestamp() indeed takes it out before returning. You are right in that
> point. I based my comment on the UUID spec.
>
I know 64 bits have the version, but time
Roshan, the first 64 bits does contain the version. The method
UUID.timestamp() indeed takes it out before returning. You are right in that
point. I based my comment on the UUID spec.
What I am not convinced is that the framework should provide support to
create an almost identical UUID where only
Hi Patricio,
Thanks for your comment. Replying inline.
2011/1/5 Patricio Echagüe
> Roshan, just a comment in your solution. The time returned is not a simple
> long. It also contains some bits indicating the version.
I don't think so. The version bits from the most significant 64 bits of the
Roshan, just a comment in your solution. The time returned is not a simple
long. It also contains some bits indicating the version.
On the other hand, you are assuming that the same machine is processing your
request and recreating a UUID base on a long you provide. The
clockseqAndNode id will vary
It was our original intention on discussing this feature was to have
back-and-forth conversion from timestamps (we were modelling similar
functionality in Pycassa). It's lack of inclusion may have just been
an oversight. We will add this in Hector trunk shortly - thanks for
the complete code sample
Ok, found the solution - finally ! - by applying opposite of what
createTime() does in TimeUUIDUtils. Ideally I would have preferred for this
solution to come from Hector API, so I didn't have to be tied to the private
createTime() implementation.
==
If I use *com.eaio.uuid.UUID* directly, then I am able to do what I need
(attached a Java program for the same), but unfortunately I need to deal
with *java.util.UUID *in my application and I don't have its equivalent
com.eaio.uuid.UUID at the point where I need the timestamp value.
Any suggestion
Hi Victor / Patricio,
I have been using Hector library's TimeUUIDUtils. I also just looked at
TimeUUIDUtilsTest also but didn't find anything similar being tested there.
Here is what I am trying and it's not working - I am creating a Time UUID,
extracting its timestamp value and with that I creat
In Hector framework, take a look at TimeUUIDUtils.java
You can create a UUID using TimeUUIDUtils.getTimeUUID(long time); or
TimeUUIDUtils.getTimeUUID(ClockResolution clock)
and later on, TimeUUIDUtils.getTimeFromUUID(..) or just UUID.timestamp();
There are some example in TimeUUIDUtilsTest.jav
Hello Victor,
It is actually not that I need the 2 UUIDs to be exactly same - they need to
be same timestamp wise.
So, what I need is to extract the timestamp portion from a time UUID (say,
U1) and then later in the cycle, use the same long timestamp value to
re-create a UUID (say, U2) that is eq
Hi,
I am having a little difficulty converting a time UUID to its timestamp
equivalent and back. Can someone please help?
Here is what I am trying. Is it not the right way to do it?
===
UUID someUUID = TimeUUIDUtils.getUniqueTimeUUID
11 matches
Mail list logo