jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mueller <muel...@adobe.com>
Subject Re: Observation design (Was: svn commit: r1351414 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: api/ChangeSet.java api/ContentSession.java core/ContentSessionImpl.java)
Date Tue, 19 Jun 2012 11:56:10 GMT

Thinking about this again, we would need MicroKernel.waitForCommit() only
to detect changes written by *another* process (another cluster node). A
process should be able to know what it changed itself, without polling,
and having to ask the MicroKernel instance :-)

I was wondering if MongoDB supports feature to avoid polling. What I found
is "Tailable Cursors":



So it seems a MongoDB MicroKernel could support such a feature. Whether or
not this feature is needed (Jackrabbit 2.x doesn't have it) and whether
this needs to be in the MicroKernel API is a different question.


On 6/19/12 9:27 AM, "Thomas Mueller" <mueller@adobe.com> wrote:

>>>- We can implement the polling approach (using a 0 timeout) but also
>>> the option to do blocking. Since this can be directly delegated to the
>>> Microkernel (waitForCommit) the added complexity for this is minimal.
>>The complexity is still there, it's just one level below. Personally
>>I'd rather drop the waitForCommit() method unless we really do have a
>>hard use case for that functionality.
>I believe waitForCommit() actually simplify things. It's not a hard use
>case, but from an architectural point of view the advantages of
>waitForCommit() are:
>- no need for polling, and configuring polling frequency
>- no need for callbacks
>- events are delivered as early as possible
>With polling, beside the obvious disadvantage that events are delivered
>(possibly a lot) later, polling also needs more CPU cycles, specially when
>there are multiple consumers. Also, because of the delayed event delivery,
>cache efficiency is reduced, further deceasing performance.

View raw message