You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Ed Anuff (JIRA)" <ji...@apache.org> on 2011/02/24 06:28:38 UTC

[jira] Created: (CASSANDRA-2233) Add unified UUIDType

Add unified UUIDType
--------------------

                 Key: CASSANDRA-2233
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2233
             Project: Cassandra
          Issue Type: Improvement
          Components: Contrib
    Affects Versions: 0.7.3
            Reporter: Ed Anuff
            Priority: Minor


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

        

Re: [jira] Commented: (CASSANDRA-2233) Add unified UUIDType

Posted by Norman Maurer <no...@apache.org>.
2011/3/3, Ed Anuff (JIRA) <ji...@apache.org>:
>
>     [
> https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001826#comment-13001826
> ]
>
> Ed Anuff commented on CASSANDRA-2233:
> -------------------------------------
>
> 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
>>
>>
>> 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
>
>
>

[jira] Updated: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Anuff updated CASSANDRA-2233:
--------------------------------

    Attachment: UUIDType.java

Removed incorrect copyright notice

> 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
>
>
> 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

        

[jira] Commented: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000479#comment-13000479 ] 

Ed Anuff commented on CASSANDRA-2233:
-------------------------------------

This wasn't necessarily suggested as a replacement for the two existing comparators but as an alternative for:

(1) convenience

(2) being able to switch your UUID generation technique later and while the ordering might not be useful, it would still be predictable.  What happens now if you start with time-based UUIDs and switch to lexical?

(3) use foreign generated UUID's with a preference for time-based sorting if possible

> 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
>
>
> 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

        

[jira] Commented: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001480#comment-13001480 ] 

Ed Anuff commented on CASSANDRA-2233:
-------------------------------------

Yes, I would think so.

> 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
>
>
> 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

        

[jira] Updated: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Anuff updated CASSANDRA-2233:
--------------------------------

    Component/s:     (was: Contrib)
                 Core

> 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
>
>
> 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

        

[jira] Commented: (CASSANDRA-2233) Add unified UUIDType

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004775#comment-13004775 ] 

Jonathan Ellis commented on CASSANDRA-2233:
-------------------------------------------

so UUIDT will compare identically to existing TUUIDT, assuming version 1?

> 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

[jira] Updated: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Anuff updated CASSANDRA-2233:
--------------------------------

    Attachment: UUIDType.java

Revised to fix comparison between time-based and non-time-based UUIDs.  Time-based UUIDs now always compare as less than non-time-based UUIDs.

> 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
>
> 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

        

[jira] Updated: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Anuff updated CASSANDRA-2233:
--------------------------------

    Attachment:     (was: UUIDType.java)

> 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
>
>
> 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

[jira] Updated: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Anuff updated CASSANDRA-2233:
--------------------------------

    Attachment:     (was: UUIDType.java)

> 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
>
> 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

        

[jira] [Issue Comment Edited] (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017969#comment-13017969 ] 

Ed Anuff edited comment on CASSANDRA-2233 at 4/9/11 10:08 PM:
--------------------------------------------------------------

Hi Jonathan, thanks for testing it out.  It's following the convention of [http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html#compare%28T,%20T%29] to return a negative or positive value which is not necessarily -1 or +1.  I can normalize it to those values if we want to hold to a tighter standard.  What do you suggest?

Edit: Oops, just saw you added a sign() method to do that already. 

      was (Author: edanuff):
    Hi Jonathan, thanks for testing it out.  It's following the convention of [http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html#compare%28T,%20T%29] to return a negative or positive value which is not necessarily -1 or +1.  I can normalize it to those values if we want to hold to a tighter standard.  What do you suggest?
  
> 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: 2233.txt, 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

[jira] Commented: (CASSANDRA-2233) Add unified UUIDType

Posted by "Folke Behrens (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000353#comment-13000353 ] 

Folke Behrens commented on CASSANDRA-2233:
------------------------------------------

This won't work because it violates the natural order. Imagine two time-based UUIDs {{t0}} and {{t1}} such that {{t0 < t1}}. There is a non-time-based UUID {{x}} such that {{x < t0}} and {{x > t1}}. To remedy this you must not compare both types, you have to sort all time-based UUID either before or after all other UUIDs.

> 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
>
>
> 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

        

[jira] [Updated] (CASSANDRA-2233) Add unified UUIDType

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-2233:
--------------------------------------

    Attachment:     (was: 2233.txt)

> 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: 2233.txt, 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

[jira] Commented: (CASSANDRA-2233) Add unified UUIDType

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000470#comment-13000470 ] 

Jonathan Ellis commented on CASSANDRA-2233:
-------------------------------------------

I guess the idea is to drop both TimeUUIDType and Lexical for this?

Part of me thinks that it's good to keep Time around so people who say they want chronological sorting gets that validated.  And if you keep time around there's not much point in replacing Lexical UUID w/ this.

Open to being convinced otherwise!

> 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
>
>
> 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

        

[jira] Updated: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Anuff updated CASSANDRA-2233:
--------------------------------

    Attachment: UUIDTypeTest.java

> 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

[jira] Commented: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004773#comment-13004773 ] 

Ed Anuff commented on CASSANDRA-2233:
-------------------------------------

Attached new version and test case.  It now sorts first by version number, then by time if both are version 1, and then lexically using msb to lsb byte comparison.  Turns out this is actually the same way the org.safehaus.uuid.UUID.compareTo() method works, so there's precedent.

FWIW, the current LexicalUUIDType is using java.util.UUID.compareTo() which, looking at the JDK source and doing some tests, appears not to be a lexical comparison as described in ref4122 since it's doing a signed comparison.

> 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

[jira] [Updated] (CASSANDRA-2233) Add unified UUIDType

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-2233:
--------------------------------------

    Attachment: 2233.txt

rebased and changed testCompare to only care about version 1 results, and validate against TimeUUIDType, but I'm getting a failure:

{noformat}
    [junit] Testcase: testCompare(org.apache.cassandra.db.marshal.UUIDTypeTest):	FAILED
    [junit] expected:<-1> but was:<-23>
    [junit] junit.framework.AssertionFailedError: expected:<-1> but was:<-23>
    [junit] 	at org.apache.cassandra.db.marshal.UUIDTypeTest.testCompare(UUIDTypeTest.java:155)
    [junit] 	at org.apache.cassandra.db.marshal.UUIDTypeTest.testCompare(UUIDTypeTest.java:30)

{noformat}


> 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: 2233.txt, 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

[jira] Updated: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Anuff updated CASSANDRA-2233:
--------------------------------

    Attachment:     (was: UUIDType.java)

> 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
>
> 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

        

[jira] Issue Comment Edited: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
    [ 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

[jira] Updated: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Anuff updated CASSANDRA-2233:
--------------------------------

    Attachment: UUIDType.java

> 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
>
>
> 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

[jira] [Commented] (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017969#comment-13017969 ] 

Ed Anuff commented on CASSANDRA-2233:
-------------------------------------

Hi Jonathan, thanks for testing it out.  It's following the convention of [http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html#compare%28T,%20T%29] to return a negative or positive value which is not necessarily -1 or +1.  I can normalize it to those values if we want to hold to a tighter standard.  What do you suggest?

> 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: 2233.txt, 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

[jira] [Updated] (CASSANDRA-2233) Add unified UUIDType

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-2233:
--------------------------------------

    Attachment: 2233.txt

updated testCompare to use sign() (your method, not mine :)

getting non-magnitude related disagreement now:

{noformat}
    [junit] Testcase: testCompare(org.apache.cassandra.db.marshal.UUIDTypeTest):	FAILED
    [junit] expected:<-1> but was:<1>
    [junit] junit.framework.AssertionFailedError: expected:<-1> but was:<1>
    [junit] 	at org.apache.cassandra.db.marshal.UUIDTypeTest.testCompare(UUIDTypeTest.java:154)
    [junit] 	at org.apache.cassandra.db.marshal.UUIDTypeTest.testCompare(UUIDTypeTest.java:49)
    [junit] 	at org.apache.cassandra.db.marshal.UUIDTypeTest.testCompare(UUIDTypeTest.java:154)
{noformat}

> 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: 2233.txt, 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

[jira] Commented: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001826#comment-13001826 ] 

Ed Anuff commented on CASSANDRA-2233:
-------------------------------------

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
>
>
> 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

        

[jira] Commented: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000377#comment-13000377 ] 

Ed Anuff commented on CASSANDRA-2233:
-------------------------------------

You are correct, I'll fix that.

> 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
>
>
> 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

        

[jira] Commented: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004780#comment-13004780 ] 

Ed Anuff commented on CASSANDRA-2233:
-------------------------------------

Yes, that is correct.

> 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

[jira] Issue Comment Edited: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004773#comment-13004773 ] 

Ed Anuff edited comment on CASSANDRA-2233 at 3/9/11 8:17 PM:
-------------------------------------------------------------

Attached new version and test case.  It now sorts first by version number, then by time if both are version 1, and then lexically using msb to lsb byte comparison.  Turns out this is actually the same way the org.safehaus.uuid.UUID.compareTo() method works, so there's precedent.

FWIW, the current LexicalUUIDType is using java.util.UUID.compareTo() which, looking at the JDK source and doing some tests, appears not to be a lexical comparison as described in rfc4122 since it's doing a signed comparison.

      was (Author: edanuff):
    Attached new version and test case.  It now sorts first by version number, then by time if both are version 1, and then lexically using msb to lsb byte comparison.  Turns out this is actually the same way the org.safehaus.uuid.UUID.compareTo() method works, so there's precedent.

FWIW, the current LexicalUUIDType is using java.util.UUID.compareTo() which, looking at the JDK source and doing some tests, appears not to be a lexical comparison as described in ref4122 since it's doing a signed comparison.
  
> 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

[jira] Updated: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ed Anuff updated CASSANDRA-2233:
--------------------------------

    Attachment: UUIDType.java

> Add unified UUIDType
> --------------------
>
>                 Key: CASSANDRA-2233
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2233
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Contrib
>    Affects Versions: 0.7.3
>            Reporter: Ed Anuff
>            Priority: Minor
>         Attachments: UUIDType.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

        

[jira] Issue Comment Edited: (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001480#comment-13001480 ] 

Ed Anuff edited comment on CASSANDRA-2233 at 3/2/11 4:49 PM:
-------------------------------------------------------------

Yes, I would think so.

Caveat: deprecate == not recommend for new usage, existing column families using the LexicalUUID have to stay with it, for the reason Frank points out.

      was (Author: edanuff):
    Yes, I would think so.
  
> 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
>
>
> 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

        

[jira] Commented: (CASSANDRA-2233) Add unified UUIDType

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001998#comment-13001998 ] 

Jonathan Ellis commented on CASSANDRA-2233:
-------------------------------------------

bq. I'm not sure how useful the natural order of the other UUID versions is

Agreed.

bq. don't access ByteBuffer.array() directly without asking if ByteBuffer.hasArray() first

Yes, we have a bunch of methods in ByteBufferUtil that will use array if it exists otherwise will either duplicate and use relative methods or use byte-at-a-time get.

bq. write a unit test.

+1, mostly it will just need to adapt what we have in TimeUUIDTypeTeset

> 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
>
>
> 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

        

[jira] Commented: (CASSANDRA-2233) Add unified UUIDType

Posted by "Folke Behrens (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001781#comment-13001781 ] 

Folke Behrens commented on CASSANDRA-2233:
------------------------------------------

A few more suggestions:
- generalize the type, make it deal with all kinds of variants/versions. (http://tools.ietf.org/html/rfc4122)
- check if it makes sense to treat the Nil UUID differently (similarly to NULL in popular SQL databases).
- don't access ByteBuffer.array() directly without asking if ByteBuffer.hasArray() first.
- write a unit test.
- format the code: http://wiki.apache.org/cassandra/CodeStyle
- check with the devs if they would prefer a patch.


> 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
>
>
> 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

        

[jira] [Commented] (CASSANDRA-2233) Add unified UUIDType

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018014#comment-13018014 ] 

Hudson commented on CASSANDRA-2233:
-----------------------------------

Integrated in Cassandra #841 (See [https://hudson.apache.org/hudson/job/Cassandra/841/])
    

> 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
>            Assignee: Ed Anuff
>            Priority: Minor
>             Fix For: 0.8
>
>         Attachments: 2233.txt, 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

[jira] [Issue Comment Edited] (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017976#comment-13017976 ] 

Ed Anuff edited comment on CASSANDRA-2233 at 4/9/11 10:48 PM:
--------------------------------------------------------------

That test is comparing a time-based and non-timed based UUID, I believe.  My version of this was using:

assertEquals(c, sign(compareUsingJUG(u1, u2)));

Looks like you changed it to:

+        if (u1.version() == 1)
+            assertEquals(c, TimeUUIDType.instance.compare(bytebuffer(u1), bytebuffer(u2)));

It needs to be this if you're testing compatibility with TimeUUIDType:

+        if ((u1.version() == 1) && (u2.version() == 1))
+            assertEquals(c, TimeUUIDType.instance.compare(bytebuffer(u1), bytebuffer(u2)));

FWIW, I saw you pulled the compareUsingJUG() test.  The thinking there was to have additional coverage by testing with another comparison implementation.  If we want to remove a dependency on JUG, that's fine, and, of course, there's nothing canonical about JUG, except Cassandra is already using it and it has a well thought out and documented comparison function that's compatible with this one.

      was (Author: edanuff):
    That test is comparing a time-based and non-timed based UUID, I believe.  My version of this was using:

assertEquals(c, sign(compareUsingJUG(u1, u2)));

Looks like you changed it to:

+        if (u1.version() == 1)
+            assertEquals(c, TimeUUIDType.instance.compare(bytebuffer(u1), bytebuffer(u2)));

It needs to be this if you're testing compatibility with TimeUUIDType:

+        if ((u1.version() == 1) && (u2.version() == 1))
+            assertEquals(c, TimeUUIDType.instance.compare(bytebuffer(u1), bytebuffer(u2)));

  
> 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
>            Assignee: Ed Anuff
>            Priority: Minor
>             Fix For: 0.8
>
>         Attachments: 2233.txt, 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

[jira] Commented: (CASSANDRA-2233) Add unified UUIDType

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001473#comment-13001473 ] 

Jonathan Ellis commented on CASSANDRA-2233:
-------------------------------------------

That makes sense.  So if we commit this it would make sense to deprecate LexicalUUID right?

> 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
>
>
> 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

        

[jira] [Commented] (CASSANDRA-2233) Add unified UUIDType

Posted by "Ed Anuff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017976#comment-13017976 ] 

Ed Anuff commented on CASSANDRA-2233:
-------------------------------------

That test is comparing a time-based and non-timed based UUID, I believe.  My version of this was using:

assertEquals(c, sign(compareUsingJUG(u1, u2)));

Looks like you changed it to:

+        if (u1.version() == 1)
+            assertEquals(c, TimeUUIDType.instance.compare(bytebuffer(u1), bytebuffer(u2)));

It needs to be this if you're testing compatibility with TimeUUIDType:

+        if ((u1.version() == 1) && (u2.version() == 1))
+            assertEquals(c, TimeUUIDType.instance.compare(bytebuffer(u1), bytebuffer(u2)));


> 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: 2233.txt, 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