[
https://issues.apache.org/jira/browse/CASSANDRA-3749?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sylvain Lebresne updated CASSANDRA-3749:
----------------------------------------
Attachment: 3749.patch
Patch attached (includes a unit test). Mainly, the patch introduces two new
AbstractBounds classes to represent (k1, k2) an [k1, k2). The patch is however
longer than that due to a few technicalities:
* There was a bug in Token.KeyBound comparisons. For a given token, I had made
it's min and max being singleton instances. And thus during comparison, for
token t1 and t2, if t1.equals(t2), the code was assuming that reference
equality was enough to distinguish between the min and max bound. This doesn't
work however since there could be more than one Token instance for a given
token. The patch fixes that. I'm not sure it was actually possible to get a
real bug because of that, but any case, the code was buggy nonetheless.
* To make writting the two new AbstractBound classes easier, I moved the
AB.normalize method to Range (since that's the only case we uses it). I also
changed a little bit the AB.split method because it wasn't clearly obvious to
me how to adapt the current implementation to the new classes.
Note that in the long run it could be cleaner to merge our (now) 4 instances of
AB into one class that would have left, right, leftIsInclusive,
rightIsInclusive, but that felt like too much work for now.
> Allow rangeSlice queries to be start/end inclusive/exclusive
> -------------------------------------------------------------
>
> Key: CASSANDRA-3749
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3749
> Project: Cassandra
> Issue Type: Sub-task
> Components: Core
> Reporter: Sylvain Lebresne
> Assignee: Sylvain Lebresne
> Fix For: 1.1
>
> Attachments: 3749.patch
>
>
> Currently, given two keys k1 and k2, we can only do a rangeSlice on the
> intervals (k1, k2] (Range) and [k1, k2] (Bounds). CQL goes around this
> "manually", by querying one more row if the start is exclusive and removing
> the start/end post-query if necessary. This doesn't work however with the new
> option introduced by CASSANDRA-3742. So this ticket proposes to add support
> (internally) for doing a rangeSlice for the intervals (k1, k2) an [k1, k2).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira