MediaWiki
1.28.0
|
Class to handle job queues stored in the DB. More...
Public Member Functions | |
doBatchPushInternal (IDatabase $dbw, array $jobs, $flags, $method) | |
This function should not be called outside of JobQueueDB. More... | |
getAllAcquiredJobs () | |
getAllQueuedJobs () | |
getCoalesceLocationInternal () | |
recycleAndDeleteStaleJobs () | |
Recycle or destroy any jobs that have been claimed for too long. More... | |
![]() | |
ack (Job $job) | |
Acknowledge that a job was completed. More... | |
batchPush (array $jobs, $flags=0) | |
Push a batch of jobs into the queue. More... | |
deduplicateRootJob (IJobSpecification $job) | |
Register the "root job" of a given job into the queue for de-duplication. More... | |
delayedJobsEnabled () | |
delete () | |
Deleted all unclaimed and delayed jobs from the queue. More... | |
flushCaches () | |
Clear any process and persistent caches. More... | |
getAbandonedCount () | |
Get the number of acquired jobs that can no longer be attempted. More... | |
getAcquiredCount () | |
Get the number of acquired jobs (these are temporarily out of the queue). More... | |
getAllAbandonedJobs () | |
Get an iterator to traverse over all abandoned jobs in this queue. More... | |
getAllAcquiredJobs () | |
Get an iterator to traverse over all claimed jobs in this queue. More... | |
getAllDelayedJobs () | |
Get an iterator to traverse over all delayed jobs in this queue. More... | |
getAllQueuedJobs () | |
Get an iterator to traverse over all available jobs in this queue. More... | |
getCoalesceLocationInternal () | |
Do not use this function outside of JobQueue/JobQueueGroup. More... | |
getDelayedCount () | |
Get the number of delayed jobs (these are temporarily out of the queue). More... | |
getOrder () | |
getReadOnlyReason () | |
getSiblingQueueSizes (array $types) | |
Check the size of each of the given queues. More... | |
getSiblingQueuesWithJobs (array $types) | |
Check whether each of the given queues are empty. More... | |
getSize () | |
Get the number of available (unacquired, non-delayed) jobs in the queue. More... | |
getType () | |
getWiki () | |
isEmpty () | |
Quickly check if the queue has no available (unacquired, non-delayed) jobs. More... | |
pop () | |
Pop a job off of the queue. More... | |
push ($jobs, $flags=0) | |
Push one or more jobs into the queue. More... | |
waitForBackups () | |
Wait for any replica DBs or backup servers to catch up. More... | |
Static Public Member Functions | |
static | selectFields () |
Return the list of job fields that should be selected. More... | |
![]() | |
static | factory (array $params) |
Get a job queue object of the specified type. More... | |
static | incrStats ($key, $type, $delta=1) |
Call wfIncrStats() for the queue overall and for the queue type. More... | |
Public Attributes | |
const | CACHE_TTL_SHORT = 30 |
const | MAX_AGE_PRUNE = 604800 |
const | MAX_JOB_RANDOM = 2147483647 |
const | MAX_OFFSET = 255 |
![]() | |
const | QOS_ATOMIC = 1 |
const | ROOTJOB_TTL = 2419200 |
Protected Member Functions | |
__construct (array $params) | |
Additional parameters include: More... | |
claimOldest ($uuid) | |
Reserve a row with a single UPDATE without holding row locks over RTTs... More... | |
claimRandom ($uuid, $rand, $gte) | |
Reserve a row with a single UPDATE without holding row locks over RTTs... More... | |
doAck (Job $job) | |
doBatchPush (array $jobs, $flags) | |
doDeduplicateRootJob (IJobSpecification $job) | |
doDelete () | |
doFlushCaches () | |
doGetAbandonedCount () | |
doGetAcquiredCount () | |
doGetSiblingQueueSizes (array $types) | |
doGetSiblingQueuesWithJobs (array $types) | |
doGetSize () | |
doIsEmpty () | |
doPop () | |
doWaitForBackups () | |
getDB ($index) | |
getJobIterator (array $conds) | |
getMasterDB () | |
getSlaveDB () | |
insertFields (IJobSpecification $job) | |
optimalOrder () | |
supportedOrders () | |
throwDBException (DBError $e) | |
![]() | |
__construct (array $params) | |
assertNotReadOnly () | |
doAck (Job $job) | |
doBatchPush (array $jobs, $flags) | |
doDeduplicateRootJob (IJobSpecification $job) | |
doDelete () | |
doFlushCaches () | |
doGetAbandonedCount () | |
doGetAcquiredCount () | |
doGetDelayedCount () | |
doGetSiblingQueueSizes (array $types) | |
doGetSiblingQueuesWithJobs (array $types) | |
doGetSize () | |
doIsEmpty () | |
doIsRootJobOldDuplicate (Job $job) | |
doPop () | |
doWaitForBackups () | |
getRootJobCacheKey ($signature) | |
isRootJobOldDuplicate (Job $job) | |
Check if the "root" job of a given job has been superseded by a newer one. More... | |
optimalOrder () | |
Get the default queue order to use if configuration does not specify one. More... | |
supportedOrders () | |
Get the allowed queue orders for configuration validation. More... | |
supportsDelayedJobs () | |
Find out if delayed jobs are supported for configuration validation. More... | |
Static Protected Member Functions | |
static | extractBlob ($blob) |
static | makeBlob ($params) |
Protected Attributes | |
WANObjectCache | $cache |
bool string | $cluster = false |
Name of an external DB cluster. More... | |
![]() | |
JobQueueAggregator | $aggr |
int | $claimTTL |
Time to live in seconds. More... | |
BagOStuff | $dupCache |
int | $maxTries |
Maximum number of times to try a job. More... | |
string | $order |
Job priority for pop() More... | |
string bool | $readOnlyReason |
Read only rationale (or false if r/w) More... | |
string | $type |
Job type. More... | |
string | $wiki |
Wiki ID. More... | |
Private Member Functions | |
getCacheKey ($property) | |
Class to handle job queues stored in the DB.
Definition at line 32 of file JobQueueDB.php.
|
protected |
Additional parameters include:
array | $params |
Definition at line 52 of file JobQueueDB.php.
References cache, and ObjectCache\getMainWANInstance().
|
protected |
Reserve a row with a single UPDATE without holding row locks over RTTs...
string | $uuid | 32 char hex string |
Definition at line 395 of file JobQueueDB.php.
References getMasterDB(), type, and wfDebug().
Referenced by doPop().
|
protected |
Reserve a row with a single UPDATE without holding row locks over RTTs...
string | $uuid | 32 char hex string |
int | $rand | Random unsigned integer (31 bits) |
bool | $gte | Search for job_random >= $random (otherwise job_random <= $random) |
Definition at line 318 of file JobQueueDB.php.
References $dir, JobQueue\$type, cache, getCacheKey(), getMasterDB(), and type.
Referenced by doPop().
|
protected |
Job | $job |
MWException |
Definition at line 455 of file JobQueueDB.php.
References $e, DBO_TRX, getMasterDB(), JobQueue\incrStats(), throwDBException(), type, and use.
|
protected |
IJobSpecification[] | $jobs | |
int | $flags |
DBError|Exception |
Definition at line 183 of file JobQueueDB.php.
References $flags, doBatchPushInternal(), getMasterDB(), and use.
This function should not be called outside of JobQueueDB.
IDatabase | $dbw | |
IJobSpecification[] | $jobs | |
int | $flags | |
string | $method |
DBError |
Definition at line 205 of file JobQueueDB.php.
References $e, $flags, $job, $res, as, IDatabase\endAtomic(), JobQueue\incrStats(), IDatabase\insert(), insertFields(), IDatabase\select(), IDatabase\startAtomic(), throwDBException(), type, and wfDebug().
Referenced by doBatchPush().
|
protected |
IJobSpecification | $job |
MWException |
Definition at line 484 of file JobQueueDB.php.
References JobQueue\$dupCache, $params, $timestamp, WANObjectCache\get(), getMasterDB(), IJobSpecification\getParams(), JobQueue\getRootJobCacheKey(), JobQueue\ROOTJOB_TTL, WANObjectCache\set(), and use.
|
protected |
Definition at line 519 of file JobQueueDB.php.
References $e, getMasterDB(), throwDBException(), and type.
|
protected |
Definition at line 542 of file JobQueueDB.php.
References JobQueue\$type, as, cache, and getCacheKey().
|
protected |
MWException |
Definition at line 145 of file JobQueueDB.php.
References $count, $dbr, $e, cache, getCacheKey(), getSlaveDB(), and throwDBException().
|
protected |
Definition at line 114 of file JobQueueDB.php.
References $count, $dbr, $e, cache, getCacheKey(), getSlaveDB(), and throwDBException().
|
protected |
Definition at line 613 of file JobQueueDB.php.
References $dbr, $res, as, and getSlaveDB().
|
protected |
Definition at line 596 of file JobQueueDB.php.
References $dbr, $res, as, and getSlaveDB().
|
protected |
Definition at line 88 of file JobQueueDB.php.
References $dbr, $e, cache, getCacheKey(), getSlaveDB(), and throwDBException().
|
protected |
Definition at line 71 of file JobQueueDB.php.
References $dbr, $e, getSlaveDB(), throwDBException(), and type.
|
protected |
Definition at line 264 of file JobQueueDB.php.
References $e, $job, $title, claimOldest(), claimRandom(), DBO_TRX, Job\factory(), getMasterDB(), JobQueue\incrStats(), Title\makeTitle(), order, recycleAndDeleteStaleJobs(), throwDBException(), type, use, and wfRandomString().
|
protected |
Definition at line 534 of file JobQueueDB.php.
References $lbFactory, and wiki.
|
staticprotected |
string | $blob |
Definition at line 800 of file JobQueueDB.php.
References $blob, and unserialize().
JobQueueDB::getAllAcquiredJobs | ( | ) |
Definition at line 560 of file JobQueueDB.php.
References getJobIterator(), and JobQueue\getType().
JobQueueDB::getAllQueuedJobs | ( | ) |
Definition at line 552 of file JobQueueDB.php.
References getJobIterator(), and JobQueue\getType().
|
private |
string | $property |
Definition at line 777 of file JobQueueDB.php.
References $property, list, type, wfForeignMemcKey(), wfSplitWikiID(), and wiki.
Referenced by claimRandom(), doFlushCaches(), doGetAbandonedCount(), doGetAcquiredCount(), and doGetSize().
JobQueueDB::getCoalesceLocationInternal | ( | ) |
Definition at line 590 of file JobQueueDB.php.
|
protected |
int | $index | (DB_REPLICA/DB_MASTER) |
Definition at line 764 of file JobQueueDB.php.
References $lbFactory, false, and wiki.
Referenced by getMasterDB(), and getSlaveDB().
|
protected |
array | $conds | Query conditions |
Definition at line 568 of file JobQueueDB.php.
References $dbr, $e, $job, Job\factory(), getSlaveDB(), Title\makeTitle(), throwDBException(), and unserialize().
Referenced by getAllAcquiredJobs(), and getAllQueuedJobs().
|
protected |
JobQueueConnectionError |
Definition at line 752 of file JobQueueDB.php.
References $e, DB_MASTER, and getDB().
Referenced by claimOldest(), claimRandom(), doAck(), doBatchPush(), doDeduplicateRootJob(), doDelete(), doPop(), insertFields(), and recycleAndDeleteStaleJobs().
|
protected |
JobQueueConnectionError |
Definition at line 740 of file JobQueueDB.php.
References $e, DB_REPLICA, and getDB().
Referenced by doGetAbandonedCount(), doGetAcquiredCount(), doGetSiblingQueueSizes(), doGetSiblingQueuesWithJobs(), doGetSize(), doIsEmpty(), and getJobIterator().
|
protected |
IJobSpecification | $job |
Definition at line 716 of file JobQueueDB.php.
References IJobSpecification\getDeduplicationInfo(), getMasterDB(), IJobSpecification\getParams(), IJobSpecification\getTitle(), IJobSpecification\getType(), and serialize().
Referenced by doBatchPushInternal().
|
staticprotected |
array | bool | $params |
Definition at line 788 of file JobQueueDB.php.
References $params, and serialize().
|
protected |
Definition at line 63 of file JobQueueDB.php.
JobQueueDB::recycleAndDeleteStaleJobs | ( | ) |
Recycle or destroy any jobs that have been claimed for too long.
Definition at line 631 of file JobQueueDB.php.
References $count, $e, $res, JobQueue\$type, getMasterDB(), JobQueue\incrStats(), throwDBException(), type, and wiki.
Referenced by doPop().
|
static |
Return the list of job fields that should be selected.
Definition at line 821 of file JobQueueDB.php.
|
protected |
Definition at line 59 of file JobQueueDB.php.
|
protected |
DBError | $e |
JobQueueError |
Definition at line 812 of file JobQueueDB.php.
Referenced by doAck(), doBatchPushInternal(), doDelete(), doGetAbandonedCount(), doGetAcquiredCount(), doGetSize(), doIsEmpty(), doPop(), getJobIterator(), and recycleAndDeleteStaleJobs().
|
protected |
Definition at line 39 of file JobQueueDB.php.
const JobQueueDB::CACHE_TTL_SHORT = 30 |
Definition at line 33 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.