jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mdue...@apache.org>
Subject Re: The infamous getSize() == -1 (Was: [jira] [Created] (OAK-300) Query: QueryResult.getRows().getSize())
Date Thu, 13 Sep 2012 07:54:58 GMT


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

>

Mime
View raw message