me.prettyprint.hector.api.locking
Interface HLockManager

All Known Implementing Classes:
AbstractLockManager, HLockManagerImpl

public interface HLockManager

Entity responsible for managing locks acquisition.

Author:
patricioe (Patricio Echague - patricioe@gmail.com)

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 string)
          Creates a lock instance to use later on acquire(HLock)
 Cluster getCluster()
          the Cluster this Lock Manager is running on
 Keyspace getKeyspace()
           
 HLockManagerConfigurator getLockManagerConfigurator()
           
 void init()
          Initializes the Lock Manager.
 void release(HLock lock)
          Releases the lock
 

Method Detail

init

void init()
Initializes the Lock Manager.


getCluster

Cluster getCluster()
the Cluster this Lock Manager is running on

Returns:

getKeyspace

Keyspace getKeyspace()
Returns:
The keyspace associated to this lock manager

getLockManagerConfigurator

HLockManagerConfigurator getLockManagerConfigurator()
Returns:
the configuration of this Lock Manager.

acquire

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
Throws:
HLockTimeoutException - if the waiting time for acquiring a lock has elapsed
HectorException - if any other error has occurred

acquire

void acquire(HLock lock)
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
Throws:
HLockTimeoutException - if the waiting time for acquiring a lock has elapsed
HectorException - if any other error has occurred

release

void release(HLock lock)
Releases the lock

Parameters:
lock - a lock to release

createLock

HLock createLock(String string)
Creates a lock instance to use later on acquire(HLock)

Parameters:
string -
Returns:


Copyright © 2013. All Rights Reserved.