On Fri, Sep 2, 2016 at 4:00 PM, Stefan Egli <stefane...@apache.org> wrote:
> If we
> separate listeners into purely internal vs external, then a queue as a whole
> is either purely internal or external and we no longer have this issue.

Not sure here on how this would work. The observation queue is made up
of ContentChange which is a tuple of [root NodeState , CommitInfo
(null for external)]

--- NS1-L---NS2-L--NS3---NS4-L---NS5-L ---NS6-L

--- a -------- /a/b  ----- /a/c --- /a/c
                                 /a/b     /a/b
                                            /a/d

So if we dedicate a queue for local changes only what would happen.

If we drop NS3 then while diffing [NS2-L, NS4-L] /a/c would be
reported as "added" and "local". Now we have a listener which listens
for locally added nt:file node such it can start some processing job
for it. Such a listener would then think its a locally added node and
would start a duplicate job

In general I believe

Listener for external Change
--------------------------------------
listener which are listening for external changes are maintaining some
state and purge/refresh it upon detecting change in interested paths.
They would work fine if multiple content change occurrences are merged

[NS4-L, NS5-L] + [NS5-L,NS6-L] = [NS4, NS6] (external) as they would
still detect the change

An example of this is LuceneIndexObserver which sets queue size to 5
and does not care its local or not. It just interested in if index
node is updated

Listener for local Change
----------------------------------

Such a listener is more particular about type of change and is doing
some persisted state change i.e. like registering a job, invoking some
third party service to update the value. This listener is only
interested in local as it know same listener is also active on other
cluster node (homogeneous cluster setup) so if a node gets added it
only need to react on the cluster node where it got added.

So for such it needs to be ensured that mixed content changes are not
compacted. So its fine to

[NS4-L, NS5-L] + [NS5-L,NS6-L] = [NS4, NS6]     (can be treated as
local with loss of user identity which caused the change)
[NS2-L, NS3]    + [NS3, NS4-L] = [NS2-L, NS4-L] (cannot be treated as local)

Just thinking out loud here to understand the problem space better :)

Chetan Mehrotra

Reply via email to