You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Torgeir Veimo (JIRA)" <ji...@apache.org> on 2015/02/09 15:21:34 UTC

[jira] [Commented] (OAK-1930) New method RangeIterator.getSize(int max)

    [ https://issues.apache.org/jira/browse/OAK-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14312267#comment-14312267 ] 

Torgeir Veimo commented on OAK-1930:
------------------------------------

Having a method where oak internally can optimally getting the size would probably be faster than doing a lot of object instantiation, just to count then and then discard them.

> New method RangeIterator.getSize(int max)
> -----------------------------------------
>
>                 Key: OAK-1930
>                 URL: https://issues.apache.org/jira/browse/OAK-1930
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: core, jcr, query
>    Affects Versions: 1.0
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 1.2
>
>
> The method RangeIterator.getSize() is part of the JCR API, and returns the number of items, but can also return -1 if not known.
> Currently, Oak doesn't return -1, but counts the items. This is slow (potentially very slow) if there are many items, for example, in a query result.
> I propose to add a new method RangeIterator.getSize(long max) that limits counting the entries. That way, an application can use a reasonable limit, and Oak doesn't need to count.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)