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 A75F872D7 for ; Tue, 6 Sep 2011 22:15:32 +0000 (UTC) Received: (qmail 91406 invoked by uid 500); 6 Sep 2011 22:15:32 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 91331 invoked by uid 500); 6 Sep 2011 22:15:31 -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 91314 invoked by uid 99); 6 Sep 2011 22:15:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Sep 2011 22:15:31 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Sep 2011 22:15:30 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 2874384B19 for ; Tue, 6 Sep 2011 22:15:10 +0000 (UTC) Date: Tue, 6 Sep 2011 22:15:10 +0000 (UTC) From: "paul cannon (JIRA)" To: commits@cassandra.apache.org Message-ID: <93661594.22573.1315347310162.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <410901621.22531.1315346592840.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (CASSANDRA-3145) IntervalTree could miscalculate its max 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-3145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] paul cannon updated CASSANDRA-3145: ----------------------------------- Attachment: 3145.patch.txt fixes IntervalTree.max calculation. also eliminates a small amount of overhead for the use of a ConcurrentSkipListSet, since there isn't a need for the efficient contains/remove operations or the concurrency support. > IntervalTree could miscalculate its max > --------------------------------------- > > Key: CASSANDRA-3145 > URL: https://issues.apache.org/jira/browse/CASSANDRA-3145 > Project: Cassandra > Issue Type: Bug > Components: Core > Reporter: paul cannon > Assignee: paul cannon > Priority: Minor > Fix For: 1.0 > > Attachments: 3145.patch.txt > > > The implementation of IntervalTree in trunk expects an ordered list of Interval objects as the argument to its constructor. It uses the ordering (only) to determine its minimum and maximum endpoints out of all Intervals stored in it. However, no ordering should be able to guarantee the first element has the set-wide minimum and that the last element has the set-wide maximum; you have to order by minima or maxima or some combination. > I propose that the requirement for ordered input to the IntervalTree constructor be dropped, seeing as how the elements will be sorted as necessary inside the IntervalNode object anyway. The set-wide minimum and maximum could be more straightforwardly calculated inside IntervalNode, and just exposed via IntervalTree. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira