MediaWiki
REL1_21
|
Class to handle job queues stored in the DB. More...
Public Member Functions | |
getAllQueuedJobs () | |
recycleAndDeleteStaleJobs () | |
Recycle or destroy any jobs that have been claimed for too long. | |
Public Attributes | |
const | CACHE_TTL_LONG = 300 |
const | CACHE_TTL_SHORT = 30 |
const | MAX_AGE_PRUNE = 604800 |
const | MAX_JOB_RANDOM = 2147483647 |
const | MAX_OFFSET = 255 |
const | ROOTJOB_TTL = 1209600 |
Protected Member Functions | |
__construct (array $params) | |
Additional parameters include: | |
claimOldest ($uuid) | |
Reserve a row with a single UPDATE without holding row locks over RTTs... | |
claimRandom ($uuid, $rand, $gte) | |
Reserve a row with a single UPDATE without holding row locks over RTTs... | |
doAck (Job $job) | |
doBatchPush (array $jobs, $flags) | |
doDeduplicateRootJob (Job $job) | |
doFlushCaches () | |
doGetAcquiredCount () | |
doGetPeriodicTasks () | |
doGetSize () | |
doIsEmpty () | |
doPop () | |
doWaitForBackups () | |
getDB ($index) | |
getMasterDB () | |
getSlaveDB () | |
insertFields (Job $job) | |
isRootJobOldDuplicate (Job $job) | |
Check if the "root" job of a given job has been superseded by a newer one. | |
optimalOrder () | |
supportedOrders () | |
Static Protected Member Functions | |
static | extractBlob ($blob) |
static | makeBlob ($params) |
Protected Attributes | |
$cluster = false | |
Private Member Functions | |
getCacheKey ($property) | |
getRootJobCacheKey ($signature) |
Class to handle job queues stored in the DB.
Definition at line 30 of file JobQueueDB.php.
JobQueueDB::__construct | ( | array $ | params | ) | [protected] |
Additional parameters include:
$params | array |
Reimplemented from JobQueue.
Definition at line 48 of file JobQueueDB.php.
JobQueueDB::claimOldest | ( | $ | uuid | ) | [protected] |
Reserve a row with a single UPDATE without holding row locks over RTTs...
string | $uuid | 32 char hex string |
Definition at line 357 of file JobQueueDB.php.
References array(), getMasterDB(), list, type, and wfDebugLog().
Referenced by doPop().
JobQueueDB::claimRandom | ( | $ | uuid, |
$ | rand, | ||
$ | gte | ||
) | [protected] |
Reserve a row with a single UPDATE without holding row locks over RTTs...
string | $uuid | 32 char hex string |
$rand | integer Random unsigned integer (31 bits) | |
bool | $gte | Search for job_random >= $random (otherwise job_random <= $random) |
Definition at line 279 of file JobQueueDB.php.
References $dir, $wgMemc, array(), getCacheKey(), getMasterDB(), global, list, and type.
Referenced by doPop().
JobQueueDB::doAck | ( | Job $ | job | ) | [protected] |
Job | $job |
MWException |
Reimplemented from JobQueue.
Definition at line 491 of file JobQueueDB.php.
References array(), Job\getId(), getMasterDB(), list, type, and use.
JobQueueDB::doBatchPush | ( | array $ | jobs, |
$ | flags | ||
) | [protected] |
array | $jobs | |
$flags |
DBError|Exception |
Reimplemented from JobQueue.
Definition at line 145 of file JobQueueDB.php.
References $flags, $job, $res, $wgMemc, array(), as, CACHE_TTL_LONG, getCacheKey(), getMasterDB(), global, insertFields(), list, JobQueue\QoS_Atomic, use, wfDebug(), and wfIncrStats().
JobQueueDB::doDeduplicateRootJob | ( | Job $ | job | ) | [protected] |
Job | $job |
MWException |
Reimplemented from JobQueue.
Definition at line 517 of file JobQueueDB.php.
References $params, $timestamp, $wgMemc, getMasterDB(), Job\getParams(), getRootJobCacheKey(), global, list, ROOTJOB_TTL, and use.
JobQueueDB::doFlushCaches | ( | ) | [protected] |
Reimplemented from JobQueue.
Definition at line 593 of file JobQueueDB.php.
References JobQueue\$type, $wgMemc, array(), as, getCacheKey(), and global.
JobQueueDB::doGetAcquiredCount | ( | ) | [protected] |
Reimplemented from JobQueue.
Definition at line 114 of file JobQueueDB.php.
References $count, $dbr, $wgMemc, array(), getCacheKey(), getSlaveDB(), global, list, and type.
JobQueueDB::doGetPeriodicTasks | ( | ) | [protected] |
Reimplemented from JobQueue.
Definition at line 581 of file JobQueueDB.php.
References array().
JobQueueDB::doGetSize | ( | ) | [protected] |
Reimplemented from JobQueue.
Definition at line 90 of file JobQueueDB.php.
References $dbr, $size, $wgMemc, array(), getCacheKey(), getSlaveDB(), global, list, and type.
JobQueueDB::doIsEmpty | ( | ) | [protected] |
Reimplemented from JobQueue.
Definition at line 65 of file JobQueueDB.php.
References $dbr, $wgMemc, array(), getCacheKey(), getSlaveDB(), global, list, and type.
JobQueueDB::doPop | ( | ) | [protected] |
Reimplemented from JobQueue.
Definition at line 218 of file JobQueueDB.php.
References $job, $title, $wgMemc, array(), claimOldest(), claimRandom(), JobQueue\factory(), getCacheKey(), getMasterDB(), global, isRootJobOldDuplicate(), list, Title\makeTitleSafe(), DuplicateJob\newFromJob(), order, use, wfDebugLog(), wfIncrStats(), and wfRandomString().
JobQueueDB::doWaitForBackups | ( | ) | [protected] |
Reimplemented from JobQueue.
Definition at line 574 of file JobQueueDB.php.
References wfWaitForSlaves().
static JobQueueDB::extractBlob | ( | $ | blob | ) | [static, protected] |
$blob |
Definition at line 709 of file JobQueueDB.php.
References $blob.
Reimplemented from JobQueue.
Definition at line 605 of file JobQueueDB.php.
References $dbr, $job, array(), JobQueue\factory(), getSlaveDB(), JobQueue\getType(), list, Title\makeTitle(), and use.
JobQueueDB::getCacheKey | ( | $ | property | ) | [private] |
Definition at line 679 of file JobQueueDB.php.
References $property, list, type, wfForeignMemcKey(), wfSplitWikiID(), and wiki.
Referenced by claimRandom(), doBatchPush(), doFlushCaches(), doGetAcquiredCount(), doGetSize(), doIsEmpty(), doPop(), and recycleAndDeleteStaleJobs().
JobQueueDB::getDB | ( | $ | index | ) | [protected] |
$index | integer (DB_SLAVE/DB_MASTER) |
Definition at line 640 of file JobQueueDB.php.
References $lb, array(), false, use, wfGetLB(), wfGetLBFactory(), and wiki.
Referenced by getMasterDB(), and getSlaveDB().
JobQueueDB::getMasterDB | ( | ) | [protected] |
Definition at line 632 of file JobQueueDB.php.
References getDB().
Referenced by claimOldest(), claimRandom(), doAck(), doBatchPush(), doDeduplicateRootJob(), doPop(), insertFields(), and recycleAndDeleteStaleJobs().
JobQueueDB::getRootJobCacheKey | ( | $ | signature | ) | [private] |
string | $signature | Hash identifier of the root job |
Definition at line 688 of file JobQueueDB.php.
References list, type, wfForeignMemcKey(), wfSplitWikiID(), and wiki.
Referenced by doDeduplicateRootJob(), and isRootJobOldDuplicate().
JobQueueDB::getSlaveDB | ( | ) | [protected] |
Definition at line 625 of file JobQueueDB.php.
References getDB().
Referenced by doGetAcquiredCount(), doGetSize(), doIsEmpty(), and getAllQueuedJobs().
JobQueueDB::insertFields | ( | Job $ | job | ) | [protected] |
$job | Job |
Definition at line 657 of file JobQueueDB.php.
References array(), Job\getDeduplicationInfo(), getMasterDB(), Job\getParams(), Job\getTitle(), Job\getType(), list, makeBlob(), and wfBaseConvert().
Referenced by doBatchPush().
JobQueueDB::isRootJobOldDuplicate | ( | Job $ | job | ) | [protected] |
Check if the "root" job of a given job has been superseded by a newer one.
$job | Job |
Definition at line 552 of file JobQueueDB.php.
References $params, $timestamp, $wgMemc, Job\getParams(), getRootJobCacheKey(), and global.
Referenced by doPop().
static JobQueueDB::makeBlob | ( | $ | params | ) | [static, protected] |
$params |
Definition at line 697 of file JobQueueDB.php.
References $params.
Referenced by insertFields().
JobQueueDB::optimalOrder | ( | ) | [protected] |
Reimplemented from JobQueue.
Definition at line 57 of file JobQueueDB.php.
Recycle or destroy any jobs that have been claimed for too long.
Definition at line 417 of file JobQueueDB.php.
References $count, $res, $wgMemc, array(), getCacheKey(), getMasterDB(), global, list, type, and wfIncrStats().
JobQueueDB::supportedOrders | ( | ) | [protected] |
Reimplemented from JobQueue.
Definition at line 53 of file JobQueueDB.php.
References array().
JobQueueDB::$cluster = false [protected] |
Definition at line 38 of file JobQueueDB.php.
const JobQueueDB::CACHE_TTL_LONG = 300 |
Definition at line 33 of file JobQueueDB.php.
Referenced by doBatchPush().
const JobQueueDB::CACHE_TTL_SHORT = 30 |
Definition at line 32 of file JobQueueDB.php.
const JobQueueDB::MAX_AGE_PRUNE = 604800 |
Definition at line 34 of file JobQueueDB.php.
const JobQueueDB::MAX_JOB_RANDOM = 2147483647 |
Definition at line 35 of file JobQueueDB.php.
const JobQueueDB::MAX_OFFSET = 255 |
Definition at line 36 of file JobQueueDB.php.
const JobQueueDB::ROOTJOB_TTL = 1209600 |
Definition at line 31 of file JobQueueDB.php.
Referenced by doDeduplicateRootJob().