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

Bertrand Delacretaz commented on SLING-3279:
--------------------------------------------

Thanks, here are some additional rough notes from our discussion last week.

We can analyze the registered OSGi services that have event.topics and/or 
event.filter service properties to optimize how Sling listens to Oak events.

We might introduce an optional additional service property that helps optimize 
that further, or have listeners implement additional interfaces for that.

We should make sure all relevant observation statistics are available via JMX, 
to troubleshoot and optimize. Oak is already providing some of that.

We need to stay compatible with Jackrabbit, with automatic switching between 
modes. That can be based on repository descriptors if needed, we might ask the 
Oak team to add a descriptor that advertises the availability of these 
optimized observers.

The JcrResourceListener code is at
https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java



> Leverage improved observation support from Oak
> ----------------------------------------------
>
>                 Key: SLING-3279
>                 URL: https://issues.apache.org/jira/browse/SLING-3279
>             Project: Sling
>          Issue Type: Improvement
>          Components: JCR
>            Reporter: Michael Dürig
>
> OAK-1120 introduces better support for observation, which could be used by 
> Sling. For example JcrResourceListener could be rewritten leveraging Oak's 
> Observer. Since Oak observers already run on background threads further 
> decoupling (like it is currently done) is not necessary. This makes it 
> unnecessary to queue potentially a lot of events in Sling. Since neither Oak 
> there does queue events (they are generated by need) this will probably 
> greatly improve scalability in the face of many events. 
> Furthermore OSGi filters could be passed down and translated to Oak such that 
> filtering is done much closer to the source of the events. 
> Finally instead of using a centralised event dispatcher (like 
> JcrResourceListener  currently is) it would be better to install a dedicated 
> Observer for each OSGi event listener since dispatching is already handled by 
> Oak and thread pooling (i.e. assigning threads for dispatching call backs to 
> observers) can be controlled through Sling's thread pool support (*). This 
> has the further advantage of making individual stats available for the 
> listeners through JMX.
> (*) Register an OakExecutor backed by e.g. a Sling thread pool and it will be 
> picked up by Oak.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Reply via email to