You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Ariel Weisberg (JIRA)" <ji...@apache.org> on 2015/11/30 22:01:11 UTC
[jira] [Comment Edited] (CASSANDRA-10768) Optimize the way we check
if a token is repaired in anticompaction
[ https://issues.apache.org/jira/browse/CASSANDRA-10768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15032428#comment-15032428 ]
Ariel Weisberg edited comment on CASSANDRA-10768 at 11/30/15 9:00 PM:
----------------------------------------------------------------------
Reviewed the code and the output of the existing tests and things seem to be passing. Looks like Range.normalize has a unit test and we have several dtests that test repair and anticompaction. I think the only tricky bit that would be nice to see covered explicitly are boundaries like minimum token, minimum token + 1, maximum token, maximum token - 1.
Moving the logic to normalize, compare, and iterate on the token ranges into a helper class in Range would be a nice to have instead of having it splatted into the body of the loop. Then you could also unit test it for the boundary conditions.
Otherwise +1.
was (Author: aweisberg):
Review the code and the output of the existing tests and things seem to be passing. Looks like Range.normalize has a unit test and we have several dtests that test repair that use anticompaction. I think the only tricky bit that would be nice to see covered explicitly are boundaries like minimum token, minimum token + 1, maximum token, maximum token - 1.
Moving the logic to normalize, compare, and iterate on the token ranges into a helper class in Range would be a nice to have instead of having it splatted into the body of the loop. Then you could also unit test it for the boundary conditions.
Otherwise +1.
> Optimize the way we check if a token is repaired in anticompaction
> ------------------------------------------------------------------
>
> Key: CASSANDRA-10768
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10768
> Project: Cassandra
> Issue Type: Bug
> Reporter: Marcus Eriksson
> Assignee: Marcus Eriksson
> Fix For: 2.1.x, 2.2.x, 3.0.x, 3.x
>
>
> When we anticompact we check each token if it is within a repaired range, this is very inefficient with many tokens as we do a linear search instead of sorting the ranges and doing a binary search (or even just keeping track of the next right-boundary and checking against that to avoid 2 comparisons)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)