You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Michael Dürig (JIRA)" <ji...@apache.org> on 2010/07/28 12:11:18 UTC

[jira] Created: (JCR-2688) Provide utility for handling large number of child nodes/properties

Provide utility for handling large number of child nodes/properties
-------------------------------------------------------------------

                 Key: JCR-2688
                 URL: https://issues.apache.org/jira/browse/JCR-2688
             Project: Jackrabbit Content Repository
          Issue Type: New Feature
          Components: jackrabbit-jcr-commons
    Affects Versions: 2.2.0
            Reporter: Michael Dürig
            Assignee: Michael Dürig


Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 

It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:

- expose a large number of nodes/properties as sequence
- parametrize the order of how nodes/properties appear in the sequence
- provide methods to lookup/add/remove nodes/properties by key 
- organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895226#action_12895226 ] 

Michael Dürig commented on JCR-2688:
------------------------------------

Sorry for the miss placed packages. Flat package representation in Eclipse got me. 
I fixed this in revision 982221.

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>             Fix For: 2.2.0
>
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893204#action_12893204 ] 

Alexander Klimetschek commented on JCR-2688:
--------------------------------------------

1. is the "right" way: if jackrabbit's JCR API implementation (core) depends on jcr-commons functionality, jcr-commons itself can't really offer functionality that depends on the JCR API (and on an API implementation to run/test it). But that extends to existing utilities in jcr-commons, I guess.

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893130#action_12893130 ] 

Thomas Mueller edited comment on JCR-2688 at 7/28/10 6:27 AM:
--------------------------------------------------------------

I would use a test dependency. Placing the tests somewhere else is weird.

      was (Author: tmueller):
    That about a test dependency?
  
> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-2688:
-------------------------------

    Attachment: JCR-2688-no-cc.patch

BTW, I'm not too excited about the new commons-collections dependency in jcr-commons. So far we've tried to minimize the number of dependencies in jcr-commons.

The attached patch (JCR-2688-no-cc.patch) replaces the commons-collections dependencies in o.a.j.commons.flat with roughly equivalent constructs from the standard Java libraries.

There are still a few related iterator classes based on commons-collections after JCR-2698. I'll reopen that issue to figure out what to do with them.

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>             Fix For: 2.2.0
>
>         Attachments: JCR-2688-no-cc.patch, JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12894855#action_12894855 ] 

Jukka Zitting commented on JCR-2688:
------------------------------------

There's no need for the tests in jcr-commons to depend on the latest snapshot version of jackrabbit-core. Using the following should avoid the circular dependency:

    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-core</artifactId>
      <version>2.0.0</version>
      <scope>test</scope>
    </dependency>


> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>             Fix For: 2.2.0
>
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895195#action_12895195 ] 

Jukka Zitting commented on JCR-2688:
------------------------------------

Could we move the org.apache.jackrabbit.flat package to org.apache.jackrabbit.commons.flat? I'd like to keep as much of jcr-commons inside o.a.j.commons as possible.

The RankTest class should also go from flat to o.a.j.commons.flat.

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>             Fix For: 2.2.0
>
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12894603#action_12894603 ] 

Michael Dürig commented on JCR-2688:
------------------------------------

I created JCR-2692 to track the issue of splitting jcr-commons into tow separate modules. 

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>             Fix For: 2.2.0
>
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893193#action_12893193 ] 

Michael Dürig commented on JCR-2688:
------------------------------------

So I see four option for the unit tests:

1. Move above utility classes along with the unit test into their own module
2. Add the unit tests to jackrabbit-core
3. Add the unit tests to jcr-commons but run them during the core build. Needs a jcr-commons test artifact
4. Do away with the unit tests all together

Although 1. is the cleanest way I don't like it since we have enough modules already. 
4. is bad
For 2. I think jackrabbit-core is the wrong place. Unit tests always have a documentation aspect. People just wont look for them in core.
So I think we are left with 3. Which is not a bright solution neither.

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12894054#action_12894054 ] 

Felix Meschberger commented on JCR-2688:
----------------------------------------

(6) would probably be best and also solve the mistakes others have done by going (3), (1) the second best and everything else is just not a good idea ;-)

BTW IMHO the "excuse" 'I don't like it since we have enough modules already' is just FUD. The problem is not the number of modules. The problem really is the unclear separation between modules. What you do with (2) or (3) is add to this incertainty.

So please, don't go the (2) or (3) route (what others have done already IMHO is equally wrong and should probably be fixed).

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893212#action_12893212 ] 

Michael Dürig commented on JCR-2688:
------------------------------------

5. means basically reimplementing JCR... 
6. is more or less the same as 1.

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig updated JCR-2688:
-------------------------------

    Attachment: JCR-2688.patch

Proposed patch

Example usage:

 // Create a new TreeManager instance rooted at node. Splitting of nodes takes place
 // when the number of children of a node exceeds 40 and is done such that each new
 // node has at least 40 child nodes. The keys are ordered according to the natural
 // order of java.lang.String.
 TreeManager treeManager = new BTreeManager(node, 20, 40, Rank.<String>comparableComparator(), true);

 // Create a new NodeSequence with that tree manager
 NodeSequence nodes = ItemSequence.createNodeSequence(treeManager);

 // Add nodes with key "jcr" and "day"
 nodes.addNode("jcr", NodeType.NT_UNSTRUCTURED);
 nodes.addNode("day", NodeType.NT_UNSTRUCTURED);

 // Iterate over the node in the sequence.
 // Prints "day jcr "
 for (Node n : nodes) {
     System.out.print(n.getName() + " ");
 }

 // Retrieve node with key "jcr"
 Node n = nodes.getItem("jcr");

 // Remove node with key "day"
 nodes.removeNode("day");

The nodes in the JCR sub tree are arranged such that any node named x only contains child nodes with names greater or equal to x. The implementation keeps the child nodes in the sub tree ordered if the respective node type supports ordering of child nodes. Ordering is always wrt. to a Comparator on the respective keys. For lexical order this arrangement corresponds to how words are arranged in a multi volume encyclopedia.



> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893129#action_12893129 ] 

Michael Dürig commented on JCR-2688:
------------------------------------

Open questions:

- Currently these utility classes live in a new package o.a.j.flat. There might be better names...
- I would like to add unit tests. However jcr-commons currently does not have dependencies to the core (and other modules) which would be needed for the tests. Should we add the required deps with scope test or should we place the unit test somewhere else? where?

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig resolved JCR-2688.
--------------------------------

    Resolution: Fixed

Fixed at revision 982695

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>             Fix For: 2.2.0
>
>         Attachments: JCR-2688-no-cc.patch, JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893177#action_12893177 ] 

Michael Dürig commented on JCR-2688:
------------------------------------

Maven seems to fine with jackrabbit-core as test dependency. Eclipse doesn't like it however since it results in a circular classpath. 

So the questions remains: where should units tests for classes in jcr-commons go which need a repository?

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig resolved JCR-2688.
--------------------------------

    Fix Version/s: 2.2.0
       Resolution: Fixed

I committed the patch with minor modifications along with test cases in revision 981597

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>             Fix For: 2.2.0
>
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Justin Edelson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893171#action_12893171 ] 

Justin Edelson commented on JCR-2688:
-------------------------------------

> I would use a test dependency. Placing the tests somewhere else is weird.
You can't do this; it will create a circular dependency between core and jcr-commons.

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893130#action_12893130 ] 

Thomas Mueller commented on JCR-2688:
-------------------------------------

That about a test dependency?

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893208#action_12893208 ] 

Michael Dürig commented on JCR-2688:
------------------------------------

Yes technically 1. is the right way... However I fear its not a realistic option. 
As it seems 2. is the way taken by others (i.e. for o.a.j.c.query.GQL). So I guess I'll also take this approach. 

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12894027#action_12894027 ] 

Marcel Reutegger commented on JCR-2688:
---------------------------------------

I suggest you go with 3)

We already did this with test cases for the spi and it worked quite well.

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895277#action_12895277 ] 

Michael Dürig commented on JCR-2688:
------------------------------------

I'm basically fine with the patch. However I would refactor it a bit to regain readability of the code. 

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>             Fix For: 2.2.0
>
>         Attachments: JCR-2688-no-cc.patch, JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Justin Edelson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893209#action_12893209 ] 

Justin Edelson commented on JCR-2688:
-------------------------------------

5. Leave the unit tests in jcr-commons and use mocks

or

6. Break jcr-commons into two:
* jcr-impl-commons - utility classes/interfaces for help *implementing* JCR
* jcr-api-commons - utility classes/interfaces for help *using* JCR

And then combine those into jcr-commons (for backwards compatibility)

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig reopened JCR-2688:
--------------------------------


Reopening to address Jukka's comment regarding the commons-collection dependency 

> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>             Fix For: 2.2.0
>
>         Attachments: JCR-2688-no-cc.patch, JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2688) Provide utility for handling large number of child nodes/properties

Posted by "Justin Edelson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893181#action_12893181 ] 

Justin Edelson commented on JCR-2688:
-------------------------------------

> Maven seems to fine with jackrabbit-core as test dependency.

This may be true if you run a single project build, but it fails when running a reactor build:

[INFO] The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='org.apache.jackrabbit:jackrabbit-core'}' and 'Vertex{label='org.apache.jackrabbit:jackrabbit-jcr-commons'}' introduces to cycle in the graph org.apache.jackrabbit:jackrabbit-jcr-commons --> org.apache.jackrabbit:jackrabbit-core --> org.apache.jackrabbit:jackrabbit-jcr-commons


> Provide utility for handling large number of child nodes/properties
> -------------------------------------------------------------------
>
>                 Key: JCR-2688
>                 URL: https://issues.apache.org/jira/browse/JCR-2688
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.2.0
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>         Attachments: JCR-2688.patch
>
>
> Jackrabbit does not cope well with 'flat' hierarchies. That is with hierarchies where a node has many child nodes and/or properties. The current recommendation for such situations is to manually add intermediate nodes. 
> It would be nice to have an utility which adds/removes intermediate nodes as needed and expose a 'flat' view to users. Such an utility should:
> - expose a large number of nodes/properties as sequence
> - parametrize the order of how nodes/properties appear in the sequence
> - provide methods to lookup/add/remove nodes/properties by key 
> - organize the node/properties in the underlying JCR hierarchy in a way which is both efficient for above operations and easily understandable to users looking at the hierarchy. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.