MediaWiki
1.23.2
|
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... | |
getAllQueuedJobs () | |
getCoalesceLocationInternal () | |
Do not use this function outside of JobQueue/JobQueueGroup. More... | |
recycleAndDeleteStaleJobs () | |
Recycle or destroy any jobs that have been claimed for too long. More... | |
Public Member Functions inherited from JobQueue | |
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 (Job $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... | |
getAllDelayedJobs () | |
Get an iterator to traverse over all delayed jobs in this queue. More... | |
getDelayedCount () | |
Get the number of delayed jobs (these are temporarily out of the queue). More... | |
getOrder () | |
getPeriodicTasks () | |
Return a map of task names to task definition maps. More... | |
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... | |
setTestingPrefix ( $key) | |
Namespace the queue with a key to isolate it for testing. More... | |
waitForBackups () | |
Wait for any slaves 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 Public Member Functions inherited from JobQueue | |
static | factory (array $params) |
Get a job queue object of the specified type. More... | |
static | incrStats ( $key, $type, $delta=1, $wiki=null) |
Call wfIncrStats() for the queue overall and for the queue type. More... | |
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 |
Public Attributes inherited from JobQueue | |
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 (Job $job) | |
doDelete () | |
doFlushCaches () | |
doGetAbandonedCount () | |
doGetAcquiredCount () | |
doGetPeriodicTasks () | |
doGetSiblingQueueSizes (array $types) | |
doGetSiblingQueuesWithJobs (array $types) | |
doGetSize () | |
doIsEmpty () | |
doPop () | |
doWaitForBackups () | |
getDB ( $index) | |
getMasterDB () | |
getSlaveDB () | |
insertFields (IJobSpecification $job) | |
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... | |
throwDBException (DBError $e) | |
Protected Member Functions inherited from JobQueue | |
doGetDelayedCount () | |
doIsRootJobOldDuplicate (Job $job) | |
getRootJobCacheKey ( $signature) | |
isRootJobOldDuplicate (Job $job) | |
Check if the "root" job of a given job has been superseded by a newer one. 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 | |
BagOStuff | $cache |
bool string | $cluster = false |
Name of an external DB cluster. More... | |
Protected Attributes inherited from JobQueue | |
bool | $checkDelay |
Allow delayed jobs *. More... | |
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 | $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 30 of file JobQueueDB.php.
|
protected |
Additional parameters include:
array | $params |
Reimplemented from JobQueue.
Definition at line 49 of file JobQueueDB.php.
|
protected |
Reserve a row with a single UPDATE without holding row locks over RTTs...
string | $uuid | 32 char hex string |
Definition at line 420 of file JobQueueDB.php.
References array(), 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 |
$rand | integer Random unsigned integer (31 bits) | |
bool | $gte | Search for job_random >= $random (otherwise job_random <= $random) |
Definition at line 343 of file JobQueueDB.php.
References $dir, array(), cache, getCacheKey(), getMasterDB(), and type.
Referenced by doPop().
|
protected |
Job | $job |
MWException |
Reimplemented from JobQueue.
Definition at line 481 of file JobQueueDB.php.
References $e, $job, array(), DBO_TRX, getMasterDB(), throwDBException(), and type.
|
protected |
array | $jobs | |
$flags |
DBError|Exception |
Reimplemented from JobQueue.
Definition at line 194 of file JobQueueDB.php.
References $flags, and getMasterDB().
This function should not be called outside of JobQueueDB.
IDatabase | $dbw | |
array | $jobs | |
int | $flags | |
string | $method |
DBError |
Definition at line 218 of file JobQueueDB.php.
References $e, $flags, $job, $res, array(), as, cache, CACHE_TTL_LONG, getCacheKey(), JobQueue\incrStats(), insertFields(), type, wfDebug(), and wiki.
|
protected |
Job | $job |
MWException |
Reimplemented from JobQueue.
Definition at line 511 of file JobQueueDB.php.
References $cache, JobQueue\$dupCache, $job, $params, $timestamp, BagOStuff\get(), getMasterDB(), JobQueue\getRootJobCacheKey(), JobQueue\ROOTJOB_TTL, and BagOStuff\set().
|
protected |
Reimplemented from JobQueue.
Definition at line 543 of file JobQueueDB.php.
References $e, array(), getMasterDB(), throwDBException(), and type.
|
protected |
Reimplemented from JobQueue.
Definition at line 577 of file JobQueueDB.php.
References JobQueue\$type, array(), as, cache, and getCacheKey().
|
protected |
MWException |
Reimplemented from JobQueue.
Definition at line 155 of file JobQueueDB.php.
References $count, $dbr, $e, $wgMemc, array(), getCacheKey(), getSlaveDB(), global, throwDBException(), and type.
|
protected |
Reimplemented from JobQueue.
Definition at line 124 of file JobQueueDB.php.
References $count, $dbr, $e, array(), cache, getCacheKey(), getSlaveDB(), throwDBException(), and type.
|
protected |
Reimplemented from JobQueue.
Definition at line 565 of file JobQueueDB.php.
References array().
|
protected |
array | $types | List of queues types |
Reimplemented from JobQueue.
Definition at line 627 of file JobQueueDB.php.
References $dbr, $res, array(), as, and getSlaveDB().
|
protected |
array | $types | List of queues types |
Reimplemented from JobQueue.
Definition at line 614 of file JobQueueDB.php.
References $dbr, $res, array(), as, and getSlaveDB().
|
protected |
Reimplemented from JobQueue.
Definition at line 98 of file JobQueueDB.php.
References $dbr, $e, $size, array(), cache, getCacheKey(), getSlaveDB(), throwDBException(), and type.
|
protected |
Reimplemented from JobQueue.
Definition at line 71 of file JobQueueDB.php.
References $dbr, $e, array(), cache, getCacheKey(), getSlaveDB(), throwDBException(), and type.
|
protected |
Reimplemented from JobQueue.
Definition at line 285 of file JobQueueDB.php.
References $e, $job, $title, array(), cache, claimOldest(), claimRandom(), DBO_TRX, Job\factory(), getCacheKey(), getMasterDB(), JobQueue\incrStats(), Title\makeTitleSafe(), order, throwDBException(), type, wfDebug(), wfRandomString(), and wiki.
|
protected |
Reimplemented from JobQueue.
Definition at line 558 of file JobQueueDB.php.
References wfWaitForSlaves().
|
staticprotected |
JobQueueDB::getAllQueuedJobs | ( | ) |
Reimplemented from JobQueue.
Definition at line 587 of file JobQueueDB.php.
References $dbr, $e, $job, array(), Job\factory(), getSlaveDB(), JobQueue\getType(), Title\makeTitle(), and throwDBException().
|
private |
$property |
Definition at line 790 of file JobQueueDB.php.
References $cluster, $property, list, type, wfForeignMemcKey(), wfSplitWikiID(), and wiki.
Referenced by claimRandom(), doBatchPushInternal(), doFlushCaches(), doGetAbandonedCount(), doGetAcquiredCount(), doGetSize(), doIsEmpty(), doPop(), and recycleAndDeleteStaleJobs().
JobQueueDB::getCoalesceLocationInternal | ( | ) |
Do not use this function outside of JobQueue/JobQueueGroup.
Reimplemented from JobQueue.
Definition at line 608 of file JobQueueDB.php.
|
protected |
$index | integer (DB_SLAVE/DB_MASTER) |
Definition at line 778 of file JobQueueDB.php.
References $lb, array(), false, wfGetLB(), wfGetLBFactory(), and wiki.
Referenced by getMasterDB(), and getSlaveDB().
|
protected |
JobQueueConnectionError |
Definition at line 766 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 754 of file JobQueueDB.php.
References $e, DB_SLAVE, and getDB().
Referenced by doGetAbandonedCount(), doGetAcquiredCount(), doGetSiblingQueueSizes(), doGetSiblingQueuesWithJobs(), doGetSize(), doIsEmpty(), and getAllQueuedJobs().
|
protected |
IJobSpecification | $job |
Definition at line 730 of file JobQueueDB.php.
References $job, array(), getMasterDB(), IJobSpecification\getType(), makeBlob(), and wfBaseConvert().
Referenced by doBatchPushInternal().
|
staticprotected |
$params |
Definition at line 801 of file JobQueueDB.php.
References $params.
Referenced by insertFields().
|
protected |
Get the default queue order to use if configuration does not specify one.
Reimplemented from JobQueue.
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 645 of file JobQueueDB.php.
References $count, $e, $res, array(), cache, getCacheKey(), getMasterDB(), JobQueue\incrStats(), throwDBException(), type, and wiki.
|
static |
Return the list of job fields that should be selected.
Definition at line 834 of file JobQueueDB.php.
References array().
|
protected |
Get the allowed queue orders for configuration validation.
Reimplemented from JobQueue.
Definition at line 59 of file JobQueueDB.php.
References array().
|
protected |
DBError | $e |
JobQueueError |
Definition at line 825 of file JobQueueDB.php.
References $e.
Referenced by doAck(), doDelete(), doGetAbandonedCount(), doGetAcquiredCount(), doGetSize(), doIsEmpty(), doPop(), getAllQueuedJobs(), and recycleAndDeleteStaleJobs().
|
protected |
|
protected |
Name of an external DB cluster.
False if not set *
Definition at line 39 of file JobQueueDB.php.
Referenced by getCacheKey().
const JobQueueDB::CACHE_TTL_LONG = 300 |
Definition at line 32 of file JobQueueDB.php.
Referenced by doBatchPushInternal(), JobQueueFederated\doPop(), and JobQueueFederated\tryJobInsertions().
const JobQueueDB::CACHE_TTL_SHORT = 30 |
Definition at line 31 of file JobQueueDB.php.
const JobQueueDB::MAX_AGE_PRUNE = 604800 |
Definition at line 33 of file JobQueueDB.php.
const JobQueueDB::MAX_JOB_RANDOM = 2147483647 |
Definition at line 34 of file JobQueueDB.php.
const JobQueueDB::MAX_OFFSET = 255 |
Definition at line 35 of file JobQueueDB.php.