MediaWiki  REL1_22
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)
 Lock resources with the given keys and lock type.
 doLockByType (array $pathsByType)
 doLockingRequestBucket ($bucket, array $pathsByType)
 Attempt to acquire locks with the peers for a bucket.
 doUnlock (array $paths, $type)
 Unlock resources with the given keys and lock type.
 doUnlockByType (array $pathsByType)
 doUnlockingRequestBucket ($bucket, array $pathsByType)
 Attempt to release locks with the peers for a bucket.
 freeLocksOnServer ($lockSrv, array $pathsByType)
 Get a connection to a lock server and release locks on $paths.
 getBucketFromPath ($path)
 Get the bucket for resource path.
 getLocksOnServer ($lockSrv, array $pathsByType)
 Get a connection to a lock server and acquire locks.
 isServerUp ($lockSrv)
 Check if a lock server is up.
 releaseAllLocks ()
 Release all locks that this session is holding.

Protected Attributes

Array $degradedBuckets = array()
 Map of degraded buckets *.
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 31 of file QuorumLockManager.php.


Member Function Documentation

QuorumLockManager::doLock ( array paths,
type 
) [final, protected]

Lock resources with the given keys and lock type.

Parameters:
array$pathsList of paths
$typeinteger LockManager::LOCK_* constant
Returns:
Status

Reimplemented from LockManager.

Definition at line 35 of file QuorumLockManager.php.

QuorumLockManager::doLockByType ( array pathsByType) [protected]
See also:
LockManager::lockByType()
Parameters:
array$pathsMap of LockManager::LOCK_* constants to lists of paths
Returns:
Status
Since:
1.22

Reimplemented from LockManager.

Definition at line 43 of file QuorumLockManager.php.

QuorumLockManager::doLockingRequestBucket ( bucket,
array pathsByType 
) [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
array$pathsByTypeMap of LockManager::LOCK_* constants to lists of paths
Returns:
Status

Definition at line 125 of file QuorumLockManager.php.

QuorumLockManager::doUnlock ( array paths,
type 
) [final, protected]

Unlock resources with the given keys and lock type.

Parameters:
array$pathsList of paths
$typeinteger LockManager::LOCK_* constant
Returns:
Status

Reimplemented from LockManager.

Definition at line 39 of file QuorumLockManager.php.

QuorumLockManager::doUnlockByType ( array pathsByType) [protected]
See also:
LockManager::unlockByType()
Parameters:
array$pathsMap of LockManager::LOCK_* constants to lists of paths
Returns:
Status
Since:
1.22

Reimplemented from LockManager.

Definition at line 81 of file QuorumLockManager.php.

QuorumLockManager::doUnlockingRequestBucket ( bucket,
array pathsByType 
) [final, protected]

Attempt to release locks with the peers for a bucket.

Parameters:
$bucketinteger
array$pathsByTypeMap of LockManager::LOCK_* constants to lists of paths
Returns:
Status

Definition at line 167 of file QuorumLockManager.php.

QuorumLockManager::freeLocksOnServer ( lockSrv,
array pathsByType 
) [abstract, protected]

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

Subclasses must effectively implement this or releaseAllLocks().

Parameters:
$lockSrvstring
array$pathsByTypeMap of LockManager::LOCK_* constants to lists of paths
Returns:
Status

Reimplemented in DBLockManager, MemcLockManager, and RedisLockManager.

QuorumLockManager::getBucketFromPath ( path) [protected]

Get the bucket for resource path.

This should avoid throwing any exceptions.

Parameters:
$pathstring
Returns:
integer

Definition at line 202 of file QuorumLockManager.php.

QuorumLockManager::getLocksOnServer ( lockSrv,
array pathsByType 
) [abstract, protected]

Get a connection to a lock server and acquire locks.

Parameters:
$lockSrvstring
array$pathsByTypeMap of LockManager::LOCK_* constants to lists of paths
Returns:
Status

Reimplemented in DBLockManager, MemcLockManager, and RedisLockManager.

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

Check if a lock server is up.

This should process cache results to reduce RTT.

Parameters:
$lockSrvstring
Returns:
bool

Reimplemented in RedisLockManager, MemcLockManager, LSLockManager, and DBLockManager.

QuorumLockManager::releaseAllLocks ( ) [abstract, protected]

Release all locks that this session is holding.

Subclasses must effectively implement this or freeLocksOnServer().

Returns:
Status

Reimplemented in PostgreSqlLockManager, MySqlLockManager, RedisLockManager, MemcLockManager, and LSLockManager.


Member Data Documentation

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

Map of degraded buckets *.

Definition at line 33 of file QuorumLockManager.php.

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

Map of bucket indexes to peer server lists *.

Definition at line 32 of file QuorumLockManager.php.


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