[
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