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 Michael Dürig <md...@apache.org> on 2014/01/29 10:49:24 UTC

Re: svn commit: r1562341 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/EventGenerator.java oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/EventQueue.java

Hi,

On 29.1.14 2:46 , jukka@apache.org wrote:
> Author: jukka
> Date: Wed Jan 29 01:46:43 2014
> New Revision: 1562341
>
> URL: http://svn.apache.org/r1562341
> Log:
> OAK-1332: Large number of changes to the same node can fill observation queue
>
> Implement rate-limiting to of ChangeListener callbacks, as mentioned in the issue


>       public void generate() {
>           if (!continuations.isEmpty()) {
> -            continuations.removeFirst().run();
> +            Continuation c = continuations.removeFirst();
> +            c.after.compareAgainstBaseState(c.before, c);
>           }
>       }

I preferred the former variant as it resembled more explicitly the 
notation of a continuation: the rest of the computation.

Michael

Re: svn commit: r1562341 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/EventGenerator.java oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/EventQueue.java

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Wed, Jan 29, 2014 at 4:49 AM, Michael Dürig <md...@apache.org> wrote:
> On 29.1.14 2:46 , jukka@apache.org wrote:
>>           if (!continuations.isEmpty()) {
>> -            continuations.removeFirst().run();
>> +            Continuation c = continuations.removeFirst();
>> +            c.after.compareAgainstBaseState(c.before, c);
>>           }
>
> I preferred the former variant as it resembled more explicitly the notation
> of a continuation: the rest of the computation.

Agreed. The reduction in implemented interfaces that I was going for
indeed doesn't seem to justify the break in encapsulation.

I restored the run() method in r1562457, along with some related javadoc.

BR,

Jukka Zitting