[
https://issues.apache.org/jira/browse/CASSANDRA-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737723#action_12737723
]
Stu Hood commented on CASSANDRA-242:
------------------------------------
> But this means the only comparator you can use is the byte-order one.
The byte[] returned by getCollatedBytes are equivalent to those returned by
Collator.getCollationKey(string).toByteArray, which makes comparing that byte[]
to another byte[] generated by the same method the same as calling
Collator.compare(string1, string2).
> You can't do Range comparisons with byte order, and then sort keys with the
> "real" comparator.
The byte[] comparison is the new "real" comparator, because it provides the
same functionality that the older one did.
> That is why IMO the split code should just be left up to the Partitioner.
The split code hasn't been implemented yet, but it will definitely be added to
the partitioner: a way to compare a byte[] with no (real) string representation
to a String is one of the prerequisites (unless this looks too ugly, and 3)
looks better).
> Implement method to "evenly" split a Range
> ------------------------------------------
>
> Key: CASSANDRA-242
> URL: https://issues.apache.org/jira/browse/CASSANDRA-242
> Project: Cassandra
> Issue Type: New Feature
> Components: Core
> Reporter: Stu Hood
> Assignee: Stu Hood
> Attachments: CASSANDRA-242.diff
>
>
> Two tickets currently depend on being able to deterministically split a Range
> object into two "even" Ranges.
> This can be accomplished with RandomPartitioner/BigIntegerToken by taking the
> average of the tokens, but the OrderPreservingPartitioner/StringToken
> implementation uses a Java Collator to define the sort order of Tokens, which
> means that they are not necessarily sorted in byte/char order.
> Collator.getCollationKey(String).toByteArray() gets you a sortable byte
> array, but there is no publicly accessible API for converting a similar byte
> array back into a String.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.