me.prettyprint.cassandra.locking
Class HLockManagerImpl

java.lang.Object
  extended by me.prettyprint.cassandra.locking.AbstractLockManager
      extended by me.prettyprint.cassandra.locking.HLockManagerImpl
All Implemented Interfaces:
HLockManager

public class HLockManagerImpl
extends AbstractLockManager

Wait Chain implementation created by Dominic Williams, reviewed by Aaron Morton and Patricio Echague.

Author:
patricioe (Patricio Echague - patricioe@gmail.com), tnine (Todd Nine)

Field Summary
 
Fields inherited from class me.prettyprint.cassandra.locking.AbstractLockManager
cluster, DUMMY_VALUE, keyspace, lockManagerConfigurator
 
Constructor Summary
HLockManagerImpl(Cluster cluster, HLockManagerConfigurator hlc)
           
 
Method Summary
 void acquire(HLock lock)
          Acquires a lock represented by lock.getPath and filling up the lockId with a unique client/caller lock id.
 void acquire(HLock lock, long timeout)
          Acquires a lock represented by lock.getPath and filling up the lockId with a unique client/caller lock id.
 HLock createLock(String lockPath)
          Creates a lock instance to use later on acquire(HLock)
 void release(HLock lock)
          Releases the lock
 void shutdownScheduler()
          Here for testing purposes only, this should never really be invoked
 
Methods inherited from class me.prettyprint.cassandra.locking.AbstractLockManager
getCluster, getKeyspace, getLockManagerConfigurator, init, setCluster, setKeyspace, setLockManagerConfigurator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HLockManagerImpl

public HLockManagerImpl(Cluster cluster,
                        HLockManagerConfigurator hlc)
Method Detail

acquire

public void acquire(HLock lock)
Description copied from interface: HLockManager
Acquires a lock represented by lock.getPath and filling up the lockId with a unique client/caller lock id. This method will block until a lock is returned

Parameters:
lock - a lock object with path identifying the lock path to lock on

acquire

public void acquire(HLock lock,
                    long timeout)
Acquires a lock represented by lock.getPath and filling up the lockId with a unique client/caller lock id. This method will block until a lock is returned, or timeout is reached

Parameters:
lock - a lock object with path identifying the lock path to lock on
timeout - The time to wait for acquiring a lock in milliseconds

shutdownScheduler

public void shutdownScheduler()
Here for testing purposes only, this should never really be invoked


release

public void release(HLock lock)
Description copied from interface: HLockManager
Releases the lock

Parameters:
lock - a lock to release

createLock

public HLock createLock(String lockPath)
Description copied from interface: HLockManager
Creates a lock instance to use later on acquire(HLock)

Returns:


Copyright © 2013. All Rights Reserved.