Re: working with time uuid

2011-06-06 Thread Patrick Julien
thanks On Mon, Jun 6, 2011 at 11:52 AM, Paul Loy wrote: > private static int compareTimestampBytes(ByteBuffer o1, ByteBuffer o2) > { > int o1Pos = o1.position(); > int o2Pos = o2.position(); > > int d = (o1.get(o1Pos+6) & 0xF) - (o2.get(o2Pos+6) & 0xF); > i

Re: working with time uuid

2011-06-06 Thread Jonathan Ellis
... although it does break "ties" by comparing the other bytes. On Mon, Jun 6, 2011 at 10:52 AM, Paul Loy wrote: > private static int compareTimestampBytes(ByteBuffer o1, ByteBuffer o2) > { > int o1Pos = o1.position(); > int o2Pos = o2.position(); > > int d = (o1.g

Re: working with time uuid

2011-06-06 Thread Paul Loy
well, to clarify, it first checks the timestamp bytes, then the rest so it doesn;t say they're the same if they came from 2 different servers. On Mon, Jun 6, 2011 at 4:52 PM, Paul Loy wrote: > private static int compareTimestampBytes(ByteBuffer o1, ByteBuffer o2) > { > int o1Pos

Re: working with time uuid

2011-06-06 Thread Paul Loy
private static int compareTimestampBytes(ByteBuffer o1, ByteBuffer o2) { int o1Pos = o1.position(); int o2Pos = o2.position(); int d = (o1.get(o1Pos+6) & 0xF) - (o2.get(o2Pos+6) & 0xF); if (d != 0) return d; d = (o1.get(o1Pos+7) & 0xFF) - (o2.get(o2

working with time uuid

2011-06-06 Thread Patrick Julien
How does this work exactly? If you're using generation 1 time uuids for your keys to get ordering, doesn't this mean the keys need to be generated all on the same host when you either query or insert? Or does cassandra only inspect the bits that represent the time stamp of the UUID when performin