[ 
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

Reply via email to