Package com.twitter.common.zookeeper

Examples of com.twitter.common.zookeeper.DistributedLock


        return result;
    }

    public void lock(String lockPath) {
        assert mLocks.get(lockPath) == null: "mLocks.get(" + lockPath + ") == null";
        DistributedLock distributedLock = new DistributedLockImpl(mZookeeperClient, lockPath);
        mLocks.put(lockPath, distributedLock);
        distributedLock.lock();
    }
View Full Code Here


        mLocks.put(lockPath, distributedLock);
        distributedLock.lock();
    }

    public void unlock(String lockPath) {
        DistributedLock distributedLock = mLocks.get(lockPath);
        assert distributedLock != null: "mLocks.get(" + lockPath + ") != null";
        distributedLock.unlock();
        mLocks.remove(lockPath);
    }
View Full Code Here

TOP

Related Classes of com.twitter.common.zookeeper.DistributedLock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.