text: As I understand it, the string value of TimeUUIDType does not sort
  alphanumerically in chronological order. Isn't that right?
  I want to use these ids in Oracle as well as Cassandra, and I want them to
  sort in chronological order. In Oracle they will have to be varchars (I
  think).
  Even in Cassandra alone, what is the advantage of TimeUUIDType over
  UTF8Type, if done this way? Is TimeUUIDType faster than UTF8Type? As far as
  I can tell, the class I give below looks much easier and faster than the one
  recommended here: - which
  looks really cumbersome, in addition to the fact that it uses a 3rd party
  library and presumably machine dependent code!
  On Tue, Jun 22, 2010 at 5:18 PM, Jonathan Ellis <jbellis@gmail.com> wrote:
  > Why not just use version 1 UUIDs and TimeUUIDType?
  >
  > On Tue, Jun 22, 2010 at 8:58 AM, David Boxenhorn <david@lookin2.com>
  > wrote:
  > > I want to use UUIDs whose alphanumeric order is the same as their
  > > chronological order. So I'm generating Version 4 UUIDs (
  > >
  >
  > > ) as follows:
  > >
  > > public class Id
  > > {
  > > static Random random = new Random();
  > >
  > > public static String next()
  > > {
  > > // Format: xxxxxxxx-xxxx-4xxx-8xxx-xxxxxxxxxxxx
  > >
  > > long high = (System.currentTimeMillis() << 16) | 0x4000 |
  > > random.nextInt(4096);
  > > long low = (random.nextLong() >>> 4) | 0x8000000000000000L;
  > >
  > > UUID uuid = new UUID(high, low);
  > >
  > > return uuid.toString();
  > > }
  > > }
  > >
  > > Is there anything wrong with this idea?
  > >
  >
  >
  >
  > --
  > Jonathan Ellis
  > Project Chair, Apache Cassandra
  > co-founder of Riptano, the source for professional Cassandra support
  >
  >