Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8FB521871E for ; Mon, 30 Nov 2015 21:01:11 +0000 (UTC) Received: (qmail 44529 invoked by uid 500); 30 Nov 2015 21:01:11 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 44480 invoked by uid 500); 30 Nov 2015 21:01:11 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 44437 invoked by uid 99); 30 Nov 2015 21:01:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Nov 2015 21:01:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 0F00C2C1F61 for ; Mon, 30 Nov 2015 21:01:11 +0000 (UTC) Date: Mon, 30 Nov 2015 21:01:11 +0000 (UTC) From: "Ariel Weisberg (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CASSANDRA-10768) Optimize the way we check if a token is repaired in anticompaction MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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)