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


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 *. | |
Version of LockManager that uses a quorum from peer servers for locks.
The resource space can also be sharded into separate peer groups.
Definition at line 31 of file QuorumLockManager.php.
| QuorumLockManager::doLock | ( | array $ | paths, |
| $ | type | ||
| ) | [final, protected] |
Lock resources with the given keys and lock type.
| array | $paths | List of paths |
| $type | integer LockManager::LOCK_* constant |
Reimplemented from LockManager.
Definition at line 35 of file QuorumLockManager.php.
| QuorumLockManager::doLockByType | ( | array $ | pathsByType | ) | [protected] |
| array | $paths | Map of LockManager::LOCK_* constants to lists of paths |
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.
| $bucket | integer | |
| array | $pathsByType | Map of LockManager::LOCK_* constants to lists of paths |
Definition at line 125 of file QuorumLockManager.php.
| QuorumLockManager::doUnlock | ( | array $ | paths, |
| $ | type | ||
| ) | [final, protected] |
Unlock resources with the given keys and lock type.
| array | $paths | List of paths |
| $type | integer LockManager::LOCK_* constant |
Reimplemented from LockManager.
Definition at line 39 of file QuorumLockManager.php.
| QuorumLockManager::doUnlockByType | ( | array $ | pathsByType | ) | [protected] |
| array | $paths | Map of LockManager::LOCK_* constants to lists of paths |
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.
| $bucket | integer | |
| array | $pathsByType | Map of LockManager::LOCK_* constants to lists of paths |
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().
| $lockSrv | string | |
| array | $pathsByType | Map of LockManager::LOCK_* constants to lists of paths |
Reimplemented in DBLockManager, MemcLockManager, and RedisLockManager.
| QuorumLockManager::getBucketFromPath | ( | $ | path | ) | [protected] |
Get the bucket for resource path.
This should avoid throwing any exceptions.
| $path | string |
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.
| $lockSrv | string | |
| array | $pathsByType | Map of LockManager::LOCK_* constants to lists of paths |
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.
| $lockSrv | string |
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().
Reimplemented in PostgreSqlLockManager, MySqlLockManager, RedisLockManager, MemcLockManager, and LSLockManager.
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.