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 F0ECF41D2 for ; Sun, 12 Jun 2011 06:52:14 +0000 (UTC) Received: (qmail 68028 invoked by uid 500); 12 Jun 2011 06:52:14 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 68007 invoked by uid 500); 12 Jun 2011 06:52:14 -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 67999 invoked by uid 99); 12 Jun 2011 06:52:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Jun 2011 06:52:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_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; Sun, 12 Jun 2011 06:52:12 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 9FE3941467F for ; Sun, 12 Jun 2011 06:51:51 +0000 (UTC) Date: Sun, 12 Jun 2011 06:51:51 +0000 (UTC) From: "Stu Hood (JIRA)" To: commits@cassandra.apache.org Message-ID: <2079700539.528.1307861511651.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <18812680.234851296119023726.JavaMail.jira@thor> Subject: [jira] [Updated] (CASSANDRA-2062) Better control of iterator consumption MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CASSANDRA-2062?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stu Hood updated CASSANDRA-2062: -------------------------------- Attachment: 0002-CASSANDRA-2062-0002-Port-all-collating-consumers-to-Me.txt 0001-CASSANDRA-2062-0001-Improved-iterator-for-merging-sort.txt Rebased. > Better control of iterator consumption > -------------------------------------- > > Key: CASSANDRA-2062 > URL: https://issues.apache.org/jira/browse/CASSANDRA-2062 > Project: Cassandra > Issue Type: Improvement > Components: Core > Reporter: Stu Hood > Priority: Minor > Fix For: 1.0 > > Attachments: 0001-CASSANDRA-2062-0001-Improved-iterator-for-merging-sort.txt, 0002-CASSANDRA-2062-0002-Port-all-collating-consumers-to-Me.txt > > > The core reason for this ticket is to gain control over the consumption of the lazy nested iterators in the read path. > {quote}We survive now because we write the size of the row at the front of the row (via some serious acrobatics at write time), which gives us hasNext() for rows for free. But it became apparent while working on the block-based format that hasNext() will not be cheap unless the current item has been consumed. "Consumption" of the row is easy, and blocks will be framed so that they can be very easily skipped, but you don't want to have to seek to the end of the row to answer hasNext, and then seek back to the beginning to consume the row, which is what CollatingIterator would have forced us to do.{quote} > While we're at it, we can also improve efficiency: for {{M}} iterators containing {{N}} total items, commons.collections.CollatingIterator performs a {{O(M*N)}} merge, and calls hasNext multiple times per returned value. We can do better. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira