You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@curator.apache.org by Naresh Babu Durgam <nd...@marketshare.com> on 2014/12/10 06:07:39 UTC

Regarding hierarchy locking

Hi All,

I am planning to use zookeeper + curator as a distributed locking framework in my project.
While assessing whether my project requirements can be met, I got these below questions which I seek your help.

Scenario 1:
Resource hierarchy in locking:
We have notion of hierarchy in resources, such that if a resource (eg: DB table) is locked, other requests for that object and all sub-ordinate resources(eg: rows) should be blocked. Similarly, if sub-ordinates of a resource is locked then the lock request for the resource should block on that. Is there a way to configure curator to serve the above need?

Scenario 2:
                Actor based reentrancy:
               User U1 logged into the system from node N1. During the system operations he acquires  locks on the shared resources. If he requests the same resource again, it will be granted by curator because the reentrancy check is based on UUID of the thread. If the same user U1 login to the system again from node N2, his requests will be queued because UUIDs won't match. My requirement is that if any user logins simultaneously from different nodes(multiple jvms), all his requests has to be dealt as if he logged in from a single node. Can this be done by replacing UUID with UserID( in general any actor/application based ID) in curator? If not please help by noting the correct method.


Thanks,
Naresh