On Sun, Apr 25, 2010 at 5:40 PM, Tatu Saloranta <tsalora...@gmail.com> wrote: >> Now with TimeUUIDType, if two UUID have the same timestamps, they are ordered >> by bytes order. > > Naively for the whole UUID? That would not be good, given that > timestamp within UUID is not stored in expected lexical order, but > with sort of little-endian mess (first bytes are least-significant > bytes of timestamp).
I think the code here is clearer than explaining in English. :) comparing timeuuids o1 and o2: long t1 = LexicalUUIDType.getUUID(o1).timestamp(); long t2 = LexicalUUIDType.getUUID(o2).timestamp(); return t1 < t2 ? -1 : (t1 > t2 ? 1 : FBUtilities.compareByteArrays(o1, o2)); -Jonathan