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 create another Time UUID and I am expecting both time UUIDs to have the same timestamp() value - am I doing / expecting something wrong here?:
=======================================================
import java.util.UUID;
import me.prettyprint.cassandra.utils.TimeUUIDUtils;
public class TryHector {
public static void main(String[] args) throws Exception {
UUID someUUID = TimeUUIDUtils.getUniqueTimeUUIDinMillis();
long timestamp1 = someUUID.timestamp();
UUID otherUUID = TimeUUIDUtils.getTimeUUID(timestamp1);
long timestamp2 = otherUUID.timestamp();
System.out.println(timestamp1);
System.out.println(timestamp2);
}
}
=======================================================
I have to create the timestamp() equivalent of my time UUIDs so I can send it to my UI client, for which it will be simpler to compare "long" timestamp than comparing UUIDs. Then for the "long" timestamp chosen by the client, I need to re-create the equivalent time UUID and go and filter the data from Cassandra database.