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 Davide Giannella <gi...@gmail.com> on 2014/03/12 11:31:13 UTC

Index updates and notifications

Good morning everyone,

when we deal with indexes we can have two use case: synchronous and
asynchronous. In the first use case by being a commit hook the "handle"
is returned to the application using oak only when all the hooks are
completed and therefore the index is updated.

In the latter there's no way for application to know when the index is
updated and therefore risking to serve stale content.

Would it make sense to have an observation event on Asynchronous index
update? Something like: index A has indexed nodes B, C, D. I don't think
that a notification for each node is nice, I'd rather use a "batch"
notification.

In this way a client application by registering on such events could
flush any cache mechanism that could have been implemented.

Another use case would be to being able to understand about index
updates on cluster. So being able to understand when an index is updated
by a sychronisation of cluster nodes.

If I got the above correct, WDYT about the approach? Should I file a
ticket about this improvement (if not already there)?

Cheers
Davide

 

Re: Index updates and notifications

Posted by Davide Giannella <gi...@gmail.com>.
On 12/03/2014 10:36, Tommaso Teofili wrote:
> Hi Davide,
>
> in IndexEditorProvider#getIndexEditor you can specify an
> IndexUpdateCallback to register for index update notifications, maybe that
> can serve your need?
>
Sorry Tommaso, my ignorance has no limit :)

If I'm a client application that leverage some caching, how can I
register to this callback? I can see that the AsyncIndexUpdate register
it's own callback. Ideally I would like to have some events that I can
register to as consumer.

I'm not seeing right now someone who's not implementing an index could
register a callback.

Thanks
Davide



Re: Index updates and notifications

Posted by Tommaso Teofili <to...@gmail.com>.
Hi Davide,

in IndexEditorProvider#getIndexEditor you can specify an
IndexUpdateCallback to register for index update notifications, maybe that
can serve your need?

My 2 cents,
Tommaso


2014-03-12 11:31 GMT+01:00 Davide Giannella <gi...@gmail.com>:

> Good morning everyone,
>
> when we deal with indexes we can have two use case: synchronous and
> asynchronous. In the first use case by being a commit hook the "handle"
> is returned to the application using oak only when all the hooks are
> completed and therefore the index is updated.
>
> In the latter there's no way for application to know when the index is
> updated and therefore risking to serve stale content.
>
> Would it make sense to have an observation event on Asynchronous index
> update? Something like: index A has indexed nodes B, C, D. I don't think
> that a notification for each node is nice, I'd rather use a "batch"
> notification.
>
> In this way a client application by registering on such events could
> flush any cache mechanism that could have been implemented.
>
> Another use case would be to being able to understand about index
> updates on cluster. So being able to understand when an index is updated
> by a sychronisation of cluster nodes.
>
> If I got the above correct, WDYT about the approach? Should I file a
> ticket about this improvement (if not already there)?
>
> Cheers
> Davide
>
>
>