MediaWiki  REL1_20
QuorumLockManager Class Reference

Version of LockManager that uses a quorum from peer servers for locks. More...

Inheritance diagram for QuorumLockManager:
Collaboration diagram for QuorumLockManager:

List of all members.

Protected Member Functions

 doLock (array $paths, $type)
 doLockingRequestBucket ($bucket, array $paths, $type)
 Attempt to acquire locks with the peers for a bucket.
 doUnlock (array $paths, $type)
 doUnlockingRequestBucket ($bucket, array $paths, $type)
 Attempt to release locks with the peers for a bucket.
 freeLocksOnServer ($lockSrv, array $paths, $type)
 Get a connection to a lock server and release locks on $paths.
 getBucketFromKey ($path)
 Get the bucket for resource path.
 getLocksOnServer ($lockSrv, array $paths, $type)
 Get a connection to a lock server and acquire locks on $paths.
 isServerUp ($lockSrv)
 Check if a lock server is up.
 releaseAllLocks ()
 Release all locks that this session is holding.

Protected Attributes

Array $srvsByBucket = array()
 Map of bucket indexes to peer server lists *.

Detailed Description

Version of LockManager that uses a quorum from peer servers for locks.

The resource space can also be sharded into separate peer groups.

Since:
1.20

Definition at line 193 of file LockManager.php.


Member Function Documentation

QuorumLockManager::doLock ( array $  paths,
type 
) [final, protected]
See also:
LockManager::doLock()
Parameters:
$pathsarray
$typeint
Returns:
Status

Reimplemented from LockManager.

Definition at line 202 of file LockManager.php.

QuorumLockManager::doLockingRequestBucket ( bucket,
array $  paths,
type 
) [final, protected]

Attempt to acquire locks with the peers for a bucket.

This is all or nothing; if any key is locked then this totally fails.

Parameters:
$bucketinteger
$pathsArray List of resource keys to lock
$typeinteger LockManager::LOCK_EX or LockManager::LOCK_SH
Returns:
Status

Definition at line 286 of file LockManager.php.

QuorumLockManager::doUnlock ( array $  paths,
type 
) [final, protected]
See also:
LockManager::doUnlock()
Parameters:
$pathsarray
$typeint
Returns:
Status

Reimplemented from LockManager.

Definition at line 244 of file LockManager.php.

QuorumLockManager::doUnlockingRequestBucket ( bucket,
array $  paths,
type 
) [final, protected]

Attempt to release locks with the peers for a bucket.

Parameters:
$bucketinteger
$pathsArray List of resource keys to lock
$typeinteger LockManager::LOCK_EX or LockManager::LOCK_SH
Returns:
Status

Definition at line 328 of file LockManager.php.

QuorumLockManager::freeLocksOnServer ( lockSrv,
array $  paths,
type 
) [abstract, protected]

Get a connection to a lock server and release locks on $paths.

Subclasses must effectively implement this or releaseAllLocks().

Parameters:
$lockSrvstring
$pathsarray
$typeinteger
Returns:
Status

Reimplemented in MemcLockManager, DBLockManager, and LSLockManager.

QuorumLockManager::getBucketFromKey ( path) [protected]

Get the bucket for resource path.

This should avoid throwing any exceptions.

Parameters:
$pathstring
Returns:
integer

Definition at line 350 of file LockManager.php.

QuorumLockManager::getLocksOnServer ( lockSrv,
array $  paths,
type 
) [abstract, protected]

Get a connection to a lock server and acquire locks on $paths.

Parameters:
$lockSrvstring
$pathsarray
$typeinteger
Returns:
Status

Reimplemented in MySqlLockManager, DBLockManager, MemcLockManager, and LSLockManager.

QuorumLockManager::isServerUp ( lockSrv) [abstract, protected]

Check if a lock server is up.

Parameters:
$lockSrvstring
Returns:
bool

Reimplemented in MemcLockManager, DBLockManager, and LSLockManager.

QuorumLockManager::releaseAllLocks ( ) [abstract, protected]

Release all locks that this session is holding.

Subclasses must effectively implement this or freeLocksOnServer().

Returns:
Status

Reimplemented in MemcLockManager, DBLockManager, and LSLockManager.


Member Data Documentation

Array QuorumLockManager::$srvsByBucket = array() [protected]

Map of bucket indexes to peer server lists *.

Definition at line 194 of file LockManager.php.


The documentation for this class was generated from the following file: