Apache Curator lock path -


we know how create distributed shared lock using apache curator:

interprocessmutex lock = new interprocessmutex(client,"/my/lock"); 

for above code, have 2 questions:

1: second parameter path lock(znode), lock znode created period of code automatically, or need create manually before?

2: if created "interprocessmutex", if lock znode has been created other instances already? throw "znode exsting" exception? if doesn't throw exception, happened, create duplicate znode?

for 1 - yes, curator creates path (and parents if needed) you.

for 2 - if other instances allocate interprocessmutex path there no issue. it's handled internally. curator creates paths if needed. think of path "lock id".

dislaimer: i'm main author of curator


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -