public class KazooLock extends Object
Constructor and Description |
---|
KazooLock(String path,
long timeout,
TimeUnit unit,
NodePool nodePool,
NodePoolJob npj)
Create a new lock object.
|
KazooLock(String path,
NodePool nodePool,
NodePoolJob npj)
Create a new lock object.
|
Modifier and Type | Method and Description |
---|---|
void |
acquire()
Acquire the lock for the current process
|
void |
release()
Release the lock
|
public KazooLock(String path, NodePool nodePool, NodePoolJob npj)
path
- the path to the lock ZNode that will be created upon acquiring the locknodePool
- node pool object containing ZooKeeper connection informationnpj
- the nodepool job representing the build that requested this node/lockpublic KazooLock(String path, long timeout, TimeUnit unit, NodePool nodePool, NodePoolJob npj)
path
- the path to the lock ZNode that will be created upon acquiring the locktimeout
- time to wait until lock acquisition is deemed a failureunit
- unit of time for the timeoutnodePool
- node pool object containing ZooKeeper connection informationnpj
- NodePoolJob representing the build this node/lock was created forCopyright © 2016–2018. All rights reserved.