[
https://issues.apache.org/jira/browse/CASSANDRA-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737589#action_12737589
]
Stu Hood commented on CASSANDRA-242:
------------------------------------
After posting 1), I thought about it some more and realized it would be a
relatively smooth change: I'm leaning toward that approach.
Rather than an interface, we could make StringToken an abstract class with two
concrete classes: a "CollatedStringToken", holding only a byte[] representing
the CollationKey of its String and a RawStringToken, which holds a String and
is equivalent to the current StringToken. The StringTokens would be compared
via an abstract getCollatedBytes() method.
Names subject to change, etc.
> 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
>
> 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.