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 AD87E9B9C for ; Thu, 13 Sep 2012 07:59:39 +0000 (UTC) Received: (qmail 88458 invoked by uid 500); 13 Sep 2012 07:59:39 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 88429 invoked by uid 500); 13 Sep 2012 07:59:39 -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 88419 invoked by uid 99); 13 Sep 2012 07:59:39 -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:59:39 +0000 X-ASF-Spam-Status: No, hits=-1.3 required=5.0 tests=FRT_ADOBE2,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mueller@adobe.com designates 64.18.1.21 as permitted sender) Received: from [64.18.1.21] (HELO exprod6og108.obsmtp.com) (64.18.1.21) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Sep 2012 07:59:26 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob108.postini.com ([64.18.5.12]) with SMTP ID DSNKUFGSSIbKq6XZJcRxyb8qeSITF8SX5+Jx@postini.com; Thu, 13 Sep 2012 00:59:05 PDT Received: from inner-relay-4.eur.adobe.com (inner-relay-4.adobe.com [193.104.215.14]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q8D7uR5I001543 for ; Thu, 13 Sep 2012 00:56:28 -0700 (PDT) Received: from nacas02.corp.adobe.com (nacas02.corp.adobe.com [10.8.189.100]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id q8D7x2Sk012240 for ; Thu, 13 Sep 2012 00:59:02 -0700 (PDT) Received: from eurcas01.eur.adobe.com (10.128.4.27) by nacas02.corp.adobe.com (10.8.189.100) with Microsoft SMTP Server (TLS) id 8.3.264.0; Thu, 13 Sep 2012 00:59:01 -0700 Received: from eurmbx01.eur.adobe.com ([10.128.4.32]) by eurcas01.eur.adobe.com ([10.128.4.27]) with mapi; Thu, 13 Sep 2012 08:58:59 +0100 From: Thomas Mueller To: "oak-dev@jackrabbit.apache.org" Date: Thu, 13 Sep 2012 08:58:56 +0100 Subject: Re: The infamous getSize() == -1 (Was: [jira] [Created] (OAK-300) Query: QueryResult.getRows().getSize()) Thread-Topic: The infamous getSize() == -1 (Was: [jira] [Created] (OAK-300) Query: QueryResult.getRows().getSize()) Thread-Index: Ac2RhaG5w2u0xqJqRNqU710eY2jpfQ== Message-ID: In-Reply-To: <62702DA0-7905-458D-B69F-1A1C0130E6C5@adobe.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.3.120616 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Hi, The main question is still what the JCR API method getSize() should return. A new method getSize(int max) is nice, and of course we can do that. But I guess people will not use it in the near future because it's not part of the JCR API. Regards, Thomas On 9/12/12 8:06 PM, "Michael Marth" wrote: >> As an alternative: we could use a separate method getSize(int max) which >>=20 >> * if called with max =3D=3D -1 returns the exact size if quickly availab= le, >> * returns -1 otherwise, and >> * returns the exact size but not more then max when called with max >=3D >>0. >>=20 >> This allows for estimates but leaves the caller in control. > >+1 > >(and getSize() would still return -1 I guess?)