[ 
https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001826#comment-13001826
 ] 

Ed Anuff edited comment on CASSANDRA-2233 at 3/18/11 9:46 PM:
--------------------------------------------------------------

bq.* generalize the type, make it deal with all kinds of variants/versions. 
(http://tools.ietf.org/html/rfc4122)

-I'm not sure how useful the natural order of the other UUID versions is.-  
Minor point of correction, as per [Java bug 
7025832|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7025832], the 
LexicalUUIDType inherits java.util.UUID.compareTo()'s signed comparison flaw, 
since the LexicalUUIDType doesn't do byte comparison, it's converting the bytes 
into java.util.UUIDs and using the UUID class' compareTo() method.  Doing a 
byte comparison would match the rfc, which is reflected in the most recent 
version of patch proposed.

bq.* check if it makes sense to treat the Nil UUID differently (similarly to 
NULL in popular SQL databases).

Yes, it does make sense.  Nil UUID should always compare as less than.


      was (Author: edanuff):
    bq.* generalize the type, make it deal with all kinds of variants/versions. 
(http://tools.ietf.org/html/rfc4122)

I'm not sure how useful the natural order of the other UUID versions is.  I 
suppose for everything but version 1 time-based UUID's, we could use DCE's 
comparison rules rather than the current byte comparison used by the lexical 
comparer, that would at least be standard.  
http://www.opengroup.org/onlinepubs/9629399/apdxa.htm#tagtcjh_38

bq.* check if it makes sense to treat the Nil UUID differently (similarly to 
NULL in popular SQL databases).

Yes, it does make sense.  Nil UUID should always compare as less than.

  
> Add unified UUIDType
> --------------------
>
>                 Key: CASSANDRA-2233
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2233
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 0.7.3
>            Reporter: Ed Anuff
>            Priority: Minor
>         Attachments: UUIDType.java, UUIDTypeTest.java
>
>
> Unified UUIDType comparator, compares as time-based if both UUIDs are 
> time-based, otherwise uses byte comparison.  Based on code from the current 
> LexicalUUIDType and TimeUUIDType comparers, so performance and behavior 
> should be consistent and compatible.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to