|
MediaWiki master
|
Database-backed job queue storage. More...
Inherits MediaWiki\JobQueue\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 MediaWiki\JobQueue\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 MediaWiki\JobQueue\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 MediaWiki\JobQueue\JobQueue | ||||
| assertNotReadOnly () | ||||
| doGetDelayedCount () | ||||
| doIsRootJobOldDuplicate (IJobSpecification $job) | ||||
| factoryJob ( $command, $params) | ||||
| getRootJobCacheKey ( $signature, $type) | ||||
| incrStats ( $event, $type, $delta=1) | ||||
| Call StatsFactory::incrementBy() 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 MediaWiki\JobQueue\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) | |
| StatsFactory | $stats |
| string | $type |
| Job type. | |
| bool | $typeAgnostic |
| WANObjectCache | $wanCache |
| const | QOS_ATOMIC = 1 |
| const | ROOTJOB_TTL = 28 * 24 * 3600 |
|
protected |
Additional parameters include:
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 61 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 444 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\getPrimaryDB(), and wfDebug().
Referenced by MediaWiki\JobQueue\JobQueueDB\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 354 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\getPrimaryDB().
Referenced by MediaWiki\JobQueue\JobQueueDB\doPop().
|
protected |
| RunnableJob | $job |
| JobQueueConnectionError | |
| JobQueueError |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 510 of file JobQueueDB.php.
References $job, MediaWiki\JobQueue\JobQueueDB\getDBException(), MediaWiki\JobQueue\JobQueueDB\getPrimaryDB(), and MediaWiki\JobQueue\JobQueue\incrStats().
|
protected |
| IJobSpecification[] | $jobs | |
| int | $flags |
| DBError| |
\Exception
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 209 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\doBatchPushInternal(), MediaWiki\JobQueue\JobQueueDB\getPrimaryDB(), and Profiler\instance().
| MediaWiki\JobQueue\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 242 of file JobQueueDB.php.
References $job, Wikimedia\Rdbms\IDatabase\endAtomic(), MediaWiki\JobQueue\JobQueueDB\getDBException(), MediaWiki\JobQueue\JobQueue\incrStats(), MediaWiki\JobQueue\JobQueueDB\insertFields(), Profiler\instance(), Wikimedia\Rdbms\IDatabase\newInsertQueryBuilder(), Wikimedia\Rdbms\IReadableDatabase\newSelectQueryBuilder(), Wikimedia\Rdbms\IDatabase\startAtomic(), and wfDebug().
Referenced by MediaWiki\JobQueue\JobQueueDB\doBatchPush().
|
protected |
| IJobSpecification | $job |
| JobQueueConnectionError |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 536 of file JobQueueDB.php.
References $job, and MediaWiki\JobQueue\JobQueueDB\getPrimaryDB().
|
protected |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 557 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\getDBException(), and MediaWiki\JobQueue\JobQueueDB\getPrimaryDB().
|
protected |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 587 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueue\$type.
|
protected |
| JobQueueConnectionError | |
| JobQueueError |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 169 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\getDBException(), and MediaWiki\JobQueue\JobQueueDB\getReplicaDB().
|
protected |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 134 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\getDBException(), and MediaWiki\JobQueue\JobQueueDB\getReplicaDB().
|
protected |
| array | $types | List of queues types |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 677 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\getReplicaDB().
|
protected |
| array | $types | List of queues types |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 655 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\getReplicaDB().
|
protected |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 108 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\getDBException(), and MediaWiki\JobQueue\JobQueueDB\getReplicaDB().
|
protected |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 88 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\getDBException(), and MediaWiki\JobQueue\JobQueueDB\getReplicaDB().
|
protected |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 310 of file JobQueueDB.php.
References $job, MediaWiki\JobQueue\JobQueueDB\claimOldest(), MediaWiki\JobQueue\JobQueueDB\claimRandom(), MediaWiki\JobQueue\JobQueueDB\getDBException(), MediaWiki\JobQueue\JobQueue\incrStats(), MediaWiki\JobQueue\JobQueueDB\jobFromRow(), MediaWiki\JobQueue\JobQueueDB\recycleAndDeleteStaleJobs(), and wfRandomString().
|
protected |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 575 of file JobQueueDB.php.
References MediaWiki\MediaWikiServices\getInstance().
| MediaWiki\JobQueue\JobQueueDB::getAllAbandonedJobs | ( | ) |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 614 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\getJobIterator(), MediaWiki\JobQueue\JobQueueDB\getReplicaDB(), and MediaWiki\JobQueue\JobQueue\getType().
| MediaWiki\JobQueue\JobQueueDB::getAllAcquiredJobs | ( | ) |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 605 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\getJobIterator(), MediaWiki\JobQueue\JobQueueDB\getReplicaDB(), and MediaWiki\JobQueue\JobQueue\getType().
| MediaWiki\JobQueue\JobQueueDB::getAllQueuedJobs | ( | ) |
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 597 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\getJobIterator(), and MediaWiki\JobQueue\JobQueue\getType().
| MediaWiki\JobQueue\JobQueueDB::getCoalesceLocationInternal | ( | ) |
Do not use this function outside of JobQueue/JobQueueGroup.
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 644 of file JobQueueDB.php.
|
protected |
| int | $index | (DB_REPLICA/DB_PRIMARY) |
Definition at line 847 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\$conn, and MediaWiki\MediaWikiServices\getInstance().
Referenced by MediaWiki\JobQueue\JobQueueDB\getPrimaryDB(), and MediaWiki\JobQueue\JobQueueDB\getReplicaDB().
|
protected |
| DBError | $e |
Definition at line 936 of file JobQueueDB.php.
Referenced by MediaWiki\JobQueue\JobQueueDB\doAck(), MediaWiki\JobQueue\JobQueueDB\doBatchPushInternal(), MediaWiki\JobQueue\JobQueueDB\doDelete(), MediaWiki\JobQueue\JobQueueDB\doGetAbandonedCount(), MediaWiki\JobQueue\JobQueueDB\doGetAcquiredCount(), MediaWiki\JobQueue\JobQueueDB\doGetSize(), MediaWiki\JobQueue\JobQueueDB\doIsEmpty(), MediaWiki\JobQueue\JobQueueDB\doPop(), MediaWiki\JobQueue\JobQueueDB\getJobIterator(), and MediaWiki\JobQueue\JobQueueDB\recycleAndDeleteStaleJobs().
|
protected |
| array | $conds | Query conditions |
Definition at line 627 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\getDBException(), and MediaWiki\JobQueue\JobQueueDB\getReplicaDB().
Referenced by MediaWiki\JobQueue\JobQueueDB\getAllAbandonedJobs(), MediaWiki\JobQueue\JobQueueDB\getAllAcquiredJobs(), and MediaWiki\JobQueue\JobQueueDB\getAllQueuedJobs().
|
protected |
| JobQueueConnectionError |
Definition at line 835 of file JobQueueDB.php.
References DB_PRIMARY, and MediaWiki\JobQueue\JobQueueDB\getDB().
Referenced by MediaWiki\JobQueue\JobQueueDB\claimOldest(), MediaWiki\JobQueue\JobQueueDB\claimRandom(), MediaWiki\JobQueue\JobQueueDB\doAck(), MediaWiki\JobQueue\JobQueueDB\doBatchPush(), MediaWiki\JobQueue\JobQueueDB\doDeduplicateRootJob(), MediaWiki\JobQueue\JobQueueDB\doDelete(), and MediaWiki\JobQueue\JobQueueDB\recycleAndDeleteStaleJobs().
|
protected |
| JobQueueConnectionError |
Definition at line 822 of file JobQueueDB.php.
References DB_REPLICA, and MediaWiki\JobQueue\JobQueueDB\getDB().
Referenced by MediaWiki\JobQueue\JobQueueDB\doGetAbandonedCount(), MediaWiki\JobQueue\JobQueueDB\doGetAcquiredCount(), MediaWiki\JobQueue\JobQueueDB\doGetSiblingQueueSizes(), MediaWiki\JobQueue\JobQueueDB\doGetSiblingQueuesWithJobs(), MediaWiki\JobQueue\JobQueueDB\doGetSize(), MediaWiki\JobQueue\JobQueueDB\doIsEmpty(), MediaWiki\JobQueue\JobQueueDB\getAllAbandonedJobs(), MediaWiki\JobQueue\JobQueueDB\getAllAcquiredJobs(), and MediaWiki\JobQueue\JobQueueDB\getJobIterator().
|
protected |
| IJobSpecification | $job | |
| IReadableDatabase | $db |
Definition at line 801 of file JobQueueDB.php.
References $job, MediaWiki\JobQueue\JobQueueDB\makeBlob(), NS_SPECIAL, and Wikimedia\Rdbms\Platform\ISQLPlatform\timestamp().
Referenced by MediaWiki\JobQueue\JobQueueDB\doBatchPushInternal().
|
protected |
| stdClass | $row |
Definition at line 917 of file JobQueueDB.php.
References $job, and MediaWiki\JobQueue\JobQueue\factoryJob().
Referenced by MediaWiki\JobQueue\JobQueueDB\doPop().
|
staticprotected |
| array | false | $params |
Definition at line 905 of file JobQueueDB.php.
Referenced by MediaWiki\JobQueue\JobQueueDB\insertFields().
|
protected |
Get the default queue order to use if configuration does not specify one.
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 80 of file JobQueueDB.php.
| MediaWiki\JobQueue\JobQueueDB::recycleAndDeleteStaleJobs | ( | ) |
Recycle or destroy any jobs that have been claimed for too long.
Definition at line 700 of file JobQueueDB.php.
References MediaWiki\JobQueue\JobQueueDB\getDBException(), MediaWiki\JobQueue\JobQueueDB\getPrimaryDB(), and MediaWiki\JobQueue\JobQueue\incrStats().
Referenced by MediaWiki\JobQueue\JobQueueDB\doPop().
|
static |
Return the list of job fields that should be selected.
Definition at line 945 of file JobQueueDB.php.
|
protected |
Get the allowed queue orders for configuration validation.
Reimplemented from MediaWiki\JobQueue\JobQueue.
Definition at line 75 of file JobQueueDB.php.
|
protected |
Name of an external DB cluster or null for the local DB cluster.
Definition at line 51 of file JobQueueDB.php.
|
protected |
Definition at line 46 of file JobQueueDB.php.
Referenced by MediaWiki\JobQueue\JobQueueDB\getDB().
|
protected |
Server configuration array.
Definition at line 49 of file JobQueueDB.php.