Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DCE199B89 for ; Thu, 13 Sep 2012 07:55:38 +0000 (UTC) Received: (qmail 80822 invoked by uid 500); 13 Sep 2012 07:55:38 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 80574 invoked by uid 500); 13 Sep 2012 07:55:32 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 80527 invoked by uid 99); 13 Sep 2012 07:55:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Sep 2012 07:55:31 +0000 X-ASF-Spam-Status: No, hits=-1.6 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [64.18.1.35] (HELO exprod6og115.obsmtp.com) (64.18.1.35) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Sep 2012 07:55:21 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob115.postini.com ([64.18.5.12]) with SMTP ID DSNKUFGRVGdK2vIBU4wucTDcDPDGFAqHG41e@postini.com; Thu, 13 Sep 2012 00:55:01 PDT Received: from inner-relay-1.corp.adobe.com ([153.32.1.51]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q8D7qO5I001280 for ; Thu, 13 Sep 2012 00:52:24 -0700 (PDT) Received: from nacas01.corp.adobe.com (nacas01.corp.adobe.com [10.8.189.99]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q8D7sxLc023292 for ; Thu, 13 Sep 2012 00:54:59 -0700 (PDT) Received: from eurhub01.eur.adobe.com (10.128.4.30) by nacas01.corp.adobe.com (10.8.189.99) with Microsoft SMTP Server (TLS) id 8.3.264.0; Thu, 13 Sep 2012 00:54:59 -0700 Received: from susi.local (10.136.129.25) by eurhub01.eur.adobe.com (10.128.4.111) with Microsoft SMTP Server id 8.3.264.0; Thu, 13 Sep 2012 08:54:56 +0100 Message-ID: <50519152.5060000@apache.org> Date: Thu, 13 Sep 2012 08:54:58 +0100 From: =?ISO-8859-1?Q?Michael_D=FCrig?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Subject: Re: The infamous getSize() == -1 (Was: [jira] [Created] (OAK-300) Query: QueryResult.getRows().getSize()) References: <50504691.3010803@apache.org> <62702DA0-7905-458D-B69F-1A1C0130E6C5@adobe.com> In-Reply-To: <62702DA0-7905-458D-B69F-1A1C0130E6C5@adobe.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit On 12.9.12 19:06, Michael Marth wrote: >> As an alternative: we could use a separate method getSize(int max) which >> >> * if called with max == -1 returns the exact size if quickly available, >> * returns -1 otherwise, and >> * returns the exact size but not more then max when called with max >= 0. >> >> This allows for estimates but leaves the caller in control. > > +1 > > (and getSize() would still return -1 I guess?) For backward compatibility I'd leave the behaviour "as unchanged as possible". That is, return -1 if the size is not quickly available. Michael >