MediaWiki
REL1_22
|
Manage locks using memcached servers. More...
Public Member Functions | |
__construct (array $config) | |
Construct a new instance from configuration. | |
__destruct () | |
Make sure remaining locks get cleared for sanity. | |
Protected Member Functions | |
acquireMutexes (MemcachedBagOStuff $memc, array $keys) | |
doFreeLocksOnServer ($lockSrv, array $paths, $type) | |
doGetLocksOnServer ($lockSrv, array $paths, $type) | |
freeLocksOnServer ($lockSrv, array $pathsByType) | |
Get a connection to a lock server and release locks on $paths. | |
getCache ($lockSrv) | |
Get the MemcachedBagOStuff object for a $lockSrv. | |
getLocksOnServer ($lockSrv, array $pathsByType) | |
Get a connection to a lock server and acquire locks. | |
isServerUp ($lockSrv) | |
recordKeyForPath ($path) | |
releaseAllLocks () | |
releaseMutexes (MemcachedBagOStuff $memc, array $keys) | |
Static Protected Member Functions | |
static | newLockArray () |
static | sanitizeLockArray ($a) |
Protected Attributes | |
Array | $bagOStuffs = array() |
Map server names to MemcachedBagOStuff objects *. | |
Array | $lockTypeMap |
Mapping of lock types to the type actually used *. | |
Array | $serversUp = array() |
* | |
$session = '' |
Manage locks using memcached servers.
Version of LockManager based on using memcached servers. This is meant for multi-wiki systems that may share files. All locks are non-blocking, which avoids deadlocks.
All lock requests for a resource, identified by a hash string, will map to one bucket. Each bucket maps to one or several peer servers, each running memcached. A majority of peers must agree for a lock to be acquired.
Definition at line 38 of file MemcLockManager.php.
MemcLockManager::__construct | ( | array $ | config | ) |
Construct a new instance from configuration.
$config paramaters include:
array | $config |
MWException |
Reimplemented from LockManager.
Definition at line 63 of file MemcLockManager.php.
Make sure remaining locks get cleared for sanity.
Definition at line 363 of file MemcLockManager.php.
MemcLockManager::acquireMutexes | ( | MemcachedBagOStuff $ | memc, |
array $ | keys | ||
) | [protected] |
$memc | MemcachedBagOStuff | |
array | $keys | List of keys to acquire |
Definition at line 316 of file MemcLockManager.php.
MemcLockManager::doFreeLocksOnServer | ( | $ | lockSrv, |
array $ | paths, | ||
$ | type | ||
) | [protected] |
Definition at line 197 of file MemcLockManager.php.
MemcLockManager::doGetLocksOnServer | ( | $ | lockSrv, |
array $ | paths, | ||
$ | type | ||
) | [protected] |
Definition at line 125 of file MemcLockManager.php.
MemcLockManager::freeLocksOnServer | ( | $ | lockSrv, |
array $ | pathsByType | ||
) | [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 from QuorumLockManager.
Definition at line 111 of file MemcLockManager.php.
MemcLockManager::getCache | ( | $ | lockSrv | ) | [protected] |
Get the MemcachedBagOStuff object for a $lockSrv.
string | $lockSrv | Server name |
Definition at line 266 of file MemcLockManager.php.
MemcLockManager::getLocksOnServer | ( | $ | lockSrv, |
array $ | pathsByType | ||
) | [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 from QuorumLockManager.
Definition at line 89 of file MemcLockManager.php.
MemcLockManager::isServerUp | ( | $ | lockSrv | ) | [protected] |
Reimplemented from QuorumLockManager.
Definition at line 256 of file MemcLockManager.php.
static MemcLockManager::newLockArray | ( | ) | [static, protected] |
Definition at line 294 of file MemcLockManager.php.
MemcLockManager::recordKeyForPath | ( | $ | path | ) | [protected] |
MemcLockManager::releaseAllLocks | ( | ) | [protected] |
Reimplemented from QuorumLockManager.
Definition at line 248 of file MemcLockManager.php.
MemcLockManager::releaseMutexes | ( | MemcachedBagOStuff $ | memc, |
array $ | keys | ||
) | [protected] |
$memc | MemcachedBagOStuff | |
array | $keys | List of acquired keys |
Definition at line 354 of file MemcLockManager.php.
static MemcLockManager::sanitizeLockArray | ( | $ | a | ) | [static, protected] |
$a | array |
Definition at line 302 of file MemcLockManager.php.
Array MemcLockManager::$bagOStuffs = array() [protected] |
Map server names to MemcachedBagOStuff objects *.
Definition at line 45 of file MemcLockManager.php.
Array MemcLockManager::$lockTypeMap [protected] |
array( self::LOCK_SH => self::LOCK_SH, self::LOCK_UW => self::LOCK_SH, self::LOCK_EX => self::LOCK_EX )
Mapping of lock types to the type actually used *.
Reimplemented from LockManager.
Definition at line 39 of file MemcLockManager.php.
Array MemcLockManager::$serversUp = array() [protected] |
*
Definition at line 46 of file MemcLockManager.php.
MemcLockManager::$session = '' [protected] |
Definition at line 48 of file MemcLockManager.php.