[MediaWiki-commits] [Gerrit] doc: various updates - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: doc: various updates .. doc: various updates [includes/cache/MessageCache.php] - internal constants - constructor - a few missing @var [includes/clientpool/RedisConnectionPool.php] - group internal settings applying to the pool - misc protected members updates [includes/debug/Debug.php] - missing parameter name in @var statements Change-Id: I6ff0a68d659529d128f40f32b0fd1c1d39af952f --- M includes/cache/MessageCache.php M includes/clientpool/RedisConnectionPool.php M includes/debug/Debug.php 3 files changed, 70 insertions(+), 26 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index 49db857..c06383e 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -22,12 +22,27 @@ */ /** - * + * MediaWiki message cache structure version. + * Bump this whenever the message cache format has changed. + */ +define( 'MSG_CACHE_VERSION', 1 ); + +/** + * Memcached timeout when loading a key. + * See MessageCache::load() */ define( 'MSG_LOAD_TIMEOUT', 60 ); + +/** + * Memcached timeout when locking a key for a writing operation. + * See MessageCache::lock() + */ define( 'MSG_LOCK_TIMEOUT', 30 ); +/** + * Number of times we will try to acquire a lock from Memcached. + * This comes in addition to MSG_LOCK_TIMEOUT. + */ define( 'MSG_WAIT_TIMEOUT', 30 ); -define( 'MSG_CACHE_VERSION', 1 ); /** * Message cache @@ -44,10 +59,16 @@ */ protected $mCache; - // Should mean that database cannot be used, but check + /** +* Should mean that database cannot be used, but check +* @var bool $mDisable +*/ protected $mDisable; - /// Lifetime for cache, used by object caching + /** +* Lifetime for cache, used by object caching. +* Set on construction, see __construct(). +*/ protected $mExpiry; /** @@ -56,18 +77,21 @@ */ protected $mParserOptions, $mParser; - /// Variable for tracking which variables are already loaded + /** +* Variable for tracking which variables are already loaded +* @var array $mLoadedLanguages +*/ protected $mLoadedLanguages = array(); /** * Singleton instance * -* @var MessageCache +* @var MessageCache $instance */ private static $instance; /** -* @var bool +* @var bool $mInParser */ protected $mInParser = false; @@ -98,6 +122,11 @@ self::$instance = null; } + /** +* @param ObjectCache $memCached A cache instance. If none, fall back to CACHE_NONE. +* @param bool $useDB +* @param int $expiry Lifetime for cache. @see $mExpiry. +*/ function __construct( $memCached, $useDB, $expiry ) { if ( !$memCached ) { $memCached = wfGetCache( CACHE_NONE ); @@ -592,7 +621,10 @@ } /** -* Represents a write lock on the messages key +* Represents a write lock on the messages key. +* +* Will retry MessageCache::MSG_WAIT_TIMEOUT times, each operations having +* a timeout of MessageCache::MSG_LOCK_TIMEOUT. * * @param string $key * @return Boolean: success diff --git a/includes/clientpool/RedisConnectionPool.php b/includes/clientpool/RedisConnectionPool.php index 65fe58f..da4621a 100644 --- a/includes/clientpool/RedisConnectionPool.php +++ b/includes/clientpool/RedisConnectionPool.php @@ -36,23 +36,35 @@ * @since 1.21 */ class RedisConnectionPool { - // Settings for all connections in this pool - protected $connectTimeout; // string; connection timeout - protected $persistent; // bool; whether connections persist - protected $password; // string; plaintext auth password - protected $serializer; // integer; the serializer to use (Redis::SERIALIZER_*) + /** +* @name Pool settings. +* Settings there are shared for any connection made in this pool. +* See the singleton() method documentation for more details. +* @{ +*/ + /** @var string Connection timeout in seconds */ + protected $connectTimeout; + /** @var string Plaintext auth password */ + protected $password; + /** @var bool Whether connections persist */ + protected $persistent; + /** @var integer Serializer to use (Redis::SERIALIZER_*) */ + protected $serializer; + /** @} */ - protected $idlePoolSize = 0; // integer; current idle pool size + /** @var integer Current idle pool size */ + protected $idlePoolSize = 0; /** @var Array (server name =
[MediaWiki-commits] [Gerrit] doc: various updates - change (mediawiki/core)
Hashar has uploaded a new change for review. https://gerrit.wikimedia.org/r/64563 Change subject: doc: various updates .. doc: various updates [includes/cache/MessageCache.php] - internal constants - constructor - a few missing @var [includes/clientpool/RedisConnectionPool.php] - group internal settings applying to the pool - misc protected members updates [includes/debug/Debug.php] - missing parameter name in @var statements Change-Id: I6ff0a68d659529d128f40f32b0fd1c1d39af952f --- M includes/cache/MessageCache.php M includes/clientpool/RedisConnectionPool.php M includes/debug/Debug.php 3 files changed, 70 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/63/64563/1 diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index 49db857..c06383e 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -22,12 +22,27 @@ */ /** - * + * MediaWiki message cache structure version. + * Bump this whenever the message cache format has changed. + */ +define( 'MSG_CACHE_VERSION', 1 ); + +/** + * Memcached timeout when loading a key. + * See MessageCache::load() */ define( 'MSG_LOAD_TIMEOUT', 60 ); + +/** + * Memcached timeout when locking a key for a writing operation. + * See MessageCache::lock() + */ define( 'MSG_LOCK_TIMEOUT', 30 ); +/** + * Number of times we will try to acquire a lock from Memcached. + * This comes in addition to MSG_LOCK_TIMEOUT. + */ define( 'MSG_WAIT_TIMEOUT', 30 ); -define( 'MSG_CACHE_VERSION', 1 ); /** * Message cache @@ -44,10 +59,16 @@ */ protected $mCache; - // Should mean that database cannot be used, but check + /** +* Should mean that database cannot be used, but check +* @var bool $mDisable +*/ protected $mDisable; - /// Lifetime for cache, used by object caching + /** +* Lifetime for cache, used by object caching. +* Set on construction, see __construct(). +*/ protected $mExpiry; /** @@ -56,18 +77,21 @@ */ protected $mParserOptions, $mParser; - /// Variable for tracking which variables are already loaded + /** +* Variable for tracking which variables are already loaded +* @var array $mLoadedLanguages +*/ protected $mLoadedLanguages = array(); /** * Singleton instance * -* @var MessageCache +* @var MessageCache $instance */ private static $instance; /** -* @var bool +* @var bool $mInParser */ protected $mInParser = false; @@ -98,6 +122,11 @@ self::$instance = null; } + /** +* @param ObjectCache $memCached A cache instance. If none, fall back to CACHE_NONE. +* @param bool $useDB +* @param int $expiry Lifetime for cache. @see $mExpiry. +*/ function __construct( $memCached, $useDB, $expiry ) { if ( !$memCached ) { $memCached = wfGetCache( CACHE_NONE ); @@ -592,7 +621,10 @@ } /** -* Represents a write lock on the messages key +* Represents a write lock on the messages key. +* +* Will retry MessageCache::MSG_WAIT_TIMEOUT times, each operations having +* a timeout of MessageCache::MSG_LOCK_TIMEOUT. * * @param string $key * @return Boolean: success diff --git a/includes/clientpool/RedisConnectionPool.php b/includes/clientpool/RedisConnectionPool.php index 65fe58f..da4621a 100644 --- a/includes/clientpool/RedisConnectionPool.php +++ b/includes/clientpool/RedisConnectionPool.php @@ -36,23 +36,35 @@ * @since 1.21 */ class RedisConnectionPool { - // Settings for all connections in this pool - protected $connectTimeout; // string; connection timeout - protected $persistent; // bool; whether connections persist - protected $password; // string; plaintext auth password - protected $serializer; // integer; the serializer to use (Redis::SERIALIZER_*) + /** +* @name Pool settings. +* Settings there are shared for any connection made in this pool. +* See the singleton() method documentation for more details. +* @{ +*/ + /** @var string Connection timeout in seconds */ + protected $connectTimeout; + /** @var string Plaintext auth password */ + protected $password; + /** @var bool Whether connections persist */ + protected $persistent; + /** @var integer Serializer to use (Redis::SERIALIZER_*) */ + protected $serializer; + /** @} */ - protected $idlePoolSize = 0; // integer; current idle pool size + /** @var integer Current idle pool size */ + protected $idlePoolSize = 0;