public void release ( String pathInZooKeeper ) throws Exception { final String path = normalizePath ( pathInZooKeeper ) ; try { client . delete ( ) . forPath ( getLockPath ( path ) ) ; } catch ( KeeperException . NoNodeException ignored ) { // we have never locked this node } catch ( Exception e ) { throw new Exception ( "Could not release the lock: " + getLockPath ( pathInZooKeeper ) + ' ' , e ) ; } }
Releases the lock from the node under the given ZooKeeper path . If no lock exists then nothing happens .