MediaWiki master
|
Database-backed job queue storage. More...
Inherits JobQueue.
Public Member Functions | |
doBatchPushInternal (IDatabase $dbw, array $jobs, $flags, $method) | |
This function should not be called outside of JobQueueDB. | |
getAllAbandonedJobs () | |
getAllAcquiredJobs () | |
getAllQueuedJobs () | |
getCoalesceLocationInternal () | |
Do not use this function outside of JobQueue/JobQueueGroup. | |
recycleAndDeleteStaleJobs () | |
Recycle or destroy any jobs that have been claimed for too long. | |
Public Member Functions inherited from JobQueue | |
ack (RunnableJob $job) | |
Acknowledge that a job was completed. | |
batchPush (array $jobs, $flags=0) | |
Push a batch of jobs into the queue. | |
deduplicateRootJob (IJobSpecification $job) | |
Register the "root job" of a given job into the queue for de-duplication. | |
delayedJobsEnabled () | |
delete () | |
Delete all unclaimed and delayed jobs from the queue. | |
flushCaches () | |
Clear any process and persistent caches. | |
getAbandonedCount () | |
Get the number of acquired jobs that can no longer be attempted. | |
getAcquiredCount () | |
Get the number of acquired jobs (these are temporarily out of the queue). | |
getAllDelayedJobs () | |
Get an iterator to traverse over all delayed jobs in this queue. | |
getDelayedCount () | |
Get the number of delayed jobs (these are temporarily out of the queue). | |
getDomain () | |
getOrder () | |
getReadOnlyReason () | |
getSiblingQueueSizes (array $types) | |
Check the size of each of the given queues. | |
getSiblingQueuesWithJobs (array $types) | |
Check whether each of the given queues are empty. | |
getSize () | |
Get the number of available (unacquired, non-delayed) jobs in the queue. | |
getType () | |
isEmpty () | |
Quickly check if the queue has no available (unacquired, non-delayed) jobs. | |
pop () | |
Pop a job off of the queue. | |
push ( $jobs, $flags=0) | |
Push one or more jobs into the queue. | |
waitForBackups () | |
Wait for any replica DBs or backup servers to catch up. | |
Static Public Member Functions | |
static | selectFields () |
Return the list of job fields that should be selected. | |
Static Public Member Functions inherited from JobQueue | |
static | factory (array $params) |
Get a job queue object of the specified type. | |
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 (RunnableJob $job) | |
doBatchPush (array $jobs, $flags) | |
doDeduplicateRootJob (IJobSpecification $job) | |
doDelete () | |
doFlushCaches () | |
doGetAbandonedCount () | |
doGetAcquiredCount () | |
doGetSiblingQueueSizes (array $types) | |
doGetSiblingQueuesWithJobs (array $types) | |
doGetSize () | |
doIsEmpty () | |
doPop () | |
doWaitForBackups () | |
getDB ( $index) | |
getDBException (DBError $e) | |
getJobIterator (array $conds) | |
getPrimaryDB () | |
getReplicaDB () | |
insertFields (IJobSpecification $job, IReadableDatabase $db) | |
jobFromRow ( $row) | |
optimalOrder () | |
Get the default queue order to use if configuration does not specify one. | |
supportedOrders () | |
Get the allowed queue orders for configuration validation. | |
Protected Member Functions inherited from JobQueue | |
assertNotReadOnly () | |
doGetDelayedCount () | |
doIsRootJobOldDuplicate (IJobSpecification $job) | |
factoryJob ( $command, $params) | |
getRootJobCacheKey ( $signature, $type) | |
incrStats ( $key, $type, $delta=1) | |
Call StatsdDataFactoryInterface::updateCount() for the queue overall and for the queue type. | |
isRootJobOldDuplicate (IJobSpecification $job) | |
Check if the "root" job of a given job has been superseded by a newer one. | |
supportsDelayedJobs () | |
Find out if delayed jobs are supported for configuration validation. | |
supportsTypeAgnostic () | |
Subclasses should set this to true if they support type agnostic queues. | |
Static Protected Member Functions | |
static | makeBlob ( $params) |
Protected Attributes | |
string null | $cluster |
Name of an external DB cluster or null for the local DB cluster. | |
IMaintainableDatabase DBError null | $conn |
array null | $server |
Server configuration array. | |
Protected Attributes inherited from JobQueue | |
int | $claimTTL |
Time to live in seconds. | |
string | $domain |
DB domain ID. | |
GlobalIdGenerator | $idGenerator |
int | $maxTries |
Maximum number of times to try a job. | |
string | $order |
Job priority for pop() | |
string false | $readOnlyReason |
Read only rationale (or false if r/w) | |
StatsdDataFactoryInterface | $stats |
string | $type |
Job type. | |
bool | $typeAgnostic |
WANObjectCache | $wanCache |
const | QOS_ATOMIC = 1 |
const | ROOTJOB_TTL = 28 * 24 * 3600 |
|
protected |
Additional parameters include:
array | $params |
Reimplemented from JobQueue.
Definition at line 66 of file JobQueueDB.php.
References $params.
|
protected |
Reserve a row with a single UPDATE without holding row locks over RTTs...
string | $uuid | 32 char hex string |
Definition at line 440 of file JobQueueDB.php.
References getPrimaryDB(), 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 350 of file JobQueueDB.php.
References getCacheKey(), and getPrimaryDB().
Referenced by doPop().
|
protected |
RunnableJob | $job |
JobQueueConnectionError | |
JobQueueError |
Reimplemented from JobQueue.
Definition at line 506 of file JobQueueDB.php.
References $job, getDBException(), getPrimaryDB(), and JobQueue\incrStats().
|
protected |
IJobSpecification[] | $jobs | |
int | $flags |
DBError|Exception |
Reimplemented from JobQueue.
Definition at line 212 of file JobQueueDB.php.
References doBatchPushInternal(), and getPrimaryDB().
JobQueueDB::doBatchPushInternal | ( | IDatabase | $dbw, |
array | $jobs, | ||
$flags, | |||
$method ) |
This function should not be called outside of JobQueueDB.
IDatabase | $dbw | |
IJobSpecification[] | $jobs | |
int | $flags | |
string | $method |
DBError |
Definition at line 243 of file JobQueueDB.php.
References $job, Wikimedia\Rdbms\IDatabase\endAtomic(), getDBException(), JobQueue\incrStats(), insertFields(), Wikimedia\Rdbms\IDatabase\newInsertQueryBuilder(), Wikimedia\Rdbms\IReadableDatabase\newSelectQueryBuilder(), Wikimedia\Rdbms\IDatabase\startAtomic(), and wfDebug().
Referenced by doBatchPush().
|
protected |
IJobSpecification | $job |
JobQueueConnectionError |
Reimplemented from JobQueue.
Definition at line 532 of file JobQueueDB.php.
References $job, and getPrimaryDB().
|
protected |
Reimplemented from JobQueue.
Definition at line 553 of file JobQueueDB.php.
References getDBException(), and getPrimaryDB().
|
protected |
Reimplemented from JobQueue.
Definition at line 583 of file JobQueueDB.php.
References JobQueue\$type, and getCacheKey().
|
protected |
JobQueueConnectionError | |
JobQueueError |
Reimplemented from JobQueue.
Definition at line 172 of file JobQueueDB.php.
References getCacheKey(), getDBException(), and getReplicaDB().
|
protected |
Reimplemented from JobQueue.
Definition at line 137 of file JobQueueDB.php.
References getCacheKey(), getDBException(), and getReplicaDB().
|
protected |
array | $types | List of queues types |
Reimplemented from JobQueue.
Definition at line 672 of file JobQueueDB.php.
References getReplicaDB().
|
protected |
array | $types | List of queues types |
Reimplemented from JobQueue.
Definition at line 651 of file JobQueueDB.php.
References getReplicaDB().
|
protected |
Reimplemented from JobQueue.
Definition at line 111 of file JobQueueDB.php.
References getCacheKey(), getDBException(), and getReplicaDB().
|
protected |
Reimplemented from JobQueue.
Definition at line 91 of file JobQueueDB.php.
References getDBException(), and getReplicaDB().
|
protected |
Reimplemented from JobQueue.
Definition at line 306 of file JobQueueDB.php.
References $job, claimOldest(), claimRandom(), getDBException(), JobQueue\incrStats(), jobFromRow(), recycleAndDeleteStaleJobs(), and wfRandomString().
|
protected |
Reimplemented from JobQueue.
Definition at line 571 of file JobQueueDB.php.
JobQueueDB::getAllAbandonedJobs | ( | ) |
Reimplemented from JobQueue.
Definition at line 610 of file JobQueueDB.php.
References getJobIterator(), getReplicaDB(), and JobQueue\getType().
JobQueueDB::getAllAcquiredJobs | ( | ) |
Reimplemented from JobQueue.
Definition at line 601 of file JobQueueDB.php.
References getJobIterator(), getReplicaDB(), and JobQueue\getType().
JobQueueDB::getAllQueuedJobs | ( | ) |
Reimplemented from JobQueue.
Definition at line 593 of file JobQueueDB.php.
References getJobIterator(), and JobQueue\getType().
JobQueueDB::getCoalesceLocationInternal | ( | ) |
Do not use this function outside of JobQueue/JobQueueGroup.
Reimplemented from JobQueue.
Definition at line 641 of file JobQueueDB.php.
|
protected |
int | $index | (DB_REPLICA/DB_PRIMARY) |
Definition at line 842 of file JobQueueDB.php.
Referenced by getPrimaryDB(), and getReplicaDB().
|
protected |
DBError | $e |
Definition at line 931 of file JobQueueDB.php.
Referenced by doAck(), doBatchPushInternal(), doDelete(), doGetAbandonedCount(), doGetAcquiredCount(), doGetSize(), doIsEmpty(), doPop(), getJobIterator(), and recycleAndDeleteStaleJobs().
|
protected |
array | $conds | Query conditions |
Definition at line 623 of file JobQueueDB.php.
References getDBException(), getReplicaDB(), and jobFromRow().
Referenced by getAllAbandonedJobs(), getAllAcquiredJobs(), and getAllQueuedJobs().
|
protected |
JobQueueConnectionError |
Definition at line 830 of file JobQueueDB.php.
References DB_PRIMARY, and getDB().
Referenced by claimOldest(), claimRandom(), doAck(), doBatchPush(), doDeduplicateRootJob(), doDelete(), and recycleAndDeleteStaleJobs().
|
protected |
JobQueueConnectionError |
Definition at line 817 of file JobQueueDB.php.
References DB_REPLICA, and getDB().
Referenced by doGetAbandonedCount(), doGetAcquiredCount(), doGetSiblingQueueSizes(), doGetSiblingQueuesWithJobs(), doGetSize(), doIsEmpty(), getAllAbandonedJobs(), getAllAcquiredJobs(), and getJobIterator().
|
protected |
IJobSpecification | $job | |
IReadableDatabase | $db |
Definition at line 796 of file JobQueueDB.php.
References $job, NS_SPECIAL, and Wikimedia\Rdbms\Platform\ISQLPlatform\timestamp().
Referenced by doBatchPushInternal().
|
protected |
stdClass | $row |
Definition at line 912 of file JobQueueDB.php.
References $job, $params, and JobQueue\factoryJob().
Referenced by doPop(), and getJobIterator().
|
staticprotected |
array | false | $params |
Definition at line 900 of file JobQueueDB.php.
References $params.
|
protected |
Get the default queue order to use if configuration does not specify one.
Reimplemented from JobQueue.
Definition at line 83 of file JobQueueDB.php.
JobQueueDB::recycleAndDeleteStaleJobs | ( | ) |
Recycle or destroy any jobs that have been claimed for too long.
Definition at line 695 of file JobQueueDB.php.
References getDBException(), getPrimaryDB(), and JobQueue\incrStats().
Referenced by doPop().
|
static |
Return the list of job fields that should be selected.
Definition at line 940 of file JobQueueDB.php.
|
protected |
Get the allowed queue orders for configuration validation.
Reimplemented from JobQueue.
Definition at line 79 of file JobQueueDB.php.
|
protected |
Name of an external DB cluster or null for the local DB cluster.
Definition at line 55 of file JobQueueDB.php.
|
protected |
Definition at line 50 of file JobQueueDB.php.
|
protected |
Server configuration array.
Definition at line 53 of file JobQueueDB.php.