lock = info.lock;
} else {
// nope: create a new lock and watcher
lock = new ZooLock(lockPath);
watcher = new TServerLockWatcher();
lock.lockAsync(watcher, "master".getBytes());
}
TServerInstance instance = null;
// Did we win the lock yet?
if (!lock.isLocked() && !watcher.gotLock && watcher.failureException == null) {
// Nope... there's a server out there: is this is a new server?