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/04/28 17:15:40 UTC

persistence knowledge in oak-core/commit hooks

Hello team,

is there a way to know the following at oak-core/commit-hook level

* On which persistence am I running? Mongo, Tar, RDB, ...
* Am I part of a cluster of nodes or am I the only one?

Thank you
Davide



Re: persistence knowledge in oak-core/commit hooks

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

On Mon, Apr 28, 2014 at 11:20 AM, Jukka Zitting <ju...@gmail.com> wrote:
> If you need such information for something (normally one shouldn't
> depend on such backend details), ...

To expand on why this is a bad idea: Using such backend details can
easily make it difficult or even impossible to migrate repositories
from one backend to another or to change the cluster configuration of
an existing repository.

BR,

Jukka Zitting

Re: persistence knowledge in oak-core/commit hooks

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

On Mon, Apr 28, 2014 at 11:15 AM, Davide Giannella
<gi...@gmail.com> wrote:
> is there a way to know the following at oak-core/commit-hook level
>
> * On which persistence am I running? Mongo, Tar, RDB, ...

Not really. An instanceof check on the NodeState/Builder would give
you that information, but in a highly fragile manner.

> * Am I part of a cluster of nodes or am I the only one?

No.

If you need such information for something (normally one shouldn't
depend on such backend details), it's probably best to have it passed
it explicitly as a configuration option of your component.

BR,

Jukka Zitting