You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Bertrand De Coatpont <le...@adobe.com> on 2014/07/31 09:12:33 UTC

OAK and large list of orderable child nodes

Hello,

In the JCR world, is there a specific API to obtain (for reading) a
specific range of child nodes within a large list of orderable child nodes
(e.g. Nodes 490-500 out of 20000), and is OAK helping/changing anything in
this area compared to previous versions?

Thanks!

Bertrand

Bertrand de Coatpont
Group Product Manager, Adobe Experience Management
Adobe 
512.284.4195 (tel), /bertranddecoatpont
lebescon@adobe.com
www.adobe.com


>


Re: OAK and large list of orderable child nodes

Posted by Lukas Kahwe Smith <sm...@pooteeweet.org>.
On 31 Jul 2014, at 09:12, Bertrand De Coatpont <le...@adobe.com> wrote:

> Hello,
> 
> In the JCR world, is there a specific API to obtain (for reading) a
> specific range of child nodes within a large list of orderable child nodes
> (e.g. Nodes 490-500 out of 20000), and is OAK helping/changing anything in
> this area compared to previous versions?

No, I do not think there is any paging capabilities with fetching childnames. You could only get the list of child node names, which I think will usually be available cheaper than the actual child nodes and then page through that list and fetch multiple nodes at a time on your own by path.

regards,
Lukas Kahwe Smith
smith@pooteeweet.org




Re: OAK and large list of orderable child nodes

Posted by Felix Meschberger <fm...@adobe.com>.
Hi

Am 31.07.2014 um 09:12 schrieb Bertrand De Coatpont <le...@adobe.com>:

> Hello,
> 
> In the JCR world, is there a specific API to obtain (for reading) a
> specific range of child nodes within a large list of orderable child nodes
> (e.g. Nodes 490-500 out of 20000), and is OAK helping/changing anything in
> this area compared to previous versions?

Node.getNodes() returns the children as a NodeIterator which is a RangeIterator, which has the skip(long), long getSize(), and long getPosition() methods. So, you might check this:

    try {
        NodeIterator children = node.getNodes();
        children.skip(490);
        for (int i=0; i < 10; i++) {
            Node child = children.nextNode();
            // do something useful
        }
    } catch (NoSuchElementException nse) {
        // if there are less than 490 elements
    } catch (RepositoryException re) {
        // oh well :-)
    }

Hope this helps

Regards
Felix

> 
> Thanks!
> 
> Bertrand
> 
> Bertrand de Coatpont
> Group Product Manager, Adobe Experience Management
> Adobe 
> 512.284.4195 (tel), /bertranddecoatpont
> lebescon@adobe.com
> www.adobe.com
> 
> 
>> 
> 


Re: OAK and large list of orderable child nodes

Posted by Marcel Reutegger <mr...@adobe.com>.
Hi,

I think it depends on the use case. e.g. how frequently do you
modify the list? how many 'producers' (sessions adding nodes) and
'consumers' (sessions removing nodes) do you have? is it OK if the
query result is slightly out of date? etc.

an async ordered index is probably a good choice if you have multiple
'producers' and 'consumers' and your application is OK with results
that are not always up to date.

Regards
 Marcel

On 31/07/14 16:56, "Laurie Byrum" <lb...@adobe.com> wrote:

>Would it be appropriate in this situation to adopt Oak indices and use
>queries instead of "listChildren"?
>
>
>
>On 7/31/14 4:56 AM, "Thomas Mueller" <mu...@adobe.com> wrote:
>
>>Hi,
>>
>>This might be a XY problem:
>>http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem
>>
>>What problem do you want to solve?
>>
>>I don't think it's a good idea to have a list of 20000 orderable
>>children,
>>also because neither Jackrabbit 2.x nor Jackrabbit Oak can deal with this
>>efficiently.
>>
>>Regards,
>>Thomas
>>
>>
>>
>>On 31/07/14 09:12, "Bertrand De Coatpont" <le...@adobe.com> wrote:
>>
>>>Hello,
>>>
>>>In the JCR world, is there a specific API to obtain (for reading) a
>>>specific range of child nodes within a large list of orderable child
>>>nodes
>>>(e.g. Nodes 490-500 out of 20000), and is OAK helping/changing anything
>>>in
>>>this area compared to previous versions?
>>>
>>>Thanks!
>>>
>>>Bertrand
>>>
>>>Bertrand de Coatpont
>>>Group Product Manager, Adobe Experience Management
>>>Adobe 
>>>512.284.4195 (tel), /bertranddecoatpont
>>>lebescon@adobe.com
>>>www.adobe.com
>>>
>>>
>>>>
>>>
>>
>


Re: OAK and large list of orderable child nodes

Posted by Laurie Byrum <lb...@adobe.com>.
Would it be appropriate in this situation to adopt Oak indices and use
queries instead of "listChildren"?



On 7/31/14 4:56 AM, "Thomas Mueller" <mu...@adobe.com> wrote:

>Hi,
>
>This might be a XY problem:
>http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem
>
>What problem do you want to solve?
>
>I don't think it's a good idea to have a list of 20000 orderable children,
>also because neither Jackrabbit 2.x nor Jackrabbit Oak can deal with this
>efficiently.
>
>Regards,
>Thomas
>
>
>
>On 31/07/14 09:12, "Bertrand De Coatpont" <le...@adobe.com> wrote:
>
>>Hello,
>>
>>In the JCR world, is there a specific API to obtain (for reading) a
>>specific range of child nodes within a large list of orderable child
>>nodes
>>(e.g. Nodes 490-500 out of 20000), and is OAK helping/changing anything
>>in
>>this area compared to previous versions?
>>
>>Thanks!
>>
>>Bertrand
>>
>>Bertrand de Coatpont
>>Group Product Manager, Adobe Experience Management
>>Adobe 
>>512.284.4195 (tel), /bertranddecoatpont
>>lebescon@adobe.com
>>www.adobe.com
>>
>>
>>>
>>
>


Re: OAK and large list of orderable child nodes

Posted by Thomas Mueller <mu...@adobe.com>.
Hi,

This might be a XY problem:
http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem

What problem do you want to solve?

I don't think it's a good idea to have a list of 20000 orderable children,
also because neither Jackrabbit 2.x nor Jackrabbit Oak can deal with this
efficiently.

Regards,
Thomas



On 31/07/14 09:12, "Bertrand De Coatpont" <le...@adobe.com> wrote:

>Hello,
>
>In the JCR world, is there a specific API to obtain (for reading) a
>specific range of child nodes within a large list of orderable child nodes
>(e.g. Nodes 490-500 out of 20000), and is OAK helping/changing anything in
>this area compared to previous versions?
>
>Thanks!
>
>Bertrand
>
>Bertrand de Coatpont
>Group Product Manager, Adobe Experience Management
>Adobe 
>512.284.4195 (tel), /bertranddecoatpont
>lebescon@adobe.com
>www.adobe.com
>
>
>>
>