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

Carsten Ziegeler edited comment on SLING-4564 at 4/2/15 5:33 AM:
-----------------------------------------------------------------

Please also take SLING-2523 into account, the work there has never been 
finished but has progressed a lot. Just registering a single listener should 
really be enough and we can also fix all the other problems mentioned in that 
issue while we're at it.

In addition to the per node listener, the jcr installer also registers a 
listener to the root to be aware of removals. This listener alone should be 
sufficient


was (Author: cziegeler):
Please also take SLING-2523 into account, the work there has never been 
finished but has progressed a lot. Just registering a single listener should 
really be enough and we can also fix all the other problems mentioned in that 
issue while we're at it

> Use a single listener registered for multiple path in JCR installer
> -------------------------------------------------------------------
>
>                 Key: SLING-4564
>                 URL: https://issues.apache.org/jira/browse/SLING-4564
>             Project: Sling
>          Issue Type: Improvement
>          Components: Installer
>    Affects Versions: JCR Installer 3.1.8
>            Reporter: Chetan Mehrotra
>
> Sling Jcr installer currently registers one listener per watched folder. On 
> an application like AEM this results in ~150 listeners out of total 210 to 
> belong to Jcr installer.
> Recently Jackrabbit introduced support for adding [additional 
> path|https://github.com/apache/jackrabbit/blob/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/observation/JackrabbitEventFilter.java#L232]
>  to listen to as part of JCR-3745. This can be leveraged by the Jcr installer 
> to avoid registering multiple listeners and instead use one listener.
> The above feature can be used in following form
> {code}
> String[] paths = searchPaths.toArray(new String[]{});
>             JackrabbitEventFilter eventFilter = new JackrabbitEventFilter()
>                     .setAbsPath(paths[0])
>                     .setEventTypes(Event.NODE_ADDED       |
>                             Event.NODE_REMOVED     |
>                             Event.NODE_MOVED       |
>                             Event.PROPERTY_ADDED   |
>                             Event.PROPERTY_CHANGED |
>                             Event.PROPERTY_REMOVED )
>                     .setIsDeep(true)
>                     .setNoLocal(false)
>                     .setNoExternal(true);
>             if (paths.length > 1) {
>                 eventFilter.setAdditionalPaths(paths);
>             }
>             JackrabbitObservationManager observationManager = 
> (JackrabbitObservationManager) 
> adminSession.getWorkspace().getObservationManager();
>             observationManager.addEventListener(this, eventFilter);
> {code}
> This would allow more efficient observation processing and avoid putting load 
> on system as Oak currently maintains one queue per listener.



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

Reply via email to