MediaWiki  REL1_24
JobQueueDB Class Reference

Class to handle job queues stored in the DB. More...

Inheritance diagram for JobQueueDB:
Collaboration diagram for JobQueueDB:

List of all members.

Public Member Functions

 doBatchPushInternal (IDatabase $dbw, array $jobs, $flags, $method)
 This function should *not* be called outside of JobQueueDB.
 getAllQueuedJobs ()
 getCoalesceLocationInternal ()
 Do not use this function outside of JobQueue/JobQueueGroup.
 recycleAndDeleteStaleJobs ()
 Recycle or destroy any jobs that have been claimed for too long.

Static Public Member Functions

static selectFields ()
 Return the list of job fields that should be selected.

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

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)
 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.
 supportedOrders ()
 Get the allowed queue orders for configuration validation.
 throwDBException (DBError $e)

Static Protected Member Functions

static extractBlob ($blob)
static makeBlob ($params)

Protected Attributes

BagOStuff $cache
 *
bool string $cluster = false
 Name of an external DB cluster.

Private Member Functions

 getCacheKey ($property)

Detailed Description

Class to handle job queues stored in the DB.

Since:
1.21

Definition at line 30 of file JobQueueDB.php.


Constructor & Destructor Documentation

JobQueueDB::__construct ( array params) [protected]

Additional parameters include:

  • cluster : The name of an external cluster registered via LBFactory. If not specified, the primary DB cluster for the wiki will be used. This can be overridden with a custom cluster so that DB handles will be retrieved via LBFactory::getExternalLB() and getConnection().
    Parameters:
    array$params

Reimplemented from JobQueue.

Definition at line 49 of file JobQueueDB.php.


Member Function Documentation

JobQueueDB::claimOldest ( uuid) [protected]

Reserve a row with a single UPDATE without holding row locks over RTTs...

Parameters:
string$uuid32 char hex string
Returns:
stdClass|bool Row|false

Definition at line 418 of file JobQueueDB.php.

JobQueueDB::claimRandom ( uuid,
rand,
gte 
) [protected]

Reserve a row with a single UPDATE without holding row locks over RTTs...

Parameters:
string$uuid32 char hex string
int$randRandom unsigned integer (31 bits)
bool$gteSearch for job_random >= $random (otherwise job_random <= $random)
Returns:
stdClass|bool Row|false

Definition at line 341 of file JobQueueDB.php.

JobQueueDB::doAck ( Job job) [protected]
See also:
JobQueue::doAck()
Parameters:
Job$job
Exceptions:
MWException
Returns:
Job|bool

Reimplemented from JobQueue.

Definition at line 479 of file JobQueueDB.php.

JobQueueDB::doBatchPush ( array jobs,
flags 
) [protected]
See also:
JobQueue::doBatchPush()
Parameters:
array$jobs
int$flags
Exceptions:
DBError|Exception
Returns:
void

Reimplemented from JobQueue.

Definition at line 194 of file JobQueueDB.php.

JobQueueDB::doBatchPushInternal ( IDatabase dbw,
array jobs,
flags,
method 
)

This function should *not* be called outside of JobQueueDB.

Parameters:
IDatabase$dbw
array$jobs
int$flags
string$method
Exceptions:
DBError
Returns:
void

Definition at line 216 of file JobQueueDB.php.

JobQueueDB::doDeduplicateRootJob ( Job job) [protected]
See also:
JobQueue::doDeduplicateRootJob()
Parameters:
Job$job
Exceptions:
MWException
Returns:
bool

Reimplemented from JobQueue.

Definition at line 509 of file JobQueueDB.php.

JobQueueDB::doDelete ( ) [protected]
See also:
JobQueue::doDelete()
Returns:
bool

Reimplemented from JobQueue.

Definition at line 541 of file JobQueueDB.php.

JobQueueDB::doFlushCaches ( ) [protected]
Returns:
void

Reimplemented from JobQueue.

Definition at line 575 of file JobQueueDB.php.

See also:
JobQueue::doGetAbandonedCount()
Returns:
int
Exceptions:
MWException

Reimplemented from JobQueue.

Definition at line 155 of file JobQueueDB.php.

See also:
JobQueue::doGetAcquiredCount()
Returns:
int

Reimplemented from JobQueue.

Definition at line 124 of file JobQueueDB.php.

Returns:
array

Reimplemented from JobQueue.

Definition at line 563 of file JobQueueDB.php.

JobQueueDB::doGetSiblingQueueSizes ( array types) [protected]
See also:
JobQueue::getSiblingQueuesSize()
Parameters:
array$typesList of queues types
Returns:
array|null (list of queue types) or null if unsupported

Reimplemented from JobQueue.

Definition at line 625 of file JobQueueDB.php.

See also:
JobQueue::getSiblingQueuesWithJobs()
Parameters:
array$typesList of queues types
Returns:
array|null (list of queue types) or null if unsupported

Reimplemented from JobQueue.

Definition at line 612 of file JobQueueDB.php.

JobQueueDB::doGetSize ( ) [protected]
See also:
JobQueue::doGetSize()
Returns:
int

Reimplemented from JobQueue.

Definition at line 98 of file JobQueueDB.php.

JobQueueDB::doIsEmpty ( ) [protected]
See also:
JobQueue::doIsEmpty()
Returns:
bool

Reimplemented from JobQueue.

Definition at line 71 of file JobQueueDB.php.

JobQueueDB::doPop ( ) [protected]
See also:
JobQueue::doPop()
Returns:
Job|bool

Reimplemented from JobQueue.

Definition at line 283 of file JobQueueDB.php.

See also:
JobQueue::doWaitForBackups()
Returns:
void

Reimplemented from JobQueue.

Definition at line 556 of file JobQueueDB.php.

static JobQueueDB::extractBlob ( blob) [static, protected]
Parameters:
string$blob
Returns:
bool|mixed

Definition at line 811 of file JobQueueDB.php.

See also:
JobQueue::getAllQueuedJobs()
Returns:
Iterator

Reimplemented from JobQueue.

Definition at line 585 of file JobQueueDB.php.

JobQueueDB::getCacheKey ( property) [private]
Parameters:
string$property
Returns:
string

Definition at line 788 of file JobQueueDB.php.

Do not use this function outside of JobQueue/JobQueueGroup.

Returns:
string
Since:
1.22

Reimplemented from JobQueue.

Definition at line 606 of file JobQueueDB.php.

JobQueueDB::getDB ( index) [protected]
Parameters:
int$index(DB_SLAVE/DB_MASTER)
Returns:
DBConnRef

Definition at line 776 of file JobQueueDB.php.

JobQueueDB::getMasterDB ( ) [protected]
Exceptions:
JobQueueConnectionError
Returns:
DBConnRef

Definition at line 764 of file JobQueueDB.php.

JobQueueDB::getSlaveDB ( ) [protected]
Exceptions:
JobQueueConnectionError
Returns:
DBConnRef

Definition at line 752 of file JobQueueDB.php.

Parameters:
IJobSpecification$job
Returns:
array

Definition at line 728 of file JobQueueDB.php.

static JobQueueDB::makeBlob ( params) [static, protected]
Parameters:
array | bool$params
Returns:
string

Definition at line 799 of file JobQueueDB.php.

JobQueueDB::optimalOrder ( ) [protected]

Get the default queue order to use if configuration does not specify one.

Returns:
string One of (random, timestamp, fifo, undefined)

Reimplemented from JobQueue.

Definition at line 63 of file JobQueueDB.php.

Recycle or destroy any jobs that have been claimed for too long.

Returns:
int Number of jobs recycled/deleted

Definition at line 643 of file JobQueueDB.php.

static JobQueueDB::selectFields ( ) [static]

Return the list of job fields that should be selected.

Since:
1.23
Returns:
array

Definition at line 832 of file JobQueueDB.php.

JobQueueDB::supportedOrders ( ) [protected]

Get the allowed queue orders for configuration validation.

Returns:
array Subset of (random, timestamp, fifo, undefined)

Reimplemented from JobQueue.

Definition at line 59 of file JobQueueDB.php.

JobQueueDB::throwDBException ( DBError e) [protected]
Parameters:
DBError$e
Exceptions:
JobQueueError

Definition at line 823 of file JobQueueDB.php.


Member Data Documentation

BagOStuff JobQueueDB::$cache [protected]

*

Definition at line 37 of file JobQueueDB.php.

bool string JobQueueDB::$cluster = false [protected]

Name of an external DB cluster.

False if not set *

Definition at line 39 of file JobQueueDB.php.

Definition at line 32 of file JobQueueDB.php.

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.

Definition at line 35 of file JobQueueDB.php.


The documentation for this class was generated from the following file: