Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 92286 invoked from network); 26 Apr 2010 00:44:34 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Apr 2010 00:44:34 -0000 Received: (qmail 35404 invoked by uid 500); 26 Apr 2010 00:44:33 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 35341 invoked by uid 500); 26 Apr 2010 00:44:33 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 35333 invoked by uid 99); 26 Apr 2010 00:44:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Apr 2010 00:44:33 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jbellis@gmail.com designates 74.125.82.172 as permitted sender) Received: from [74.125.82.172] (HELO mail-wy0-f172.google.com) (74.125.82.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Apr 2010 00:44:25 +0000 Received: by wyb35 with SMTP id 35so2471386wyb.31 for ; Sun, 25 Apr 2010 17:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=e/8h59zRqfbo2y25FWArYH92WjmVKjYL7i9rixzbb3s=; b=d2z0L/b1RNBwmf2oJpFEkQVnM/SP1FK2HlG2jBdXOYtoXtcAGuole8b1dKrnlhlLAb ApnbriuRG8534p/NY48UzSPVuriRIt9aq6gpDpZLgBSOdn6Vk99SoFTyEEOTlpBpWLxZ 8y1ruH8Afz5mSCrTf2im0y1qETdisLOGqsTuk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=xetynB3eIMw1Zv/2mLsiGYNN+g+dvq/kIkPhKVElJcKf586xFzeHXuMli1PT21TpUY B6A8m217V9OJ0fG8QZOFs5IEcg5r7I1X6yCPaht5Lkq1Tl/sAZJWOzgN0hmanBgdcgPg xlPsuVVoxzmJ8v1eY4EkmasbT/iHQmv7HI69s= Received: by 10.216.85.133 with SMTP id u5mr4496043wee.91.1272242645111; Sun, 25 Apr 2010 17:44:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.17.147 with HTTP; Sun, 25 Apr 2010 17:43:45 -0700 (PDT) In-Reply-To: References: From: Jonathan Ellis Date: Sun, 25 Apr 2010 19:43:45 -0500 Message-ID: Subject: Re: Question about TimeUUIDType To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Sun, Apr 25, 2010 at 5:40 PM, Tatu Saloranta 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